Skip to content

Commit 0d0bfd9

Browse files
authored
fix: acl issue apprunner and ecs (#99)
* fix: acl issue apprunner and ecs * fix: typo * ci: skip rule w3002 * ci: skip rule w3002 in actions * docs: skip rule * force ci * fix: config bucket acl * style: sort comment lines * style: makefile * style: makefile
1 parent 3baa64f commit 0d0bfd9

8 files changed

+21
-10
lines changed

.github/workflows/ci-pull-request-apprunner.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
- name: Print the Cloud Formation Linter Version & run Linter
2323
run: |
2424
cfn-lint --version
25-
cfn-lint -t templates_apprunner/**/*.yaml
25+
cfn-lint -t templates_apprunner/**/*.yaml -i W3002
26+
# -i 3002 will not apply rule 3002 https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md
27+
# which is failing in ci/cd
2628

2729
build:
2830
name: Build and Upload AppRunner templates

.github/workflows/ci-pull-request-ecs.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
- name: Print the Cloud Formation Linter Version & run Linter
2323
run: |
2424
cfn-lint --version
25-
cfn-lint -t templates_ecs/**/*.yaml
25+
cfn-lint -t templates_ecs/**/*.yaml -i W3002
26+
# -i 3002 will not apply rule 3002 https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md
27+
# which is failing in ci/cd
2628

2729
build:
2830
name: Build and Upload ECS templates

templates_apprunner/CloudTrail.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Resources:
2626
CloudTrailLoggingBucket:
2727
Type: AWS::S3::Bucket
2828
Properties:
29-
AccessControl: LogDeliveryWrite
29+
OwnershipControls:
30+
Rules:
31+
- ObjectOwnership: BucketOwnerEnforced
3032
PublicAccessBlockConfiguration:
3133
BlockPublicAcls: true
3234
BlockPublicPolicy: true

templates_apprunner/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ validate:
1414
aws cloudformation validate-template --template-body file://./SecureForCloudAppRunner.yaml
1515

1616
lint:
17-
cfn-lint *.yaml
18-
17+
cfn-lint *.yaml -i W3002
1918

2019
packaged-template.yaml:
2120
aws s3 rm s3://$(S3_BUCKET)/apprunner/$(S3_PREFIX) --recursive

templates_apprunner/SecureForCloudAppRunner.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ Resources:
103103
SysdigConfigLoggingBucket:
104104
Type: AWS::S3::Bucket
105105
Properties:
106-
AccessControl: LogDeliveryWrite
106+
OwnershipControls:
107+
Rules:
108+
- ObjectOwnership: BucketOwnerEnforced
107109
PublicAccessBlockConfiguration:
108110
BlockPublicAcls: true
109111
BlockPublicPolicy: true

templates_ecs/CloudTrail.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Resources:
2626
CloudTrailLoggingBucket:
2727
Type: AWS::S3::Bucket
2828
Properties:
29-
AccessControl: LogDeliveryWrite
29+
OwnershipControls:
30+
Rules:
31+
- ObjectOwnership: BucketOwnerEnforced
3032
PublicAccessBlockConfiguration:
3133
BlockPublicAcls: true
3234
BlockPublicPolicy: true

templates_ecs/CloudVision.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ Resources:
151151
SysdigConfigLoggingBucket:
152152
Type: AWS::S3::Bucket
153153
Properties:
154-
AccessControl: LogDeliveryWrite
154+
OwnershipControls:
155+
Rules:
156+
- ObjectOwnership: BucketOwnerEnforced
155157
PublicAccessBlockConfiguration:
156158
BlockPublicAcls: true
157159
BlockPublicPolicy: true

templates_ecs/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ STACK_NAME = "SecureForCloudECSTest"
1010
.PHONY: packaged-template.yaml
1111

1212
validate:
13-
aws cloudformation validate-template --template-body file://./CloudVision.yaml
13+
aws cloudformation validate-template --template-body file://./CloudVision.yaml
1414

1515
lint:
16-
cfn-lint *.yaml
16+
cfn-lint *.yaml -i W3002
1717

1818
packaged-template.yaml:
1919
aws s3 rm s3://$(S3_BUCKET)/ecs/$(S3_PREFIX) --recursive

0 commit comments

Comments
 (0)