Repository navigation
[publish] Add experimental provenance input and flag for package signing #441
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
Closed
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
a01aede
Support package provenance signing in publish workflow and firehose
mosuem dd40ae0
Add --package-only mode to firehose and attest-build-provenance step …
mosuem 61912c0
Fix analysis warnings in tests and add attestations permission to pub…
mosuem 9f39c57
Fix commit SHA pin for actions/attest-build-provenance
mosuem 843e694
Use actions/attest instead of actions/attest-build-provenance
mosuem ca8f3f5
Isolate packaging and attestation into separate jobs for SLSA L3
mosuem df3936d
Pass --skip-validation to pub publish --to-archive for hermetic packa…
mosuem 3c5ea66
Add validate-release job before hermetic packaging
mosuem 6febfc1
Remove actions/cache from release jobs for clean-room hermetic builds
mosuem be27129
Execute pub publish --to-archive inside unshare -r -n on Linux
mosuem 45e4178
Wrap firehose --package-only step in unshare -r -n in publish.yaml
mosuem b4d9bb3
Fix actions/upload-artifact hash pin and add contents: read to publis…
mosuem f21ab82
Add skip-validation workflow input and git tag override support
mosuem 32ac4c5
Activate firehose using the called workflow_ref in external repos
mosuem f17dff0
Add firehose_ref input to allow testing branches in external repos
mosuem bb1c806
Use sudo unshare -n to isolate network namespace on GitHub Actions ru…
mosuem d951a87
Pass -H to sudo to set user home directory properly
mosuem b7392c0
Preserve environment with sudo -E when running firehose in unshare
mosuem 6988fac
Upload attestation-bundle as a downloadable workflow artifact
mosuem e78d744
Support use-prebuilt-archive input for custom caller build pipelines
mosuem bba1780
Fix zizmor template-injection warnings by passing FIREHOSE_REF via env
mosuem 15b0423
Use job.workflow_sha to automatically pin firehose to the reusable wo…
mosuem c6b6da9
Remove firehose_ref input and rely on job.workflow_sha
mosuem c108f13
Strictly use job.workflow_sha for firehose activation without fallback
mosuem acff054
Set FIREHOSE_REF at job-level env for all jobs
mosuem 0efc029
Use dart install instead of dart pub global activate/run in publish w…
mosuem 85d1c38
Set FIREHOSE_REF on step-level env where job context is available
mosuem e516187
Fix YAML syntax for dart install commands using block scalars
mosuem b4772d8
Export Dart install bin directory to GITHUB_PATH after dart install
mosuem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,3 +23,5 @@ jobs: | |
| permissions: | ||
| id-token: write | ||
| pull-requests: write | ||
| attestations: write | ||
| contents: read | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Is it common to split the building and generating the attestation into different jobs? I'd have expected that the attestation is generated by the build.
https://github.com/actions/attest#usage says to use attest in the same workflow (which you're doing) but doesn't say if you should or shouldn't split build and attestation into separate jobs. All the examples seem to have build and attestation in the same job.
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.
I read in the SLSA docs that the build step should not have access to the secrets from the attestation step. In our case the build is just zipping files, so maybe its fine?
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.
I says "The build platform MUST guarantee the following", so I'd say it's GHA that needs to guarantee that. I don't know (and couldn't find anything in the GHA documentation) if the job boundary is a stronger security boundary than the step boundary.
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.
Two jobs does mean two different VMs, while two steps don't. Also the permissions are different for the jobs.
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.
As I understand it, we could make reusable workflow that we know will only run
pub publishwithout running any untrusted code or code from the author of the package.Then said job could both create archive, attest and publish.
But if we want to run code from the package author, yes, two jobs is probably the best option.
The job doing the attention should be trusted so keys can't be exfiltrated.