feat: add SubjectExpression CEL field to Identity for dynamic keyless signing#64
Open
jzeng4 wants to merge 1 commit intokyverno:mainfrom
Open
feat: add SubjectExpression CEL field to Identity for dynamic keyless signing#64jzeng4 wants to merge 1 commit intokyverno:mainfrom
jzeng4 wants to merge 1 commit intokyverno:mainfrom
Conversation
3faccc1 to
37ae598
Compare
… signing Add a new optional SubjectExpression field to the Identity struct, which accepts a CEL expression evaluated at admission time. The result is used as a regexp match against the certificate SAN URI, enabling dynamic subject matching (e.g. based on namespace or image name) without changing existing Subject/SubjectRegExp fields. Signed-off-by: Junyuan Zeng <jzeng04@gmail.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subjectExpressionfield to theIdentitystruct inImageValidatingPolicysubject,subjectRegExp,issuer, andissuerRegExpfields are unchangedmessage/messageExpressionconvention used elsewhere in KyvernoMotivation
When verifying keyless (Fulcio/Sigstore) image signatures in multi-tenant clusters, the expected certificate SAN URI often needs to be derived from runtime context — for example, the namespace of the requesting object or the image reference itself. The static
subjectRegExpfield cannot express this.Related issue
Fixes kyverno/kyverno#15398
Next PR: kyverno/kyverno#15479
Example
Test plan
pkg/imageverification/variables/attestors_test.gocover static values, subject-from-namespace, subject-from-image, and error cases