-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Provide a easy way to add a custom CA #7572
Comments
This can be achieved by creating a Kubernetes secret and adding it as volume mounts to the argo-cd pods. Since ArgoCD is written in Go it will automatically look for the custom CA certs placed in
controller:
volumeMounts:
- name: custom-ca-certificates
mountPath: /etc/ssl/certs/custom-ca-certificates.crt
subPath: custom-ca-certificates.crt
volumes:
- name: custom-ca-certificates
secret:
defaultMode: 420
secretName: custom-ca-certificates
repoServer:
volumeMounts:
- name: custom-ca-certificates
mountPath: /etc/ssl/certs/custom-ca-certificates.crt
subPath: custom-ca-certificates.crt
volumes:
- name: custom-ca-certificates
secret:
defaultMode: 420
secretName: custom-ca-certificates
server:
volumeMounts:
- name: custom-ca-certificates
mountPath: /etc/ssl/certs/custom-ca-certificates.crt
subPath: custom-ca-certificates.crt
volumes:
- name: custom-ca-certificates
secret:
defaultMode: 420
secretName: custom-ca-certificates
|
The operator has no such fields. Any insights? |
I had multiple certs (root and intermediaries) so I mounted the certs on initContainers:
name: generate-certs
image: docker.io/alpine/curl:latest
command:
- "/usr/sbin/update-ca-certificates"
securityContext:
runAsUser: 0
runAsGroup: 0
runAsNonRoot: false
allowPrivilegeEscalation: true
readOnlyRootFilesystem: false
capabilities:
add:
- ALL
volumeMounts:
- name: ssl-certs
mountPath: /etc/ssl/certs
- name: ssl-local
mountPath: /usr/local/share/ca-certificates
volumes:
- name: ssl-certs
emptyDir: {}
- name: ssl-local
emptyDir: {} I put this init job on every application that required the certs:
|
I've been using the work around to use a mount to overwrite /etc/ssl/certs but this is not a full solution. Overwriting /etc/ssl/certs with my onprem certs means that some certs normally verified with the default /etc/ssl/certs were are no longer verified, such as dev.azure.com in my situation. I can add them manually but eventually they expire. In the past I have copied the ca-certificates bundle which comes with linux by default, appended my onprem certs, then added this to a configmap or secret, but it turned out the file was too big so this work-around does not always work. We need a way to specify onprem certs that will then be added using whatever method the source argocd image uses such as 'update-ca-trust' or 'update-ca-certificates' after adding to an import directory. |
I wrote up a way to implement this at another site, maybe we could use the same technique:
|
SummaryHere's a pvc-based workaround inspired by @WesselAtWork (needed to get around size limitations of a configmap / secret, otherwise we could just mount one of those):
Requirements
Recommend
Additional
initContainers
|
The idea to just mount a configmap /secret should not be considered a solution. This works in most cases but requires a person to start googling until they find out the right location to put the file vs just searching for 'bundle' or 'cert' in the values.yaml and being done. Why not just let the user specify a secret to use and put it where it needs to go ... the consumer shouldn't have to know what language or image file is being used to get the onprem certs installed. |
Another workaround with the operator by specifying volumes and volumeMounts in the crd argocds.argoproj.io, ca certificats are in the configmap ca-certs :
|
I am facing the same issue when pulling docker images from a custom private registry with self signed cert.
Is there other work around that worked for anyone? |
+1 |
We add the special key `_default_ca_fallback_` in argocd-tls-certs-cm that acts as a fallback. So when connecting to `server.example.com` we will look for the entry `server.example.com` and fall back to the entry `_default_ca_fallback_` if the former is missing. Closes: argoproj#7572 Signed-off-by: Michele Baldessari <[email protected]>
We add the special key `_default_ca_fallback_` in argocd-tls-certs-cm that acts as a fallback. So when connecting to `server.example.com` we will look for the entry `server.example.com` and fall back to the entry `_default_ca_fallback_` if the former is missing. Closes: argoproj#7572 Signed-off-by: Michele Baldessari <[email protected]>
We add the special key `_default_ca_fallback_` in argocd-tls-certs-cm that acts as a fallback. So when connecting to `server.example.com` we will look for the entry `server.example.com` and fall back to the entry `_default_ca_fallback_` if the former is missing. Closes: argoproj#7572 Signed-off-by: Michele Baldessari <[email protected]>
Summary
Argo supports adding a custom TLS certificate per repository, but it isn't very scalable if you ex: want to MITM all traffic.
Motivation
In our case we want to MITM all traffic with a proxy and we don't necessarily know all server names up front. Adding a TLS certificate per server name is cumbersome and the only alternative seems to BYOI (add the certificate and run
update-ca-certificates
).Proposal
We could perhaps use the existing infrastructure and support a "default certificate" in:
argo-cd/util/cert/cert.go
Lines 321 to 334 in b37eee1
The text was updated successfully, but these errors were encountered: