-
Notifications
You must be signed in to change notification settings - Fork 20
SHIP-0042: Trusted certificates #281
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
base: main
Are you sure you want to change the base?
Conversation
adambkaplan
left a comment
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.
Initial comments since this proposal is in the draft state. I'd like to see the scope of this proposal more clearly defined before accepting it in the "provisional" state.
| # ... | ||
| spec: | ||
| # ... | ||
| 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.
I like that we are supporting multiple certificates - this enables more fine grained distribution of trust.
I am concerned that the naming "certificates" is too broad. Are we concerned with certificate authorities for TLS verficiation? X.509 certificates for workload identity? Mutual TLS certificates between services? These are all very different things that utilize similar underlying fundamental technologies.
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.
I think we are only concerned about X.509 certificates here.
aea7ec0 to
aae10db
Compare
|
I think the scope of this SHIP should be narrowed to TLS certificate authority trust bundles. The prerequisite is that a cluster administrator defines and distributes a trust bundle, which the containers in a Shipwright build consume. Adding additional CAs to a Linux system is otherwise a huge pain - you need to save/mount the CA to the right location (which is distro-dependent), and likewise run the right "update-ca" command as root, which is likewise distro-dependent. Mounting the CA bundle avoids the requirement to run containers as root. I used the following prompt in Google Gemini with its "Thinking" model to help research the general requirements: Below is the response, which matches my knowledge and experience. Edit: I have called out a few areas where I think the LLM is wrong, or I at least disagree with the output: When using cert-manager’s trust-manager, you are essentially automating the creation of a "source of truth" CA bundle. To make your containerized applications trust this bundle, you must mount it into the specific paths where those applications or the operating system's libraries look for root certificates. 1. Where should the CA bundle be mounted?The mount point depends primarily on the base image of your container. Most Linux-based applications (like those written in Go, or tools like
Important: If you mount the ConfigMap directly to
2. Should this file be mounted in more than one place?Yes, in two specific scenarios:
Human note: On Fedora/RHEL the Java cert bundle is stored in 3. Does the mount location vary by base image?Yes. Linux distributions are split into two main families regarding certificate management:
4. Do these files need to be mounted with a specific name?While many applications can be configured via environment variables to look for a custom filename (e.g.,
Example Kubernetes Deployment SnippetIf you are using spec:
containers:
- name: my-app
volumeMounts:
- name: trusted-ca
mountPath: /etc/ssl/certs/ca-certificates.crt
subPath: ca-certificates.crt # Prevents overwriting the whole /etc/ssl/certs dir
volumes:
- name: trusted-ca
configMap:
name: my-org-bundle
items:
- key: root-ca.pem # The key in your ConfigMap
path: ca-certificates.crt # The name it will take inside the container
Summary Checklist
|
|
The one thing I would add in light of a recent issue I became aware of (konflux-ci/build-definitions#3149), is that the recommended mount points should not overwrite a symlink. |
|
This is what I think the container mount points ultimately should look like for UBI containers: |
aae10db to
95d10c4
Compare
Proposal to add a Shipwright feature to use trusted certificates in Build steps. Signed-off-by: Sayan Biswas <sayan-biswas@live.com>
95d10c4 to
7e47b7c
Compare
|
@adambkaplan Added the considerations regarding the mount point. |
adambkaplan
left a comment
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.
/approve
This SHIP meets the criteria for a provisional SHIP, in that:
- There is a defined need/use case.
- There is a proposed solution that aligns with prior community discussions (see #265).
I have added comments with respect to getting this proposal to an "implementable" state - there are more details that need to be hashed out/refined before we broadcast this feature to the community.
|
|
||
| - BuildRun.spec.certificates (highest precedence) | ||
| - Build.spec.certificates | ||
| - BuildStrategy.spec.certificates (lowest precedence, acts as a default or template) |
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.
This implies that the build strategy also defines certificate mount points that are separate and distinct from the current build volumes API.
Since this SHIP is in the provisional phase, I'm not going to block merge on this point. However we should discuss if this API is necessary before merging this as "implementable"
|
|
||
| Note: | ||
| <br> Debian-based (Ubuntu, Debian, Alpine): Use `/etc/ssl/certs/ca-certificates.crt`. | ||
| <br> Red Hat-based (UBI, RHEL, Fedora): Use `/etc/pki/tls/certs/ca-bundle.crt`. |
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.
note - This actually breaks on the latest versions of Fedora CoreOS + OKD for very complex reasons. See konflux-ci/build-definitions#3149
| Currently, Shipwright Builds face challenges when needing to utilize resources like self-signed | ||
| certificates for interacting with private Git repositories or image registries. |
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.
Feedback for getting this proposal to "implementable" - be specific about our "challenges" by linking to GitHub issues or other documented errors.
| What is out of scope for this proposal? | ||
| Listing non-goals helps to focus on discussion and make progress. |
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.
Feedback for getting this proposal to "implementable" - articulate the non-goals. This is particularly relevant with respect to what we mean by certificates below:
- Are the referenced certificates intended to be additive certificate authorities to the system's trust store?
- Are the referenced certificates intended to be trust bundles for a system's trust store?
These two are very different use cases with different implementation requirements.
| Although users can create their own ConfigMap and Secret with the certificates data, we have few options which automate this distribution of trust anchors: | ||
| - Using [TrustManager](https://cert-manager.io/docs/trust/trust-manager/) generate trust bundle and mount it in workload during reconciliation. | ||
| - Use [Cluster trust bundles](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#cluster-trust-bundles) and [clusterTrustBundle projected volumes](https://kubernetes.io/docs/concepts/storage/projected-volumes/#clustertrustbundle) to mount it in workload. |
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.
This implies that the feature should be scoped to mounting trust bundles, not additive certificate authorities.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Proposal to add a Shipwright feature to use trusted certificates in Build steps.
Changes
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes