|
| 1 | +AWSTemplateFormatVersion: "2010-09-09" |
| 2 | +Description: IAM Roles for CSPM and Cloudlogs used by Sysdig Secure |
| 3 | + |
| 4 | +Metadata: |
| 5 | + AWS::CloudFormation::Interface: |
| 6 | + ParameterGroups: |
| 7 | + - Label: |
| 8 | + default: "Sysdig Settings (Do not change)" |
| 9 | + Parameters: |
| 10 | + - CSPMRoleName |
| 11 | + - CloudLogsRoleName |
| 12 | + - ExternalId |
| 13 | + - TrustedIdentity |
| 14 | + - BucketARN |
| 15 | + |
| 16 | + ParameterLabels: |
| 17 | + CSPMRoleName: |
| 18 | + default: "CSPM Role Name (Sysdig use only)" |
| 19 | + CloudLogsRoleName: |
| 20 | + default: "CloudLogs Role Name (Sysdig use only)" |
| 21 | + ExternalId: |
| 22 | + default: "External ID (Sysdig use only)" |
| 23 | + TrustedIdentity: |
| 24 | + default: "Trusted Identity (Sysdig use only)" |
| 25 | + BucketARN: |
| 26 | + default: "Bucket ARN" |
| 27 | + |
| 28 | +Parameters: |
| 29 | + CSPMRoleName: |
| 30 | + Type: String |
| 31 | + Description: The read-only IAM Role that Sysdig will create |
| 32 | + CloudLogsRoleName: |
| 33 | + Type: String |
| 34 | + Description: The name of the IAM Role that will enable access to the Cloudtrail logs. |
| 35 | + ExternalId: |
| 36 | + Type: String |
| 37 | + Description: Sysdig ExternalID required for the policy creation |
| 38 | + TrustedIdentity: |
| 39 | + Type: String |
| 40 | + Description: The name of Sysdig trusted identity. |
| 41 | + BucketARN: |
| 42 | + Type: String |
| 43 | + Description: The ARN of your s3 bucket associated with your Cloudtrail trail. |
| 44 | + |
| 45 | +Resources: |
| 46 | + CloudAgentlessRole: |
| 47 | + Type: "AWS::IAM::Role" |
| 48 | + Properties: |
| 49 | + RoleName: !Ref CSPMRoleName |
| 50 | + AssumeRolePolicyDocument: |
| 51 | + Version: "2012-10-17" |
| 52 | + Statement: |
| 53 | + - |
| 54 | + Effect: "Allow" |
| 55 | + Principal: |
| 56 | + AWS: !Ref TrustedIdentity |
| 57 | + Action: "sts:AssumeRole" |
| 58 | + Condition: |
| 59 | + StringEquals: |
| 60 | + sts:ExternalId: !Ref ExternalId |
| 61 | + ManagedPolicyArns: |
| 62 | + - arn:aws:iam::aws:policy/SecurityAudit |
| 63 | + CloudLogsRole: |
| 64 | + Type: "AWS::IAM::Role" |
| 65 | + Properties: |
| 66 | + RoleName: !Ref CloudLogsRoleName |
| 67 | + AssumeRolePolicyDocument: |
| 68 | + Version: "2012-10-17" |
| 69 | + Statement: |
| 70 | + - Effect: "Allow" |
| 71 | + Principal: |
| 72 | + AWS: !Ref TrustedIdentity |
| 73 | + Action: |
| 74 | + - "sts:AssumeRole" |
| 75 | + Condition: |
| 76 | + StringEquals: |
| 77 | + "sts:ExternalId": !Ref ExternalId |
| 78 | + CloudLogsRolePolicies: |
| 79 | + Type: "AWS::IAM::Policy" |
| 80 | + Properties: |
| 81 | + PolicyName: "CloudlogsS3Access" |
| 82 | + PolicyDocument: |
| 83 | + Version: "2012-10-17" |
| 84 | + Statement: |
| 85 | + - Sid: "CloudlogsS3Access" |
| 86 | + Effect: "Allow" |
| 87 | + Action: |
| 88 | + - "s3:Get*" |
| 89 | + - "s3:List*" |
| 90 | + Resource: |
| 91 | + - !Sub '${BucketARN}' |
| 92 | + - !Sub '${BucketARN}/*' |
| 93 | + Roles: |
| 94 | + - Ref: "CloudLogsRole" |
0 commit comments