-
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
Separate user-defined secrets, to allow SealedSecrets to work for SSO, webhooks, private repos etc. #6642
Comments
I think this goes in the same direction as #6460 |
As a workaround (since you're already using Kustomize), you can use the following patch for [
{
"op": "add",
"path": "/metadata/annotations",
"value": {"sealedsecrets.bitnami.com/managed": "true"}
},
{
"op": "remove",
"path": "/metadata/labels/app.kubernetes.io~1part-of"
}
] You can specify this in your patches:
- path: patch-secret.json
target:
version: v1
kind: Secret
name: argocd-secret Of course, you'd need to pull in |
Thank you for the suggestion, @jannfis. That is pretty much what I did to work around the issue. I created a bash script to perform these steps outside of ArgoCD. Once the values created by ArgoCD are merged with my user-defined secrets, everything is checked into Git and works well from there on. |
As of v2.1 Argo CD allows referencing secret values from other secrets in the same namespace where argocd installed: https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#alternative |
That's perfect for SSO. Will that also work for webhook secrets ( |
@alexmt that's a good feature, but so long as you're putting in that kinda ${} via helm or some other kind of source control, you still need to worry about whatever thing you're using to set the argocd-secret blanking out the server.secretkey see: #10393 The better solution is to get stuff that's programmatically generated by argo, far far away from stuff that you're asking users to configure. |
+1 This is important to reduce risk when fiddling with secrets and also as more people move to Sealed Secrets or External Secrets for things like Azure AD SSO: |
Summary
The
argocd-secret
Secret should be divided into auto-generated secrets and user-defined ones, such as secrets for SSO, webhooks and private repositories.Motivation
I would like to use SealedSecrets to manage the secrets for ArgoCD. I have defined a SealedSecret for these secrets. But ArgoCD generates certain secrets during install and creates the
argocd-secret
Secret resource. Because this Secret resource is not managed by SealedSecrets, the SealedSecret that I defined cannot be applied toargocd-secrets
. Even if it did, it would overwrite the secrets that were generated by ArgoCD.Steps to reproduce this scenario:
Create a
SealedSecret
with namespaceargocd
and nameargocd-secret
, containing encrypted user-defined secrets. For example:Create the corresponding patch for
argocd-cm
ConfigMap for SSO and private repository credentials (not shown here for brevity).Create a
kustomization.yaml
file to install everything.Install.
kubectl apply -n argocd -k .
Inspect SealedSecret logs
SealedSecrets does not overwrite the existing
argocd-secret
Secret resource, which is the expected and safe behavior. However, there is no way to merge the two into one. A peek at the argocd-server logs confirms that the secrets are not injected:Proposal
argocd-secret-user
. This allows secrets management tools like SealedSecrets to inject user-defined secrets.argocd-secret-user
to also define the secrets that are sometimes auto-generated during install, includingtls.crt
,tls.key
,admin.password
,admin.passwordMtime
, andserver.secretkey
. If any of these are defined inargocd-secret-user
, they take precedence and override the values inargocd-secret
.The text was updated successfully, but these errors were encountered: