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

Adding permissions boundary #62

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Changes from all 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
9 changes: 9 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,19 @@ Parameters:
- "true"
- "false"
Default: "true"

RolePermissionsBoundaryARN:
Type: String
Description: The ARN of the policy used to set the permissions boundary for the role.
Default: ""

Conditions:
CreateRole:
!Equals [ !Ref AutoscalingLambdaExecutionRole, '' ]
UseKmsKeyForParameterStore:
!Not [ !Equals [ !Ref BuildkiteAgentTokenParameterStoreKMSKey, "" ] ]
SetRolePermissionsBoundaryARN:
!Not [ !Equals [ !Ref RolePermissionsBoundaryARN, "" ] ]

Mappings:
LambdaBucket:
Expand Down Expand Up @@ -95,6 +102,7 @@ Resources:
Condition: CreateRole
Properties:
Path: "/"
PermissionsBoundary: !If [ SetRolePermissionsBoundaryARN, !Ref RolePermissionsBoundaryARN, !Ref "AWS::NoValue" ]
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down Expand Up @@ -148,6 +156,7 @@ Resources:
Properties:
CodeUri: handler.zip
Role: !If [ CreateRole, !GetAtt ExecutionRole.Arn, !Ref AutoscalingLambdaExecutionRole ]
PermissionsBoundary: !If [ SetRolePermissionsBoundaryARN, !Ref RolePermissionsBoundaryARN, !Ref "AWS::NoValue" ]
Timeout: 120
Handler: handler
Runtime: go1.x
Expand Down