Repository navigation
Conversation
Adds an IT cert for talking to admin.rhsm.redhat.com because we'll need to start using base trust for candlepin
Reviewer's GuideConfigurationAppend the internal IT root CA to the build-stage system CA bundle so the image trusts Candlepin’s admin endpoint.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="Dockerfile" line_range="29" />
<code_context>
+# Append our internal IT root CA to the system CA bundle. The final image is
+# ubi-micro and has no shell/tooling, so build the combined bundle here.
+COPY 2022-IT-Root-CA.pem /tmp/2022-IT-Root-CA.pem
+RUN cat /tmp/2022-IT-Root-CA.pem >> /etc/pki/tls/certs/ca-bundle.crt
+
</code_context>
<issue_to_address>
**Container image build fails**
When the pull-request image build runs, the Docker build cannot find `2022-IT-Root-CA.pem` in the build context for this `COPY`, so the image build fails and the pull request’s Dockerfile check cannot pass.
Add `2022-IT-Root-CA.pem` to the build context or change the `COPY` source to the certificate’s actual path.
</issue_to_address>
### Comment 2
<location path="Dockerfile" line_range="30" />
<code_context>
+# Append our internal IT root CA to the system CA bundle. The final image is
+# ubi-micro and has no shell/tooling, so build the combined bundle here.
+COPY 2022-IT-Root-CA.pem /tmp/2022-IT-Root-CA.pem
+RUN cat /tmp/2022-IT-Root-CA.pem >> /etc/pki/tls/certs/ca-bundle.crt
+
ENV GOPATH=/go \
</code_context>
<issue_to_address>
**Certificate trust is untested**
When the new CA trust behavior is added, no test verifies that the runtime image’s CA bundle contains the IT root certificate, so a regression that removes or fails to propagate it can pass unnoticed and break Candlepin TLS validation.
Add a test that verifies the runtime CA bundle contains the IT root certificate.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and the image will trust certificates issued by this root CA for TLS connections, so an incorrect or compromised CA could enable impersonation and exposure of traffic wherever the image is used. Reverting removes that trust for future connections, but any data exposed while it was trusted cannot be recovered.
Blocking findings: Dockerfile:29, Dockerfile:30
|
|
||
| # Append our internal IT root CA to the system CA bundle. The final image is | ||
| # ubi-micro and has no shell/tooling, so build the combined bundle here. | ||
| COPY 2022-IT-Root-CA.pem /tmp/2022-IT-Root-CA.pem |
There was a problem hiding this comment.
🔴 Critical · Container image build fails
When the pull-request image build runs, the Docker build cannot find 2022-IT-Root-CA.pem in the build context for this COPY, so the image build fails and the pull request’s Dockerfile check cannot pass.
Add 2022-IT-Root-CA.pem to the build context or change the COPY source to the certificate’s actual path.
Prompt for AI agents
In `Dockerfile` at line 29:
**Container image build fails**
When the pull-request image build runs, the Docker build cannot find `2022-IT-Root-CA.pem` in the build context for this `COPY`, so the image build fails and the pull request’s Dockerfile check cannot pass.
Add `2022-IT-Root-CA.pem` to the build context or change the `COPY` source to the certificate’s actual path.From README.md L57:
A large part of the application functionality is covered with tests; this requires running a test database and mocked services. All of this is encapsulated in the test configuration, which is run using podman-compose. It also includes static code analysis, database migration tests, and a Dockerfile check. It is used to check pull requests too.| # Append our internal IT root CA to the system CA bundle. The final image is | ||
| # ubi-micro and has no shell/tooling, so build the combined bundle here. | ||
| COPY 2022-IT-Root-CA.pem /tmp/2022-IT-Root-CA.pem | ||
| RUN cat /tmp/2022-IT-Root-CA.pem >> /etc/pki/tls/certs/ca-bundle.crt |
There was a problem hiding this comment.
🟡 Medium · Certificate trust is untested
When the new CA trust behavior is added, no test verifies that the runtime image’s CA bundle contains the IT root certificate, so a regression that removes or fails to propagate it can pass unnoticed and break Candlepin TLS validation.
Add a test that verifies the runtime CA bundle contains the IT root certificate.
Prompt for AI agents
In `Dockerfile` at line 30:
**Certificate trust is untested**
When the new CA trust behavior is added, no test verifies that the runtime image’s CA bundle contains the IT root certificate, so a regression that removes or fails to propagate it can pass unnoticed and break Candlepin TLS validation.
Add a test that verifies the runtime CA bundle contains the IT root certificate.From CONTRIBUTING.md L13:
- Add test for new functionality
Candlepin is moving so we have to change the way we talk to it. This adds an IT cert for talking to admin.rhsm.redhat.com because we'll need to start using base trust for candlepin
This is following this content-sources-backend PR: content-services/content-sources-backend#1854
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Enable trusted communication with the relocated Candlepin service by adding its internal CA certificate to the container trust store.
New Features:
Build: