Repository navigation
workflows/release: upload assets, dogfood verification - #116
Conversation
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
| ./smoketest-env/bin/python -m \ | ||
| sigstore verify \ | ||
| --cert "${dist}.crt" --signature "${dist}.sig" \ | ||
| --cert-oidc-issuer https://token.actions.githubusercontent.com \ |
There was a problem hiding this comment.
IMO we need some way to verify the workflow (org, repo, name) here as well. Maybe not a blocker for this but something to think about
There was a problem hiding this comment.
Yep. These are the X.509v3 extensions we can verify against:
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature
X509v3 Extended Key Usage:
Code Signing
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
D2:A5:AA:A9:BF:8D:EA:35:7D:C5:6B:16:A8:45:68:A2:9A:15:2C:FB
X509v3 Authority Key Identifier:
58:C0:1E:5F:91:45:A5:66:A9:7A:CC:90:A1:93:22:D0:2A:C5:C5:FA
X509v3 Subject Alternative Name: critical
URI:https://github.com/sigstore/sigstore-python/.github/workflows/release.yml@refs/tags/v0.4.2
1.3.6.1.4.1.57264.1.1:
https://token.actions.githubusercontent.com
1.3.6.1.4.1.57264.1.6:
refs/tags/v0.4.2
1.3.6.1.4.1.57264.1.3:
dd2be1d19eeb0fbffbc36afe27bba7ba03fe97cf
1.3.6.1.4.1.57264.1.5:
sigstore/sigstore-python
1.3.6.1.4.1.57264.1.2:
release
1.3.6.1.4.1.57264.1.4:
release
So we could additionally do the SAN here (since we have that via the misleading --cert-email option), as well as the commit hash and symbolic ref.
There was a problem hiding this comment.
Yes, I would agree checking SAN would make sense. My security property assumptions (that I have not yet checked against github docs) are
- GitHub asserts that the workflow referred to by SAN was used to run this build
- GitHub asserts that it only gives OIDC tokens to trusted GitHub build systems
This still leaves some details (like the choice of using mutable tag in SAN) that could be improved by checking the other extensions if/when that is possible, but I think SAN+OIDC provider is a very good starting point.
There was a problem hiding this comment.
GitHub asserts that the workflow referred to by SAN was used to run this build
Yes, this is my understanding.
GitHub asserts that it only gives OIDC tokens to trusted GitHub build systems
Assuming you mean GitHub-hosted systems that have the appropriate permissions, I believe so.
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
To avoid confusing twine. Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
There was a problem hiding this comment.
Looks good.
As a future consideration, if GitHub alone has six seemingly custom extensions that they think are useful, it looks like a somewhat generic --cert-extension <id> <value> option could maybe make sense -- so that callers can decide what they expect the certificate to contain without requiring specific support from sigstore-python?
I can see a benefit in making the GitHub case smoother than just that, but maybe a separate example script (or maybe a separate command sigstore verify-github) would be more useful than adding many potentially github-specific options to sigstore verify?
| ./smoketest-env/bin/python -m \ | ||
| sigstore verify \ | ||
| --cert "${dist}.crt" --signature "${dist}.sig" \ | ||
| --cert-oidc-issuer https://token.actions.githubusercontent.com \ |
There was a problem hiding this comment.
Yes, I would agree checking SAN would make sense. My security property assumptions (that I have not yet checked against github docs) are
- GitHub asserts that the workflow referred to by SAN was used to run this build
- GitHub asserts that it only gives OIDC tokens to trusted GitHub build systems
This still leaves some details (like the choice of using mutable tag in SAN) that could be improved by checking the other extensions if/when that is possible, but I think SAN+OIDC provider is a very good starting point.
| # Confusingly, this action also supports updating releases, not | ||
| # just creating them. This is what we want here, since we've manually | ||
| # created the release that triggered the action. | ||
| uses: softprops/action-gh-release@v1 |
There was a problem hiding this comment.
We use this action in python-tuf as well, at least for now... It is weird that GitHub does not provide this as a standard action and instead forces us to use third parties just to upload release artifacts but 🤷 .
There was a problem hiding this comment.
Yep, this is a frustration of mine with Actions: GitHub invested a lot of time and effort into initial implementations of a lot of things under the actions/ namespace, but doesn't maintain many of them anymore. The "correct" action to use here is actions/upload-release-asset, but it's completely unmaintained and doesn't support globs.
Co-authored-by: Dustin Ingram <[email protected]>
I agree, although IMO Or |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Brian DeHamer <[email protected]>

Needs testing with a prerelease.Closes #106.
cc @jku
Signed-off-by: William Woodruff [email protected]