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

Support ref in secure-checkout #1005

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

ianlewis
Copy link
Member

@ianlewis ianlewis commented Oct 13, 2022

Updates #968

This PR changes the sha input for secure-checkout to ref and allows passing git a ref or sha. The action now performs validation by looking up the ref in the API and checking that the sha digest returned by the API and the sha checked out locally match. This may not necessarily satisfy the TLS interception issue brought up on #626 but at least makes it a little harder to fake a checkout.

We need to support ref in secure-checkout because we need to be able to checkout the builder using a tag reference. This is because we recommend users call our workflows using a release tag.

e.g.

uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]

This results in detect-env action returning something like refs/tags/v1.2.0 as the detected reference.

Ian Lewis added 3 commits October 13, 2022 05:07
Signed-off-by: Ian Lewis <[email protected]>
Signed-off-by: Ian Lewis <[email protected]>
@ianlewis ianlewis changed the title Secure checkout ref Support ref in secure-checkout Oct 13, 2022
sha:
description: "The SHA to checkout."
ref:
description: "The ref or SHA to checkout."
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: document that ref should be fully-formed in the form `refs/*, and that it can handle branches and tags.
currently it also handles pull requests. I'm not sure why that would be used in practice

Copy link
Collaborator

Choose a reason for hiding this comment

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

Documenting for later: we'll keep in branches, technically I think we only need it for tags and otherwise we're using sha

Signed-off-by: Ian Lewis <[email protected]>
@ianlewis ianlewis enabled auto-merge (squash) October 13, 2022 20:27
@ianlewis ianlewis merged commit cd072cf into slsa-framework:main Oct 13, 2022
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.

2 participants