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

PLFM-8102: Use Admin Access #1254

Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions org-formation/650-identity-providers/_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -836,12 +836,18 @@ GithubOidcNbConvertDeploy:
ProviderArn: !CopyValue [ !Sub '${resourcePrefix}-${appName}-ProviderArn' ]
ProviderRoleName: !Sub ${resourcePrefix}-${appName}-nbconvert-deploy
MaxSessionDuration: 7200
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryFullAccess"
- "arn:aws:iam::aws:policy/AWSLambda_FullAccess"
- "arn:aws:iam::aws:policy/CloudWatchLogsFullAccess"
- "arn:aws:iam::aws:policy/IAMFullAccess"
- "arn:aws:iam::aws:policy/AWSCloudFormationFullAccess"
PolicyDocument: !Sub |
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AssumeRoleStatement",
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::${AWS::AccountId}:role/cdk-*-role-*-us-east-1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be more precise, how about arn:aws:iam::${AWS::AccountId}:role/cdk-*-cfn-exec-role-${AWS::AccountId}-us-east-1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here doesn't really make sense to me because if you look at the policy for the cdk cloudformation execution role you'll see that it is given AdministratorAccess therefore it would be equivalent to giving this OIDC admin access directly. Why give this role the runaround of assuming another role with admin access when you can give this role admin access directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was reading about it afterwards... As I understand the way to solve this is to create a custom policy then redo the bootstrap such that the default Admin perms are changed to more constrained permissions (I'm a bit lost as that set of permissions would have to cover all the cases in a given account...). Maybe you're right and we may as well be explicit. I'll change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to explicitly use AdministratorAccess.

}
]
}
TemplatingContext:
GitHubOrg: "Sage-Bionetworks"
Repositories:
Expand Down
Loading