-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-route53: Include CrossAccountRole scope-down guidance #28596
Comments
Worth noting I work at AWS, alias tjbryant. Working on a PR, but I wanted to follow the process and submit an issue. |
Yes we should always scope down the policies when necessary. I guess we can improve here? aws-cdk/packages/aws-cdk-lib/aws-route53/README.md Lines 182 to 227 in fdf4830
|
Correct Pahud, that's my proposal. PR added #28624 |
Reference [issue 28596](#28596) The motivation is to help CDK builders understand how to take advantage of IAM scope-down capabilities to ensure least-privilege cross-account role access related to cross account zone delegation. The Cross Account Zone Delegation guidance currently includes reference to creating a crossAccountRole, but provides no suggestion on how to safely scope down the role for least-privilege access. We can and should provide this guidance. E.g. ``` const crossAccountRole = new iam.Role(this, 'CrossAccountRole', { // The role name must be predictable roleName: 'MyDelegationRole', // The other account assumedBy: new iam.AccountPrincipal('12345678901'), }); ``` should be more like: ``` const crossAccountRole = new iam.Role(this, 'CrossAccountRole', { // The role name must be predictable roleName: 'MyDelegationRole', // The other account assumedBy: new iam.AccountPrincipal('12345678901'), // You can scope down this role policy to be least privileged. // If you want the other account to be able to manage specific records, // you can scope down by resource and/or normalized record names inlinePolicies: { "crossAccountPolicy": new iam.PolicyDocument({ statements: [ new iam.PolicyStatement({ sid: "ListHostedZonesByName", effect: iam.Effect.ALLOW, actions: ["route53:ListHostedZonesByName"], resources: ["*"] }), new iam.PolicyStatement({ sid: "GetHostedZoneAndChangeResourceRecordSet", effect: iam.Effect.ALLOW, actions: ["route53:GetHostedZone", "route53:ChangeResourceRecordSet"], // This example assumes the RecordSet subdomain.somexample.com // is contained in the HostedZone resources: ["arn:aws:route53:::hostedzone/HZID00000000000000000"], conditions: { "ForAllValues:StringLike": { "route53:ChangeResourceRecordSetsNormalizedRecordNames": [ "subdomain.someexample.com" ] } } }) }); ``` Closes #28596. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the issue
The
Cross Account Zone Delegation
guidance includes reference to creating acrossAccountRole
, but provides no suggestion on how to safely scope down the role for least-privilege access. We can and should provide this guidance.E.g.
should be more like:
Links
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html#cross-account-zone-delegation
The text was updated successfully, but these errors were encountered: