diff --git a/pkg/model/iam/iam_builder.go b/pkg/model/iam/iam_builder.go index 5c5c4407e3..707962929e 100644 --- a/pkg/model/iam/iam_builder.go +++ b/pkg/model/iam/iam_builder.go @@ -314,7 +314,7 @@ func (b *PolicyBuilder) AddS3Permissions(p *Policy) (*Policy, error) { p.Statement = append(p.Statement, &Statement{ Effect: StatementEffectAllow, - Action: stringorslice.Of("s3:GetBucketLocation", "s3:ListBucket"), + Action: stringorslice.Of("s3:GetBucketLocation", "s3:GetEncryptionConfiguration", "s3:ListBucket"), Resource: stringorslice.Slice([]string{ strings.Join([]string{b.IAMPrefix(), ":s3:::", s3Path.Bucket()}, ""), }), diff --git a/pkg/model/iam/tests/iam_builder_master_legacy.json b/pkg/model/iam/tests/iam_builder_master_legacy.json index c5d9728b38..640fce7d63 100644 --- a/pkg/model/iam/tests/iam_builder_master_legacy.json +++ b/pkg/model/iam/tests/iam_builder_master_legacy.json @@ -48,6 +48,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ diff --git a/pkg/model/iam/tests/iam_builder_master_strict.json b/pkg/model/iam/tests/iam_builder_master_strict.json index f5f595b4bf..fbd0b74ca1 100644 --- a/pkg/model/iam/tests/iam_builder_master_strict.json +++ b/pkg/model/iam/tests/iam_builder_master_strict.json @@ -138,6 +138,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ diff --git a/pkg/model/iam/tests/iam_builder_master_strict_ecr.json b/pkg/model/iam/tests/iam_builder_master_strict_ecr.json index 0ebd445901..a21d001eb9 100644 --- a/pkg/model/iam/tests/iam_builder_master_strict_ecr.json +++ b/pkg/model/iam/tests/iam_builder_master_strict_ecr.json @@ -138,6 +138,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ diff --git a/pkg/model/iam/tests/iam_builder_node_legacy.json b/pkg/model/iam/tests/iam_builder_node_legacy.json index 1c330cbf37..5926662e64 100644 --- a/pkg/model/iam/tests/iam_builder_node_legacy.json +++ b/pkg/model/iam/tests/iam_builder_node_legacy.json @@ -15,6 +15,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ diff --git a/pkg/model/iam/tests/iam_builder_node_strict.json b/pkg/model/iam/tests/iam_builder_node_strict.json index 1d28f2718a..aa7b32f247 100644 --- a/pkg/model/iam/tests/iam_builder_node_strict.json +++ b/pkg/model/iam/tests/iam_builder_node_strict.json @@ -15,6 +15,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [ diff --git a/pkg/model/iam/tests/iam_builder_node_strict_ecr.json b/pkg/model/iam/tests/iam_builder_node_strict_ecr.json index 10053f1c0d..61df952ce3 100644 --- a/pkg/model/iam/tests/iam_builder_node_strict_ecr.json +++ b/pkg/model/iam/tests/iam_builder_node_strict_ecr.json @@ -15,6 +15,7 @@ "Effect": "Allow", "Action": [ "s3:GetBucketLocation", + "s3:GetEncryptionConfiguration", "s3:ListBucket" ], "Resource": [