Skip to content

Commit

Permalink
fix for CKV_AWS_111
Browse files Browse the repository at this point in the history
  • Loading branch information
shivani-sumo committed Apr 2, 2024
1 parent 00ad960 commit 0e26729
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion aws-observability/apps/alb/alb_app.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ Resources:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
- Effect: "Allow"
Action:
- "s3:*"
Resource: 'LambdaHelper'

LambdaHelper:
Type: 'AWS::Serverless::Function'
Expand Down
9 changes: 8 additions & 1 deletion aws-observability/apps/common/resources.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,11 @@ Resources:
Action:
- s3:GetBucketPolicy
- s3:PutBucketPolicy
- Effect: "Allow"
Action:
- "s3:*"
Resource:
- LambdaHelper
- !Sub
- "arn:aws:s3:::${S3Bucket}"
- S3Bucket: !If [install_alb_logs_source, !If [ create_alb_bucket, !Ref CommonS3Bucket, !Ref ALBS3LogsBucketName ], ""]
Expand Down Expand Up @@ -511,7 +515,10 @@ Resources:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
- Effect: "Allow"
Action:
- "s3:*"
Resource: 'LambdaHelperAlias'

LambdaHelperAlias:
Type: 'AWS::Serverless::Function'
Expand Down
5 changes: 4 additions & 1 deletion aws-observability/apps/elb/elb_app.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ Resources:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
- Effect: "Allow"
Action:
- "s3:*"
Resource: 'LambdaHelper'

LambdaHelper:
Type: 'AWS::Serverless::Function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ Resources:
- logs:CreateLogStream
- logs:PutLogEvents
- ec2:DescribeInstances
Resource: '*'
- Effect: "Allow"
Action:
- "s3:*"
Resource: 'LambdaHelper'

LambdaHelper:
Type: AWS::Lambda::Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ Resources:
- Effect: "Allow"
Action:
- "s3:*"
Resource: "*"
Resource: "SecretsRetrievalFunction"
ManagedPolicyArns:
- !Sub "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
# Retrieving secrets passed in via SecretsManager Arn
Expand Down

0 comments on commit 0e26729

Please sign in to comment.