-
Notifications
You must be signed in to change notification settings - Fork 389
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
policy.json BYOPKI signature verification API #2579
Conversation
Hi @mtrmac , I’ve created this draft PR for the policy.json API change, could you take a look and provide your initial thoughts on the structure of the API update? |
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.
Thanks! Looks good overall.
Earlier discussion openshift/enhancements#1658 .
Doing both the API and implementation in one PR works for me, having the API available but broken is not really helping anything.
b3a0606
to
f8585cd
Compare
@mtrmac Could you please take a look? It's ready for review. I am unsure about how I’m handling the intermediate certificates. |
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.
Just a few-minute first pass — this looks very good. I didn’t read this carefully, and I skipped the tests completely, for now.
Combining the policy-provided and signature-provided intermediate certificates makes sense to me, but I’ll at least check what Cosign does.
Cc: @Honny1 as well — c/image/signature is a somewhat separate part of the codebase, and as security-critical with a lot of paranoia. Worth understanding the structure and idioms. |
f8585cd
to
f70f17a
Compare
@mtrmac Do you think the PKI code needs a file like fulcio_cert_stub.go and should include build tags? I'm not fully clear on the purpose of this compile configuration. |
The Here, the only similar dependency seems to be |
I checked some cosign code, maybe I got lost in the code path, I did see it process the signature-provided intermediate certificates 🤔 |
@mtrmac could you review? |
f70f17a
to
897b425
Compare
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.
Just two nits, otherwise LGTM
897b425
to
f020a87
Compare
@containers/image-maintainers can we get this merged? |
@mtrmac Could you review this PR? |
f020a87
to
c9ea5b9
Compare
Rebased with the base branch. |
now tracked in RUN-2436 |
@QiWang19 could you rebase it again? (Maybe this would help to get this merged 😄 ) |
c9ea5b9
to
5e5e968
Compare
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.
Looks very good overall, ~1.5 comment on the substance of the code; almost all are about testing or documentation.
I think this is for I think the relevant code path for reading signatures from the image is https://github.com/sigstore/cosign/blob/737c83c71cd42ba8db843f84beadcd59b3aa6e0a/pkg/cosign/verify.go#L822-L841 . It is convoluted, but, effectively, if the configuration contains intermediates, the ones from the signature are ignored. I think that behavior is unintuitive — it means that adding more configuration (possibly 100% redundant configuration) can turn accepted signatures into rejected signatures. That code comes from sigstore/cosign#1804 , which effectively proposes to use TUF to stop accepting intermediate certificates without revoking them in any way. I don’t understand the use of intermediate certificates in this manner; it seems to me that shipping these intermediates “as trusted roots” would work well, then TUF could be used to ship a configuration update where the compromised certificate is simply dropped. For comparison, Go’s TLS implementation takes certificates only from the protocol data, it does not allow users to provide intermediates at all. For BYOPKI, I wouldn’t expect TUF to be used. If I’m not missing something subtle about this, let’s leave the behavior as is. |
24bc182
to
4c71319
Compare
@mtrmac PTAL |
7760cc2
to
a4aa6e3
Compare
As noted elsewhere, this is approved for RHEL 9.6/10.0 if this is merged and then backported into the c/image release-5.34 branch on or before Friday, February 28, 2024. The Jira cards for this work are: |
e799c45
to
8b7a0ec
Compare
rebased with the latest branch |
^^ replaced with RUN-2436 |
8b7a0ec
to
a3911e4
Compare
a3911e4
to
80bc666
Compare
80bc666
to
27e2898
Compare
Signed-off-by: Qi Wang <[email protected]>
27e2898
to
a1af69a
Compare
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.
Thanks! Great work.
@TomSweeneyRedHat I have filed #2725 for the backport. Also, #2724 can track adding the corresponding signing code. After that, no new options should be necessary in Skopeo/Podman, just updating c/image. |
@QiWang19 v5.34.1 release just dropped on c/image, FYI, and Happy Fri-YAY! |
@TomSweeneyRedHat @mtrmac Thanks! |
Bump c/image to v5.34.1 which will bring in BYOPKI signature verification per CRIO's request starting with: containers/image#2579 This is targeted for RHEL 9.6/10.0 ZeroDay. Signed-off-by: tomsweeneyredhat <[email protected]>
OCPNODE-2338