Skip to content

Commit

Permalink
🐛 set policy to plugin.StateIsNull when not found
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
  • Loading branch information
afiune committed Feb 20, 2025
1 parent 01b8dd5 commit 99d3c83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion providers/aws/resources/aws_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ func (a *mqlAwsS3Bucket) policy() (*mqlAwsS3BucketPolicy, error) {
policy, err := svc.GetBucketPolicy(ctx, &s3.GetBucketPolicyInput{
Bucket: &bucketname,
})
if err != nil && !isNotFoundForS3(err) {
if err != nil {
if isNotFoundForS3(err) {
a.Policy.State = plugin.StateIsNull | plugin.StateIsSet
return nil, nil
}
return nil, err
}

Expand Down

0 comments on commit 99d3c83

Please sign in to comment.