Closed dnozay closed 1 year ago
Hi @dnozay! We recently addressed some of the leaking role assignment concerns in https://github.com/hashicorp/vault-plugin-secrets-azure/pull/110. Does this address your concerns? If not, specific steps to reproduce leaking role assignments would be helpful here. Thanks!
@austingebauer - thanks for letting me know - I'll inform the team, got back from vacation recently.
@dnozay - I'm going to close this issue as we believe we've fixed this. Feel free to reopen this or a new issue if you've discovered otherwise!
There are 2 ways to use the azure engine wrt service principals:
So again, when using dynamic principals, the service principal is created, then a role assignment is done. Sometimes this fail, and can fail consistently.
How we found this issue:
I suspect maybe we misconfigured
permanently_delete
option or that the chosenttl
can be an issue with hitting our RoleAssignment quota before old objects are deleted / GCed.However what can happen if you use a kubernetes deployment and for some reason that deployment is failing, each restart is going to create a new service principal and a new role assignment, this can also lead to resource exhaustion.
So an operator may fix the leak by going to the azure portal, checking role assignments, deleting old ones, etc.
When role unassignment is performed, if it fails it does not retry: https://github.com/hashicorp/vault-plugin-secrets-azure/blob/main/path_service_principal.go#L276-L296 This can also be a source of leaks.