-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp cloudformation templates for Cloudlogs module (#106)
- Loading branch information
Showing
4 changed files
with
128 additions
and
46 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
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
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
Description: > | ||
CloudFormation organizational template for provisioning | ||
the necessary resources for the `cloud-logs` | ||
component and the read-only role required to itneract with | ||
the target organizational environment. | ||
Metadata: | ||
AWS::CloudFormation::Interface: | ||
ParameterGroups: | ||
- Label: | ||
default: "Sysdig Settings (Do not change)" | ||
Parameters: | ||
- CSPMRoleName | ||
- CloudLogsRoleName | ||
- ExternalID | ||
- TrustedIdentity | ||
- BucketARN | ||
|
||
ParameterLabels: | ||
CSPMRoleName: | ||
default: "CSPM Role Name (Sysdig use only)" | ||
CloudLogsRoleName: | ||
default: "CloudLogs Role Name (Sysdig use only)" | ||
ExternalID: | ||
default: "External ID (Sysdig use only)" | ||
TrustedIdentity: | ||
default: "Trusted Identity (Sysdig use only)" | ||
BucketARN: | ||
default: "Bucket ARN" | ||
|
||
Parameters: | ||
CSPMRoleName: | ||
Type: String | ||
Description: The name of the read-only IAM Role that Sysdig will use to interact with the target environment | ||
CloudLogsRoleName: | ||
Type: String | ||
Description: The name of the IAM Role that will enable access to the Cloudtrail logs. | ||
ExternalID: | ||
Type: String | ||
Description: Random string generated unique to a customer. | ||
TrustedIdentity: | ||
Type: String | ||
Description: The name of Sysdig trusted identity. | ||
BucketARN: | ||
Type: String | ||
Description: The ARN of your s3 bucket associated with your Cloudtrail trail. | ||
|
||
Resources: | ||
CloudLogsRole: | ||
Type: "AWS::IAM::Role" | ||
Properties: | ||
RoleName: !Ref CloudLogsRoleName | ||
AssumeRolePolicyDocument: | ||
Version: "2012-10-17" | ||
Statement: | ||
- Effect: "Allow" | ||
Principal: | ||
AWS: !Ref TrustedIdentity | ||
Action: | ||
- "sts:AssumeRole" | ||
Condition: | ||
StringEquals: | ||
"sts:ExternalId": !Ref ExternalID | ||
CloudLogsRolePolicies: | ||
Type: "AWS::IAM::Policy" | ||
Properties: | ||
PolicyName: "CloudlogsS3Access" | ||
PolicyDocument: | ||
Version: "2012-10-17" | ||
Statement: | ||
- Sid: "CloudlogsS3Access" | ||
Effect: "Allow" | ||
Action: | ||
- "s3:Get*" | ||
- "s3:List*" | ||
Resource: | ||
- !Sub '${BucketARN}' | ||
- !Sub '${BucketARN}/*' | ||
Roles: | ||
- Ref: "CloudLogsRole" | ||
CloudAgentlessRole: | ||
Type: "AWS::IAM::Role" | ||
Properties: | ||
RoleName: !Ref CSPMRoleName | ||
AssumeRolePolicyDocument: | ||
Version: "2012-10-17" | ||
Statement: | ||
- Effect: "Allow" | ||
Principal: | ||
AWS: !Ref TrustedIdentity | ||
Action: "sts:AssumeRole" | ||
Condition: | ||
StringEquals: | ||
sts:ExternalId: !Ref ExternalID | ||
ManagedPolicyArns: | ||
- arn:aws:iam::aws:policy/SecurityAudit |
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