-
Notifications
You must be signed in to change notification settings - Fork 97
Add assume role for Issuer #427
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
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9b40996 to
ebfb00a
Compare
|
@nickperry Hi, thank you for moving this topic forward. I’ll test my PR this weekend! |
|
Just pushed a rebase to this PR. We will need to work on writing integration tests as well for this change since it's going to end up being a new support auth flow. |
6c1d47a to
9fe73ca
Compare
|
I’ve just renamed the attribute role -> roleArn. I have tested it locally, and everything looks good. If anyone would like to pick up and complete the tests, feel free to do so. |
|
I hate to do this, but can you change the role field back to just role? Cert-manager uses a role arn in one of its specs so we'd like to stay consistent with it: source: https://cert-manager.io/docs/configuration/acme/dns01/route53/#cross-account-access |
Not my PR so I can't push to it, but I have implemented the name change requested by @bmsiegel here if you want to cherry-pick it nickperry@a670b1c |
491b75a to
270e8e7
Compare
e2e/common_steps.go
Outdated
|
|
||
| func getIssuerSpecWithRole(caType string) v1beta1.AWSPCAIssuerSpec { | ||
| spec := getIssuerSpec(caType) | ||
| spec.Role = fmt.Sprintf("arn:%s:iam::%s:role/IssuerTestRole-%s-%s", testContext.partition, testContext.accountId, testContext.domain, testContext.region) |
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.
instead of hard coding the name, can we make it default to "IssuerTestRole" but can be overridden by an environment variable? Alternatively, we could just take the whole role arn in as an environment variable
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.
I wanted to do it with an environment variable, but then we couldn't run the testing before we merge it. What are your thoughts?
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.
Are you suggesting that we use an override and default to IssuerTestRole?
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.
Yea, default to IssuerTestRole but then allow you to override it for more flexibility
e2e/awspcaissuer_test.go
Outdated
| // Match the complete resource: assumed-role/RoleName-DOMAIN-region/i-xxxxxxxxx | ||
| re := regexp.MustCompile(`^assumed-role/[^-]+-([^-]+)-[^/]+/i-[a-f0-9]+$`) | ||
| matches := re.FindStringSubmatch(parsedArn.Resource) | ||
| if len(matches) < 2 { | ||
| panic("Failed to extract domain from caller identity resource: " + parsedArn.Resource) | ||
| } | ||
| testContext.domain = matches[1] |
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.
I don't think it makes sense to enforce this regex
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.
Why not? If the role is formatted incorrectly and we can't find the name, what should we do?
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.
From my understanding, this regex just enforces the format of RoleName-domain-region. If we generalize it to just accept any role name, we don't need this regex and can remove the domain aspect right?
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.
If we pair this with your other comment we can remove it. I was trying to make it domain safe. But this code was intended to pull it out for the tests
045d91c to
d2f851a
Compare
Signed-off-by: Egor Novikov <[email protected]> Signed-off-by: Brady Siegel <[email protected]>
d2f851a to
901af13
Compare
Issue # 361
Closes # 361
Reason for this change
AWS RAM has restrictions that disallow issuing
isCA: truecerts from Subordinate AWS PCA.see https://docs.aws.amazon.com/privateca/latest/userguide/UsingTemplates.html
However, for example, Linkerd requires such a certificate.
This pull request allows for requesting an issue certificate directly from AWS PCA that is located in a different account.
Description of changes
A new optional field 'role' was added to Issuer and ClusterIssuer CRDs, which allows assuming a role for another account and working with AWS PCA from a different account.