-
Notifications
You must be signed in to change notification settings - Fork 822
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
eks-prow-bulid-cluster: extract cluster admin IAM role to a module, fine-grained IAM permissions, docs #5113
Conversation
Signed-off-by: Marko Mudrinić <[email protected]>
Signed-off-by: Marko Mudrinić <[email protected]>
/hold |
/assign @sftim |
Signed-off-by: Marko Mudrinić <[email protected]>
9a615e6
to
c70c8c2
Compare
looks good @xmudrii thanks for confirming that this is already in the canary cluster. please merge when you are ready. /approve |
I didn't run the make targets but the IAM looks like it does a good job separating the ability to create/manage a cluster vs delete 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback; hope it helps!
Destroy: | ||
|
||
```bash | ||
make destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this equivalent to TF_ARGS=-destroy make apply
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be. For the reference:
-destroy Destroy Terraform-managed infrastructure.
The command "terraform destroy" is a convenience alias
for this option.
resource "aws_iam_policy" "prow_cluster_maintainer" { | ||
name = "ProwClusterMaintainer" | ||
path = "/" | ||
policy = data.aws_iam_policy_document.prow_cluster_maintainer.json | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this policy allows escalation to AdministratorAccess. We could use that (AdministratorAccess
) policy instead for now; it's simpler, and more obvious that the policy carries a risk.
Longer term, we might want to further limit the privileges that we provide here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help me understand how the policy allows it to be escalated to administrator access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed using permissions boundary at KubeCon. @pkprzekwas will follow up on and create tracking issues.
"iam:DeletePolicy", | ||
"iam:DeleteRole", | ||
"iam:DeleteRolePolicy", | ||
"iam:DetachRolePolicy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bear in mind that this can remove deny rules. A comment to that effect might be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment will be added.
Signed-off-by: Marko Mudrinić <[email protected]>
Signed-off-by: Marko Mudrinić <[email protected]>
Signed-off-by: Marko Mudrinić <[email protected]>
4d97d82
to
0f3e512
Compare
Signed-off-by: Marko Mudrinić <[email protected]>
/lgtm |
thanks @pkprzekwas /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'm applying this PR to the canary cluster, but suddenly Terraform wants to update this resource: # module.eks.aws_iam_openid_connect_provider.oidc_provider[0] will be updated in-place
~ resource "aws_iam_openid_connect_provider" "oidc_provider" {
id = "arn:aws:iam::468814281478:oidc-provider/oidc.eks.us-east-2.amazonaws.com/id/BE445C1D51F231A55B2A0E3D0140D458"
tags = {
"Name" = "prow-build-canary-cluster-eks-irsa"
}
~ thumbprint_list = [
# (2 unchanged elements hidden)
"414a2060b738c635cc7fc243e052615592830c53",
- "53011a7515ca46ed6233168766a0f1729608be0e",
+ "50879ea7f7c29dd615269e559fb061b46bdd3dbe",
]
# (4 unchanged attributes hidden)
} As per this Slack thread, we'll proceed with this update. |
Signed-off-by: Marko Mudrinić <[email protected]>
I had to add some additional permissions in 20d1da9 to be able to reconcile #5113 (comment) |
/lgtm |
Further IAM improvements will be introduced with #5160 |
Applied to both prod and canary |
This PR brings the following changes to eks-prow-build-cluster:
TODO:
All changes are applied to the canary cluster. I'll apply changes to the production cluster once the PR is merged.
/assign @pkprzekwas @ameukam @dims @rothgar