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: Record vars in SLSA generators #3633

Merged
merged 11 commits into from
May 23, 2024

Conversation

ianlewis
Copy link
Member

@ianlewis ianlewis commented May 14, 2024

Summary

Records the GitHub vars context in the SLSA invocation in the generic generator and container generator.

The vars context is passed to the "builder" binary as a JSON blob via the GITHUB_VARS environment variable. The values are then recorded in the invocation.parameters.vars field of the provenance predicate. Masking of inputs or vars is not supported.

Note that the vars context is set to the variables for the repository that initiated the GitHub Actions run and not the reusable workflow's repository.

Updates #1555

Testing Process

  • Set a variable on the test repo
    • Go to Settings -> Secrets & variables -> Actions and then click on the Variables tab.
    • Set some test variables.
  • Generate provenance as normal using the generic generator or container generator
    • Note that the compile-generator: true input must be set.
  • Examine the invocation.parameters.vars field in the resulting provenance. The vars should be recorded there.

Checklist

Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
@ianlewis ianlewis mentioned this pull request May 14, 2024
15 tasks
ianlewis and others added 2 commits May 14, 2024 20:56
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
@ianlewis ianlewis marked this pull request as ready for review May 14, 2024 21:05
Signed-off-by: Ian Lewis <ianlewis@google.com>
@ianlewis ianlewis changed the title feat: Record vars in generators and Go builder feat: Record vars in SLSA generators May 16, 2024
Signed-off-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: Ian Lewis <ianlewis@google.com>
slsa/buildtype.go Outdated Show resolved Hide resolved
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
Signed-off-by: Ian Lewis <ianmlewis@gmail.com>
@ianlewis ianlewis enabled auto-merge (squash) May 23, 2024 08:48
@ianlewis ianlewis merged commit 40c607f into slsa-framework:main May 23, 2024
75 checks passed
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.

None yet

2 participants