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 internal reproducible git checksum builtin #203

Merged
merged 12 commits into from
Oct 22, 2024

Conversation

jonnystoten
Copy link
Member

@jonnystoten jonnystoten commented Oct 17, 2024

Adds a new rego builtin attest.internals.reproducible_git_checksum. This is needed for verifying DOI provenance, see https://github.com/docker/doi-image-policy/blob/main/slsa.md#doi-build-reproducible-git-checksum.

We use https://github.com/go-git/go-git for as much of this as possible, but it doesn't support the actual archive operation, so we shell out to git for that.

There is some similar unexported code in bashbrew, and we should probably be using the same code in the build process as we are here. I'll create a follow-up ticket to sort that out.

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 74.58564% with 46 lines in your changes missing coverage. Please review.

Project coverage is 66.61%. Comparing base (3cf2d92) to head (ef18345).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/git/git.go 74.28% 19 Missing and 8 partials ⚠️
policy/rego.go 75.00% 13 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   66.37%   66.61%   +0.24%     
==========================================
  Files          44       45       +1     
  Lines        3215     3373     +158     
==========================================
+ Hits         2134     2247     +113     
- Misses        779      810      +31     
- Partials      302      316      +14     
Flag Coverage Δ
unittests 66.61% <74.58%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonnystoten jonnystoten force-pushed the reproducible-git-checksum branch 5 times, most recently from 6d45421 to 55f9757 Compare October 22, 2024 11:23
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
Signed-off-by: Jonny Stoten <jonny.stoten@docker.com>
@jonnystoten jonnystoten marked this pull request as ready for review October 22, 2024 11:31
@jonnystoten jonnystoten requested a review from a team as a code owner October 22, 2024 11:31
policy/rego.go Show resolved Hide resolved
@jonnystoten jonnystoten merged commit a078fba into main Oct 22, 2024
10 checks passed
@jonnystoten jonnystoten deleted the reproducible-git-checksum branch October 22, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants