-
Notifications
You must be signed in to change notification settings - Fork 49
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
deleting RandomSecret resource not removing secret in vault #134
Comments
+1 We do have same issue in Openshift, not only for RandomSecrets but also for other VCO supported objects.
…________________________________
From: kartikeya vashishtha ***@***.***>
Sent: Tuesday, March 21, 2023 3:14:43 PM
To: redhat-cop/vault-config-operator ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [redhat-cop/vault-config-operator] deleting RandomSecret resource not removing secret in vault (Issue #134)
secret created in vault is not cleaned up when the Randomsecret CR is deleted.
following is the randomsecret being used:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: RandomSecret
metadata:
name: test-random-secret
spec:
authentication:
path: kubernetes
role: test
serviceAccount:
name: test
isKVSecretsEngineV2: true
path: namespace/test-random-secret-a/
secretKey: secret
secretFormat:
passwordPolicyName: 30-char
this can be replicated by creating (by adding YAML) and deleting Randomsecret on Openshift console or adding Randomsecret in helm chart.
—
Reply to this email directly, view it on GitHub<#134>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJSHCGW2RK7CVQMMWUNTGILW5GZVHANCNFSM6AAAAAAWCQDSU4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
update: on further analysis we have noticed upon deleting Randomsecret CR the value of the secret is cleared from Vault, however the key that was created by CR is not removed. |
If the RandomSecret is KV Secrets Engine v1, both the key and value of the secret is deleted. The path is not deleted. |
one of the current use-case we have is that we have Randomsecret CR as part of a helm-chart for DB instance. each instance creates a Key and value, and as per current working "cleanup" in vault, value is being deleted and key remains, leading to list of keys in vault what would never be used again |
@trevorbox we do have a similar situation. I find the default behavior safe and sound (this prevents to erroneously delete a critical secret, which can be recovered using kv-v2 version management). But there are also automation-related use cases where being able to fully remove a kv-v2 secret (read: all its versions) when the CR is removed from k8s would be helpful. So I would propose to be able to control the cleanup behavior using a new optional attribute into the I've got code and tests handy, so I can then submit a PR with all this for you to review - just let me know! |
@trevorbox I agree, this is a connected but separate improvement. |
secret created in vault is not cleaned up when the Randomsecret CR is deleted.
following is the randomsecret being used:
this can be replicated by creating (by adding YAML) and deleting Randomsecret on Openshift console or adding Randomsecret in helm chart.
The text was updated successfully, but these errors were encountered: