-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cloudformation): update json template to include new permission…
…s [ENG-59310] (#5) * chore(cloudformation): update json template to include new permissions * fix role name and hard coded path to module
- Loading branch information
Showing
2 changed files
with
63 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,70 @@ | ||
{ | ||
"Description": "Drata IAM Role to set read permissions in Org Member Accounts", | ||
"Parameters": { | ||
"DrataAWSAccountID": { | ||
"Type": "String", | ||
"Description": "Drata's AWS account ID.", | ||
"Default": "269135526815", | ||
"AllowedPattern": "\\d{12}$", | ||
"MinLength": 1, | ||
"ConstraintDescription": "DrataAWSAccountID should be exactly 12 digits (numeric characters). It's required." | ||
}, | ||
"RoleSTSExternalID": { | ||
"Type": "String", | ||
"Description": "STS ExternalId condition value to use with the role.", | ||
"AllowedPattern": "[a-zA-Z0-9\\=\\,\\.\\@\\:\\/\\-_]*", | ||
"MinLength": 1, | ||
"ConstraintDescription": "RoleSTSExternalID must be an UUID formatted string and is required." | ||
} | ||
"DrataAWSAccountID": { | ||
"Type": "String", | ||
"Description": "Drata's AWS account ID.", | ||
"Default": "269135526815", | ||
"AllowedPattern": "\\d{12}$", | ||
"MinLength": 1, | ||
"ConstraintDescription": "DrataAWSAccountID should be exactly 12 digits (numeric characters). It's required." | ||
}, | ||
"RoleSTSExternalID": { | ||
"Type": "String", | ||
"Description": "STS ExternalId condition value to use with the role.", | ||
"AllowedPattern": "[a-zA-Z0-9\\=\\,\\.\\@\\:\\/\\-_]*", | ||
"MinLength": 1, | ||
"ConstraintDescription": "RoleSTSExternalID must be an UUID formatted string and is required." | ||
} | ||
}, | ||
"Resources": { | ||
"DrataRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": ["arn:aws:iam::aws:policy/SecurityAudit"], | ||
"MaxSessionDuration": 43200, | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": [ { "Fn::Sub": "arn:aws:iam::${DrataAWSAccountID}:root" } ] | ||
}, | ||
"Action": "sts:AssumeRole", | ||
"Condition": { | ||
"StringEquals": { | ||
"sts:ExternalId": { | ||
"Ref": "RoleSTSExternalID" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
"DrataRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": ["arn:aws:iam::aws:policy/SecurityAudit"], | ||
"MaxSessionDuration": 43200, | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": [{ "Fn::Sub": "arn:aws:iam::${DrataAWSAccountID}:root" }] | ||
}, | ||
"RoleName": "DrataAutopilotRole", | ||
"Description": "Cross-account read-only access for Drata Autopilot" | ||
} | ||
"Action": "sts:AssumeRole", | ||
"Condition": { | ||
"StringEquals": { | ||
"sts:ExternalId": { | ||
"Ref": "RoleSTSExternalID" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"RoleName": "DrataAutopilotRole", | ||
"Description": "Cross-account read-only access for Drata Autopilot" | ||
} | ||
}, | ||
"DrataAdditionalPermissionsPolicy": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyName": "DrataAdditionalPermissions", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"backup:ListBackupJobs", | ||
"backup:ListRecoveryPointsByResource" | ||
], | ||
"Resource": "*" | ||
} | ||
] | ||
}, | ||
"Roles": [{ "Ref": "DrataRole" }] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters