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

[IAM Controller] can't remove user #2229

Open
gecube opened this issue Dec 11, 2024 · 4 comments
Open

[IAM Controller] can't remove user #2229

gecube opened this issue Dec 11, 2024 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. service/iam Indicates issues or PRs that are related to iam-controller.

Comments

@gecube
Copy link

gecube commented Dec 11, 2024

{"level":"error","ts":"2024-12-11T00:55:29.773Z","msg":"Reconciler error","controller":"user","controllerGroup":"iam.services.k8s.aws","controllerKind":"User","User":{"name":"*****","namespace":"infra-tooling"},"namespace":"infra-tooling","name":"*****","reconcileID":"73e066c7-0af0-4813-b882-79d14295e263","error":"DeleteConflict: Cannot delete entity, must delete access keys first.\n\tstatus code: 409, request id: b3fef8ce-e08a-4e57-8ca5-01c67fd0f852","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:263\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:224"}
{"level":"info","ts":"2024-12-11T00:55:29.815Z","logger":"ackrt","msg":"updated resource","kind":"Role","namespace":"infra-tooling","name":"*****","account":"*****","role":"","region":"eu-west-2","is_adopted":false,"generation":8}

Expected behaviour:

  • either proper interface for managing access keys from ACK
  • or provide a way to remove user silently with access keys.
@gecube
Copy link
Author

gecube commented Dec 11, 2024

interesting fact: form web ui of cloud user could be deleted even the associated keys exist.

@michaelhtm michaelhtm added kind/bug Categorizes issue or PR as related to a bug. service/iam Indicates issues or PRs that are related to iam-controller. labels Dec 18, 2024
@eqe-aws eqe-aws assigned eqe-aws and TiberiuGC and unassigned eqe-aws Jan 31, 2025
@TiberiuGC
Copy link

TiberiuGC commented Feb 14, 2025

@gecube - managing access keys in ACK, either directly by supporting the CRD, or indirectly, by deleting them behind the scenes might no be desirable. I believe that managing sensitive information, such as access keys within a K8s controller is bad practice from a security standpoint.

Moreover, there's other ACK examples where this "bug" occurs, e.g. being unable to delete S3 buckets if they have objects.

@gecube
Copy link
Author

gecube commented Feb 14, 2025

@TiberiuGC Hi! Thanks for your considerations. Anyway I think that as a devops I want to have just ONE tool to manage the cloud, not the bunch of tools. Also it is logical that if we are providing ACK as a tool for preparation of ephemeral environments, I really will need some convenient way to pass a credentials to some of the legacy applications and then manage them...

Regarding this issue... There is no way to manage keys separately in ACK, as I remember. So it means that I can create something, and then I can't remove it. Even more - the ACK controller would spam Amazon API with unsuccessful attempts to remove the object. OMG.

@michaelhtm
Copy link
Member

michaelhtm commented Feb 19, 2025

Hey @gecube
turns out, to delete an IAM user someone needs to do the following:
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_remove.html#id_users_deleting_cli

This can be doable, maybe by setting an annotation deciding whether or not to force delete the User..
@a-hilaly @rushmash91 what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/iam Indicates issues or PRs that are related to iam-controller.
Projects
None yet
Development

No branches or pull requests

4 participants