-
Notifications
You must be signed in to change notification settings - Fork 565
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
Implement identities, fix bug in webhook validation. #1759
Conversation
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Codecov Report
@@ Coverage Diff @@
## main #1759 +/- ##
==========================================
+ Coverage 30.17% 30.54% +0.37%
==========================================
Files 143 143
Lines 8607 8655 +48
==========================================
+ Hits 2597 2644 +47
- Misses 5710 5711 +1
Partials 300 300
Continue to review full report at Codecov.
|
…e specified. Fix the actions yaml file typo. missing actual run, doh. Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
|
||
// Identities is an array of Identity (Subject, Issuer) matchers that have | ||
// to be met for the signature to ve valid. | ||
// Supercedes CertEmail / CertOidcIssuer |
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.
Can we change those to pass a []v1alpha1.Identity
?
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.
Thought about it, but did not want to change them because they would match other things than email and that would be a change in behaviour. So, I'd rather not do that as part of this PR.
if regex, err := regexp.Compile(identity.Issuer); err != nil { | ||
return nil, fmt.Errorf("malformed issuer in identity: %s : %w", identity.Issuer, err) |
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.
We should check in the webhook that these are valid regex
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.
Yeah, I'll do that in a follow up PR and add tests for them, ok?
regex, err := regexp.Compile(identity.Subject) | ||
if err != nil { | ||
return nil, fmt.Errorf("malformed subject in identity: %s : %w", identity.Subject, err) | ||
} |
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.
same
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.
same same :)
// Identities is an array of Identity (Subject, Issuer) matchers that have | ||
// to be met for the signature to ve valid. | ||
// Supercedes CertEmail / CertOidcIssuer | ||
Identities []v1alpha1.Identity |
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.
This causes every user of pkg/cosign
to depend on k8s; updating to a recent Cosign version thus adds 1.157 million lines of code.
Please consider some other API design.
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.
unnecessary k8s libraries. Brought up as an issue that was merged in: sigstore#1759 Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
unnecessary k8s libraries. Brought up as an issue that was merged in: sigstore#1759 Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
unnecessary k8s libraries. Brought up as an issue that was merged in: #1759 Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
* Implement identites, fix bug in webhook validation. Signed-off-by: Ville Aikas <vaikas@chainguard.dev> * fix lint. Signed-off-by: Ville Aikas <vaikas@chainguard.dev> * Fix the invalid test that was incorrectly assuming identities can't be specified. Fix the actions yaml file typo. missing actual run, doh. Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
…1790) unnecessary k8s libraries. Brought up as an issue that was merged in: sigstore#1759 Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas vaikas@chainguard.dev
Summary
Ticket Link
Fixes
Release Note