Skip to content

Commit

Permalink
Update to version v1.0.2
Browse files Browse the repository at this point in the history
- Enabled Amazon S3 server access logging on logging bucket(s) using bucket policy
  • Loading branch information
tabdunabi authored May 4, 2023
2 parents 9139b29 + d7b830c commit 8be832c
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
**/.DS_Store
**/.vscode
source/test
.idea
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.2] - 2023-05-03
### Changed
- Enabled Amazon S3 server access logging on logging bucket(s) using bucket policy

## [1.0.1] - 2021-05-21
### Added
- Updated SNS Topic Display Name ([#7](https://github.com/awslabs/cognito-user-profiles-export-reference-architecture/issues/7))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ Resources:
Action:
- states:CreateStateMachine
- states:DeleteStateMachine
- states:DescribeStateMachine
- states:UpdateStateMachine
- states:TagResource
- states:ListTagsForResource
Expand Down Expand Up @@ -792,6 +793,9 @@ Resources:
- s3:PutBucketAcl
- s3:PutBucketLogging
- s3:PutBucketTagging
- s3:GetBucketPolicy
- s3:PutBucketPolicy
- s3:DeleteBucketPolicy
Resource:
- !Sub arn:${AWS::Partition}:s3:::${SolutionConstantsCustomResource.UserImportJobMappingFileBucketPrefix}-${AWS::Region}
- !Sub arn:${AWS::Partition}:s3:::${SolutionConstantsCustomResource.UserImportJobMappingFileBucketPrefix}-${AWS::Region}-logs
Expand Down
38 changes: 37 additions & 1 deletion deployment/stack-set-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,6 @@ Resources:
- Key: solution-id-SO0126
Value: !Sub ${StackSetConstantsCustomResource.ParentStackName}-${PrimaryRegion}
BucketName: !Sub ${StackSetConstantsCustomResource.UserImportJobMappingFileBucketPrefix}-${AWS::Region}-logs
AccessControl: LogDeliveryWrite
PublicAccessBlockConfiguration:
BlockPublicAcls: True
BlockPublicPolicy: True
Expand All @@ -1399,6 +1398,43 @@ Resources:
- ServerSideEncryptionByDefault:
SSEAlgorithm: aws:kms

S3ServerAccessLogsPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref UserImportJobMappingFilesLogsBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: S3ServerAccessLogsPolicy
Effect: Allow
Principal:
Service: logging.s3.amazonaws.com
Action:
- s3:PutObject
Resource:
Fn::Join: [
'', [
'arn:',
!Ref AWS::Partition,
':s3:::',
!Ref UserImportJobMappingFilesLogsBucket,
'/cupera-userimportjob*',
]
]
Condition:
ArnLike:
aws:SourceArn:
- Fn::Join: [
'', [
'arn:',
!Ref AWS::Partition,
':s3:::',
!Ref UserImportJobMappingFiles
]
]
StringEquals:
aws:SourceAccount: !Ref AWS::AccountId

CheckExecutionsLambda:
Type: AWS::Lambda::Function
Metadata:
Expand Down
2 changes: 1 addition & 1 deletion source/custom-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "aws-solutions-builder"
},
"license": "Apache-2.0",
"version": "1.0.1",
"version": "1.0.2",
"private": true,
"dependencies": {
"axios": "^0.21.1",
Expand Down
2 changes: 1 addition & 1 deletion source/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "utils",
"version": "1.0.1",
"version": "1.0.2",
"description": "Custom Resource Helper functions",
"scripts": {
"clean": "rm -rf dist/ node_modules/ coverage/ package-lock.json",
Expand Down
2 changes: 1 addition & 1 deletion source/workflow-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "workflow-common",
"version": "1.0.1",
"version": "1.0.2",
"description": "Common functionality for all Step Functions Workflows",
"author": {
"name": "aws-solutions-builder"
Expand Down
2 changes: 1 addition & 1 deletion source/workflow-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "aws-solutions-builder"
},
"license": "Apache-2.0",
"version": "1.0.1",
"version": "1.0.2",
"private": true,
"dependencies": {
"uuid": "^8.3.0"
Expand Down
2 changes: 1 addition & 1 deletion source/workflow-import/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "workflow-import",
"version": "1.0.1",
"version": "1.0.2",
"description": "Populates a new user pool with user profiles, groups and group memberships from the backup table",
"scripts": {
"clean": "rm -rf dist/ node_modules/ coverage/ package-lock.json",
Expand Down

0 comments on commit 8be832c

Please sign in to comment.