-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: keyless #1659
base: develop
Are you sure you want to change the base?
feat: keyless #1659
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ kubernetes: | |
type: RuntimeDefault # remove when using Kubernetes prior v1.19, openshift or OKD 4 | ||
podSecurityContext: {} | ||
tls: {} # set to use custom tls certificates for redis | ||
# ----------------------------------------------------- | ||
# ----------------------------------------------------- | ||
|
||
# additional labels for connaisseur resources | ||
# (except for pods – see kubernetes.deployment.podLabels for that) | ||
|
@@ -125,6 +125,13 @@ application: | |
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsx28WV7BsQfnHF1kZmpdCTTLJaWe | ||
d0CA+JOi8H4REuBaWSZ5zPDe468WuOJ6f71E7WFg3CVEVYHuoZt2UYbN/Q== | ||
-----END PUBLIC KEY----- | ||
- name: keyless | ||
type: cosign | ||
trustRoots: | ||
- name: default | ||
keyless: | ||
issuer: github | ||
subject: [email protected] | ||
|
||
# policy options: https://sse-secure-systems.github.io/connaisseur/latest/basics/#configuration-options_2 | ||
# explanation of policy patterns: https://sse-secure-systems.github.io/connaisseur/latest/basics/#image-policy | ||
|
@@ -139,6 +146,8 @@ application: | |
trustRoot: sse | ||
- pattern: "registry.k8s.io/*:*" | ||
validator: allow | ||
- pattern: "phbelitz/*:*" | ||
validator: keyless | ||
|
||
# feature descriptions: https://sse-secure-systems.github.io/connaisseur/latest/features/ | ||
features: | ||
|
@@ -158,7 +167,6 @@ application: | |
cacheErrors: true | ||
|
||
logLevel: info | ||
|
||
# alerting options: https://sse-secure-systems.github.io/connaisseur/latest/features/alerting/#configuration-options | ||
# alerting: | ||
# clusterIdentifier: example-cluster-staging-europe # defaults to "not specified" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,7 +478,7 @@ func TestValidateErrors(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
"Key must be set if Cert isn't", | ||
"Key is a required field", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not true, though? |
||
}, | ||
} | ||
for idx, tc := range testCases { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||
package utils | ||||||
|
||||||
import ( | ||||||
"crypto/x509" | ||||||
"fmt" | ||||||
"reflect" | ||||||
|
||||||
|
@@ -53,3 +54,11 @@ func Validate(s interface{}) error { | |||||
|
||||||
return fmt.Errorf("%s has %d errors:\n%s", ty, len(err.(validation.ValidationErrors)), msg) | ||||||
} | ||||||
|
||||||
func ValidateCertificate(cert string) error { | ||||||
certPool := x509.NewCertPool() | ||||||
if !certPool.AppendCertsFromPEM([]byte(cert)) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not really what this function is supposed to check.
If there is a single valid certificate inside the bytestring and then a bunch of garbage, this succeeds Also a nit: the return value is never used in its form and could be a bool with as
Suggested change
|
||||||
return fmt.Errorf("invalid certificate") | ||||||
} | ||||||
return nil | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out, I can see this as an example, but it shouldn't be part of the default config