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

Update S3 access policy in cloudlogs-related templates #108

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
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
16 changes: 14 additions & 2 deletions templates_cloudlogs/CloudLogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Metadata:
- ExternalID
- TrustedIdentity
- BucketARN
- AccountID

ParameterLabels:
CloudLogsRoleName:
Expand All @@ -24,6 +25,8 @@ Metadata:
default: "Trusted Identity (Sysdig use only)"
BucketARN:
default: "Bucket ARN"
AccountID:
default: "Account ID"

Parameters:
CloudLogsRoleName:
Expand All @@ -38,6 +41,9 @@ Parameters:
BucketARN:
Type: String
Description: The ARN of your s3 bucket associated with your Cloudtrail trail.
AccountID:
Type: String
Description: The Identifier of your AWS account.

Resources:
CloudLogsRole:
Expand All @@ -62,13 +68,19 @@ Resources:
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: "CloudlogsS3Access"
- Sid: "CloudlogsS3AccessGet"
Effect: "Allow"
Action:
- "s3:Get*"
- "s3:List*"
Resource:
- !Sub '${BucketARN}'
- !Sub '${BucketARN}/*'
- Sid: "CloudlogsS3AccessList"
Effect: "Allow"
Action:
- "s3:List*"
Resource:
- !Sub '${BucketARN}/AWSLogs/${AccountID}'
- !Sub '${BucketARN}/AWSLogs/${AccountID}/*'
Roles:
- Ref: "CloudLogsRole"
2 changes: 1 addition & 1 deletion templates_cloudlogs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ packaged-template-org.yaml:
aws s3 rm s3://$(S3_BUCKET)/cloudlogs/org/$(S3_PREFIX) --recursive
aws cloudformation package \
--region $(S3_REGION) \
--template-file OrgCloudlogs.yaml \
--template-file OrgCloudLogs.yaml \
--s3-bucket $(S3_BUCKET) \
--s3-prefix cspm/$(S3_PREFIX) \
--force-upload \
Expand Down
16 changes: 14 additions & 2 deletions templates_cloudlogs/OrgCloudLogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Metadata:
- ExternalID
- TrustedIdentity
- BucketARN
- AccountID

ParameterLabels:
CSPMRoleName:
Expand All @@ -28,6 +29,8 @@ Metadata:
default: "Trusted Identity (Sysdig use only)"
BucketARN:
default: "Bucket ARN"
AccountID:
default: "Account ID"

Parameters:
CSPMRoleName:
Expand All @@ -45,6 +48,9 @@ Parameters:
BucketARN:
Type: String
Description: The ARN of your s3 bucket associated with your Cloudtrail trail.
AccountID:
Type: String
Description: The Identifier of your AWS account.

Resources:
CloudLogsRole:
Expand All @@ -69,14 +75,20 @@ Resources:
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: "CloudlogsS3Access"
- Sid: "CloudlogsS3AccessGet"
Effect: "Allow"
Action:
- "s3:Get*"
- "s3:List*"
Resource:
- !Sub '${BucketARN}'
- !Sub '${BucketARN}/*'
- Sid: "CloudlogsS3AccessList"
Effect: "Allow"
Action:
- "s3:List*"
Resource:
- !Sub '${BucketARN}/AWSLogs/${AccountID}'
- !Sub '${BucketARN}/AWSLogs/${AccountID}/*'
Roles:
- Ref: "CloudLogsRole"
CloudAgentlessRole:
Expand Down
16 changes: 14 additions & 2 deletions templates_cspm_cloudlogs/FullInstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Metadata:
- ExternalID
- TrustedIdentity
- BucketARN
- AccountID

ParameterLabels:
CSPMRoleName:
Expand All @@ -24,6 +25,8 @@ Metadata:
default: "Trusted Identity (Sysdig use only)"
BucketARN:
default: "Bucket ARN"
AccountID:
default: "Account ID"

Parameters:
CSPMRoleName:
Expand All @@ -41,6 +44,9 @@ Parameters:
BucketARN:
Type: String
Description: The ARN of your s3 bucket associated with your Cloudtrail trail.
AccountID:
Type: String
Description: The Identifier of your AWS account.

Resources:
CloudAgentlessRole:
Expand Down Expand Up @@ -82,13 +88,19 @@ Resources:
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: "CloudlogsS3Access"
- Sid: "CloudlogsS3AccessGet"
Effect: "Allow"
Action:
- "s3:Get*"
- "s3:List*"
Resource:
- !Sub '${BucketARN}'
- !Sub '${BucketARN}/*'
- Sid: "CloudlogsS3AccessList"
Effect: "Allow"
Action:
- "s3:List*"
Resource:
- !Sub '${BucketARN}/AWSLogs/${AccountID}'
- !Sub '${BucketARN}/AWSLogs/${AccountID}/*'
Roles:
- Ref: "CloudLogsRole"
16 changes: 14 additions & 2 deletions templates_cspm_cloudlogs/OrgFullInstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Metadata:
- TrustedIdentity
- BucketARN
- OrganizationUnitIDs
- AccountID

ParameterLabels:
CSPMRoleName:
Expand All @@ -27,6 +28,8 @@ Metadata:
default: "Trusted Identity (Sysdig use only)"
OrganizationUnitIDs:
default: "Organization Unit IDs (Sysdig use only)"
AccountID:
default: "Account ID"

Parameters:
CSPMRoleName:
Expand All @@ -47,6 +50,9 @@ Parameters:
OrganizationUnitIDs:
Type: String
Description: Organization Unit IDs to deploy
AccountID:
Type: String
Description: The Identifier of your AWS account.

Resources:
CloudAgentlessRole:
Expand Down Expand Up @@ -87,14 +93,20 @@ Resources:
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: "CloudlogsS3Access"
- Sid: "CloudlogsS3AccessGet"
Effect: "Allow"
Action:
- "s3:Get*"
- "s3:List*"
Resource:
- !Sub '${BucketARN}'
- !Sub '${BucketARN}/*'
- Sid: "CloudlogsS3AccessList"
Effect: "Allow"
Action:
- "s3:List*"
Resource:
- !Sub '${BucketARN}/AWSLogs/${AccountID}'
- !Sub '${BucketARN}/AWSLogs/${AccountID}/*'
Roles:
- Ref: "CloudLogsRole"
RolesStackSet:
Expand Down
Loading