Skip to content

Commit

Permalink
Merge pull request #119 from ASFHyP3/cfn-lint
Browse files Browse the repository at this point in the history
Fix cfn-lint workflow
  • Loading branch information
jtherrmann authored Jul 2, 2024
2 parents e7a4bfe + 6b09c32 commit 1b2ffb6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
14 changes: 11 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: pip
directory: /
schedule:
interval: "daily"
interval: weekly
labels:
- bumpless
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- bumpless
12 changes: 7 additions & 5 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: Static code analysis
on: push

jobs:

cfn-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: scottbrenner/[email protected]
- uses: actions/setup-python@v5
with:
args: "--template cloudformation.yml"
python-version: 3.9
- run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- run: |
cfn-lint --info --template cloudformation.yml
30 changes: 29 additions & 1 deletion cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,37 @@ Resources:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${AWS::StackName}-logs"
AccessControl: LogDeliveryWrite
PublicAccessBlockConfiguration:
BlockPublicAcls: True
IgnorePublicAcls: True
BlockPublicPolicy: True
RestrictPublicBuckets: True
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
BucketKeyEnabled: true
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced

LogBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref LogBucket
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: logging.s3.amazonaws.com
Action: s3:PutObject
Resource: !Sub "${LogBucket.Arn}/*"
Condition:
ArnLike:
"aws:SourceArn": !GetAtt ContentBucket.Arn
StringEquals:
"aws:SourceAccount": !Ref AWS::AccountId

ContentBucket:
Type: AWS::S3::Bucket
Expand All @@ -32,6 +57,9 @@ Resources:
IgnorePublicAcls: True
BlockPublicPolicy: False
RestrictPublicBuckets: False
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced

BucketPolicy:
Type: AWS::S3::BucketPolicy
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cfn-lint==1.4.2

0 comments on commit 1b2ffb6

Please sign in to comment.