-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow wildcard matching of service account subject #8629
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
base: main
Are you sure you want to change the base?
Conversation
|
Example: eksctl create iamserviceaccount \
--name crossplane \
--namespace crossplane-system \
--cluster "$CLUSTER_NAME" \
--role-name "$ROLE_NAME" \
--attach-policy-arn 'arn:aws:iam::aws:policy/AdministratorAccess' \
--subject-pattern 'provider-aws-*' \
--role-only \
--approve |
NicholasBlaskey
left a comment
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.
Feature looks reasonable to me. Thanks for contributing a fix
Implementation looks good to me just have a comment couples
| // instead of the service account name, and StringLike is used instead of StringEquals | ||
| // to allow wildcard matching. This only works when using command line flags (not with config files). | ||
| // +optional | ||
| SubjectPattern string `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.
Is there a reason we can't support this for config too?
| // MakeAssumeRolePolicyDocumentWithServiceAccountConditionsAllowingWildcard constructs a trust policy document | ||
| // that allows wildcard pattern matching in the subject condition. The subjectPattern should be in the format | ||
| // "system:serviceaccount:namespace:name-pattern" where name-pattern can include wildcards like "*". | ||
| func (m *OpenIDConnectManager) MakeAssumeRolePolicyDocumentWithServiceAccountConditionsAllowingWildcard(serviceAccountNamespace, subjectPattern string) cft.MapOfInterfaces { |
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.
Could we update MakeAssumeRolePolicyDocumentWithServiceAccountConditions to take subjectPattern instead of creating another function to avoid duplicating some of the logic?
Description
This PR adds
--subject-patterntoeksctl create iamserviceaccount.#8628
Checklist
README.md, or theuserdocsdirectory)area/nodegroup) and kind (e.g.kind/improvement)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯