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

Same ARN twice overwrites previous groups #271

Open
mmack opened this issue Oct 15, 2019 · 10 comments
Open

Same ARN twice overwrites previous groups #271

mmack opened this issue Oct 15, 2019 · 10 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@mmack
Copy link

mmack commented Oct 15, 2019

Hey guys,

I made a rather stupid mistake, but the outcome is kinda catastrophic :)
If you use the same ARN twice, I guess the groups are not merged but the last one is used alone.

See this example:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system
data:
  mapRoles: |
    - rolearn: "arn:aws:iam::X:role/for-nodes"
      username: "system:node:{{EC2PrivateDNSName}}"
      groups:
        - system:bootstrappers
        - system:nodes
    - rolearn: "arn:aws:iam::X:role/admins"
      username: "operator"
      groups:
        - "system:masters"
    - rolearn: "arn:aws:iam::X:role/Some-user"
      groups:
        - test-max-dev-group
    - rolearn: "arn:aws:iam::X:role/admins"
      groups:
        - test-andi-dev-group

So by attaching "arn:aws:iam::X:role/admins" twice I removed access to the "system:masters" group and i'm out of business here. The group "test-andi-dev-group" has only access to it's own namespace so I'm not able to change anything in "kube-system" anymore.

Any ideas on getting back access to my cluster than using etdc directly?

Max

@mmack mmack changed the title Same ARN leads to Same ARN twice overwrites previous groups Oct 15, 2019
@nckturner
Copy link
Contributor

Merging groups makes sense in this case, but what would the behavior be when username conflicts? Maybe the right thing to do here is to use the first mapping instance alone, that way the new mapping doesn't work, but existing permissions are unaffected.

@nckturner nckturner added the kind/bug Categorizes issue or PR as related to a bug. label Oct 23, 2019
@mmack
Copy link
Author

mmack commented Oct 23, 2019

access rights are mapped based on the ARN and groups, so the username is just a "display thing", right? So i would just ignore it in the merge process... Or maybe throw a warning...

@nckturner
Copy link
Contributor

No, the username is the username in Kubernetes when it is provided, so it affects which RBAC is applied.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 21, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 20, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nckturner
Copy link
Contributor

/reopen
/remove-lifecycle rotten

@k8s-ci-robot
Copy link
Contributor

@nckturner: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle rotten

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot reopened this Jun 25, 2020
@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 25, 2020
@nckturner
Copy link
Contributor

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Jun 25, 2020
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. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

4 participants