-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrole.yaml
67 lines (67 loc) · 1.73 KB
/
role.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
RoleName:
Type: String
Description: IAM Role Name
RoleDescription:
Type: String
Description: IAM Role Description
Default: ""
RoleSessionDuration:
Type: Number
Description: IAM Role Max Session Duration
Default: 14400
PolicyName:
Type: String
Description: IAM Managed read and write policy name
PolicyDescription:
Type: String
Description: IAM Managed Policy Description
Default: ""
IAMPath:
Type: String
Description: IAM Role and Policy Path
Default: "/"
TrustedAccount:
Type: String
Description: AWS trusted account ID
TrustedRole:
Type: String
Description: Allowed IAM Role ARN
Resources:
Role:
Type: 'AWS::IAM::Role'
Properties:
RoleName: !Ref RoleName
Description: !Ref RoleDescription
MaxSessionDuration: !Ref RoleSessionDuration
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
AWS:
!Ref TrustedAccount
Action:
- 'sts:AssumeRole'
Condition:
ArnLike:
'aws:PrincipalArn': !Ref TrustedRole
Path: !Ref IAMPath
ManagedPolicyArns:
- !Ref RolePolicy
- arn:aws:iam::aws:policy/SecurityAudit
RolePolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
ManagedPolicyName: !Ref PolicyName
Description: !Ref PolicyDescription
Path: !Ref IAMPath
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: SecurityHubImport
Effect: Allow
Action:
- securityhub:BatchImportFindings
Resource: '*'