Skip to content
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

Merged
merged 5 commits into from
Jul 5, 2022

Conversation

viccuad
Copy link
Member

@viccuad viccuad commented Jun 24, 2022

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

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.
src/host_capabilities/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Flavio Castelli <flavio@castelli.me>
@viccuad viccuad requested a review from flavio June 24, 2022 12:40
Copy link
Contributor

@raulcabello raulcabello left a 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.
@viccuad viccuad changed the title feat: Add callbacks for verification of GHA signatures feat: Add callbacks for verification of GHA signatures, Url Prefix Jul 4, 2022
@viccuad viccuad marked this pull request as ready for review July 4, 2022 11:13
@viccuad viccuad requested a review from a team as a code owner July 4, 2022 11:13
@@ -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 {
Copy link
Member

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

Copy link
Member

@flavio flavio left a 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 {
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// itself by appending `\` to prevent typosquatting. Then, the provided subject
/// itself by appending `/` to prevent typosquatting. Then, the provided subject

URLs end with /, not \

@viccuad viccuad merged commit bf66814 into kubewarden:main Jul 5, 2022
@viccuad
Copy link
Member Author

viccuad commented Jul 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants