Skip to content

Commit

Permalink
fix(s3): fixed issue with access policy
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Feb 6, 2023
1 parent e6758c9 commit d8075a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aws/s3/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ func GetS3ToPublicBlockAccess(s aws.Config, b []types.Bucket) []S3toPublicBlockA
Bucket: aws.String(*bucket.Name),
}
resp, err := svc.GetPublicAccessBlock(context.TODO(), params)
if err != nil || (resp.PublicAccessBlockConfiguration != nil && resp.PublicAccessBlockConfiguration.BlockPublicAcls) {
s3toPublicBlockAccess = append(s3toPublicBlockAccess, S3toPublicBlockAccess{*bucket.Name, true})
if err != nil {
if resp.PublicAccessBlockConfiguration != nil && resp.PublicAccessBlockConfiguration.BlockPublicAcls {
s3toPublicBlockAccess = append(s3toPublicBlockAccess, S3toPublicBlockAccess{*bucket.Name, true})
} else {
s3toPublicBlockAccess = append(s3toPublicBlockAccess, S3toPublicBlockAccess{*bucket.Name, false})
}
} else {
s3toPublicBlockAccess = append(s3toPublicBlockAccess, S3toPublicBlockAccess{*bucket.Name, false})
}
Expand Down

0 comments on commit d8075a9

Please sign in to comment.