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 #1632

Open
BrandonS05 opened this issue May 25, 2022 · 3 comments
Open

purgeUnmanagedConfig does not function as documented #1632

BrandonS05 opened this issue May 25, 2022 · 3 comments

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
Contributor

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.

Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 20 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@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
Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 20 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants