Skip to content
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

purgeUnmanagedConfig does not function as documented #238

Open
BrandonS05 opened this issue May 25, 2022 · 1 comment
Open

purgeUnmanagedConfig does not function as documented #238

BrandonS05 opened this issue May 25, 2022 · 1 comment
Labels
lifecycle/keep Denotes an issue or PR that should be preserved from going stale.

Comments

@BrandonS05
Copy link

BrandonS05 commented May 25, 2022

Describe the bug:
This is a followup to https://github.com/banzaicloud/bank-vaults/issues/605. The functionality of purgeUnmanagedConfig does not function as documented (https://banzaicloud.com/docs/bank-vaults/external-configuration/purge-unmanaged-configuration). The documentation claims that purgeUnmanagedConfig gives you "full control" by removing any unmanaged configuration, and once enabled "any changes not in Bank-Vaults configuration will be removed (including manual changes)." When I add a line in externalConfig to create a k8s role, then later remove it, the role is not cleaned up. The same is true when adding and removing an ldap group. The only way I'm able to clean up auth configuration via external config is by deleting all auth config to disable the auth engine, then adding the auth config back in again.

Expected behaviour:
If I remove a single authentication role, group, etc. from my externalConfig, purgeUnmanagedConfig should clean it up.

Steps to reproduce the bug:
Add an auth role in externalConfig with purgeUnmanagedConfig enabled, reapply the vault cr with the line removed, and observe the role is not cleaned up on Vault.

Environment details:
bank-vaults version: 1.15.2
Install method: helm
Logs from the misbehaving component: no error logs; bank-vaults logs claim the configuration is successful.

/kind bug

@AndersBennedsgaard
Copy link

I agree, the documentation could be improved with regards to the garbage collection.

The reason for this discrepancy with roles not being removed, is that https://github.com/banzaicloud/bank-vaults/pull/1513 only introduced garbage collection of the unmanaged auth methods with purgeUnmanagedConfig, and not the underlying roles.
I believe a solution could be as simple as adding a removeUnmanagedRoleMethods, similar to internal/vault/auth_methods.go#L471, which just loops over each existing auth method, and checks for the existence of each declared role.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Feb 18, 2024
@akijakya akijakya removed the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Feb 20, 2024
@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Apr 21, 2024
@csatib02 csatib02 removed the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Apr 21, 2024
@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Jun 23, 2024
@bank-vaults bank-vaults deleted a comment from github-actions bot Jun 23, 2024
@bank-vaults bank-vaults deleted a comment from github-actions bot Jun 23, 2024
@bank-vaults bank-vaults deleted a comment from github-actions bot Jun 23, 2024
@csatib02 csatib02 removed the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Jun 23, 2024
@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Aug 25, 2024
@csatib02 csatib02 transferred this issue from bank-vaults/bank-vaults Aug 25, 2024
@csatib02 csatib02 removed the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Aug 25, 2024
@bank-vaults bank-vaults deleted a comment from github-actions bot Aug 25, 2024
@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Oct 27, 2024
@bank-vaults bank-vaults deleted a comment from github-actions bot Oct 27, 2024
@csatib02 csatib02 added lifecycle/keep Denotes an issue or PR that should be preserved from going stale. and removed lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. labels Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/keep Denotes an issue or PR that should be preserved from going stale.
Projects
None yet
Development

No branches or pull requests

4 participants