-
Notifications
You must be signed in to change notification settings - Fork 138
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
[discussion] Harden repository checkout #626
Comments
fyi @MarkLodato |
I tested a different attack. Say, there's a new tag pushed by maintainers. The checkout Action seems to fetch and do if [[ "$(git log -1 --format='%H')" != "$GITHUB_SHA" ]]; then
echo "bad"
exit 1
fi I'll send a PR for this. |
I think one important thing to point out is that |
Also, I think we can improve the checks we have currently that disallow using 'actions/checkout' in our internal actions and extend to workflows as well. We can have an internal action for checking out code without a |
Let's also address:
|
We use the
actions/checkout
to fetch the repository source code. Internally, the action uses GH APIs to fetch the tarball, but it never validates that it's a valid git tree and / or that it corresponds to the expected hashGITHUB_SHA
.One possible attack here is a TLS interception: we could be served a different source code. That also got me thinking whether we should propose recording the TLS connection parameters used by builders in the SLSA provenance (TLS version, ciphersuite, certificate). It would bloat the provenance output, and is not necessary if sha validation is performed.
Note: I think it's common practice to fetch source code via API or download it from the a release URL in general. So I think hardening the validation is going to be something that needs to be called out in SLSA guidelines somewhere.
Note: I think none of the TLS client libraries (node, golang, etc) have configuration options to verifier the certificate is in the CT log. So it could be difficult to find evidence that something happened.
The text was updated successfully, but these errors were encountered: