-
Notifications
You must be signed in to change notification settings - Fork 6
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: Add callbacks for verification of GHA signatures, Url Prefix #46
Conversation
Add new API: `pub CallbackRequestType::SigstoreGithubActionsVerify{}` `pub fn verify_keyless_github_actions()` Consumers of the SDK can levarage this new API call to ask for verification of signatures done with jobs in Github Actions. This API addition is leveraged by policy-evaluator to perform the callbacks in the wasm host.
Co-authored-by: Flavio Castelli <flavio@castelli.me>
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.
LGTM
Add new API: `pub CallbackRequestType::SigstoreKeylessPrefixVerify{}` `pub fn verify_keyless_prefix_match()` Consumers of the SDK can levarage this new API call to ask for verification of signatures where the subject needs to be a URL prefix of the signature subject. This API addition is leveraged by policy-evaluator to perform the callbacks in the wasm host.
@@ -35,6 +35,27 @@ pub enum CallbackRequestType { | |||
/// Optional - Annotations that must have been provided by all signers when they signed the OCI artifact | |||
annotations: Option<HashMap<String, String>>, | |||
}, | |||
|
|||
SigstoreKeylessPrefixVerify { |
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.
nitpicking, add a short description of this struct
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.
LGTM, I left some minor changes
annotations: Option<HashMap<String, String>>, | ||
}, | ||
|
||
SigstoreGithubActionsVerify { |
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.
nitpicking, add a short description of this struct
@@ -62,6 +62,51 @@ pub fn verify_keyless_exact_match( | |||
verify(req) | |||
} | |||
|
|||
/// verify sigstore signatures of an image using keyless. Here, the provided | |||
/// subject string is streated as a URL prefix, and sanitized to a valid URL on |
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.
/// subject string is streated as a URL prefix, and sanitized to a valid URL on | |
/// subject string is treated as a URL prefix, and sanitized to a valid URL on |
@@ -62,6 +62,51 @@ pub fn verify_keyless_exact_match( | |||
verify(req) | |||
} | |||
|
|||
/// verify sigstore signatures of an image using keyless. Here, the provided | |||
/// subject string is streated as a URL prefix, and sanitized to a valid URL on | |||
/// itself by appending `\` to prevent typosquatting. Then, the provided subject |
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.
/// itself by appending `\` to prevent typosquatting. Then, the provided subject | |
/// itself by appending `/` to prevent typosquatting. Then, the provided subject |
URLs end with /
, not \
sigh, sorry, github played games with me and didn't update the page with the new review until I clicked merge.. I will fix it in a follow-up PR, it also needs a version bump to consume on evaluator. |
Description
Add new API:
pub CallbackRequestType::SigstoreGithubActionsVerify{}
pub fn verify_keyless_github_actions()
pub CallbackRequestType::SigstoreKeylessPrefixVerify{}
pub fn verify_keyless_prefix_match()
Consumers of the SDK can levarage this new API call to ask for
verification of signatures done with jobs in Github Actions, and to ask for
verification of signatures where the subject needs to be a URL prefix of
the signature subject, respectively.
This API addition is leveraged by policy-evaluator to perform the
callbacks in the wasm host.
Needed by #41
Needed by #40
Test
Additional Information
Tradeoff
Potential improvement