From 38eb310e59048ff73293835fe735db7b1c3932f7 Mon Sep 17 00:00:00 2001 From: zechariah kasina Date: Fri, 2 May 2025 11:33:02 -0700 Subject: [PATCH] Updated s3_bucket public access control guard files to ignore case for values --- .../s3_bucket_level_public_access_prohibited.guard | 8 ++++---- .../aws/amazon_s3/s3_bucket_public_read_prohibited.guard | 8 ++++---- .../aws/amazon_s3/s3_bucket_public_write_prohibited.guard | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rules/aws/amazon_s3/s3_bucket_level_public_access_prohibited.guard b/rules/aws/amazon_s3/s3_bucket_level_public_access_prohibited.guard index c525418..01a7571 100644 --- a/rules/aws/amazon_s3/s3_bucket_level_public_access_prohibited.guard +++ b/rules/aws/amazon_s3/s3_bucket_level_public_access_prohibited.guard @@ -33,10 +33,10 @@ let s3_buckets_level_public_access_prohibited = Resources.*[ Type == 'AWS::S3::B rule S3_BUCKET_LEVEL_PUBLIC_ACCESS_PROHIBITED when %s3_buckets_level_public_access_prohibited !empty { %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration exists - %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == true - %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == true - %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == true - %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == true + %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == /(?i)true/ + %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == /(?i)true/ + %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == /(?i)true/ + %s3_buckets_level_public_access_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == /(?i)true/ << Violation: S3 Bucket Public Access controls need to be restricted. Fix: Set S3 Bucket PublicAccessBlockConfiguration properties for BlockPublicAcls, BlockPublicPolicy, IgnorePublicAcls, RestrictPublicBuckets parameters to true. diff --git a/rules/aws/amazon_s3/s3_bucket_public_read_prohibited.guard b/rules/aws/amazon_s3/s3_bucket_public_read_prohibited.guard index 4c7939d..f380fb0 100644 --- a/rules/aws/amazon_s3/s3_bucket_public_read_prohibited.guard +++ b/rules/aws/amazon_s3/s3_bucket_public_read_prohibited.guard @@ -34,10 +34,10 @@ let s3_bucket_public_read_prohibited = Resources.*[ Type == 'AWS::S3::Bucket' rule S3_BUCKET_PUBLIC_READ_PROHIBITED when %s3_bucket_public_read_prohibited !empty { %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration exists - %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == true - %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == true - %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == true - %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == true + %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == /(?i)true/ + %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == /(?i)true/ + %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == /(?i)true/ + %s3_bucket_public_read_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == /(?i)true/ << Violation: S3 Bucket Public Write Access controls need to be restricted. Fix: Set S3 Bucket PublicAccessBlockConfiguration properties for BlockPublicAcls, BlockPublicPolicy, IgnorePublicAcls, RestrictPublicBuckets parameters to true. diff --git a/rules/aws/amazon_s3/s3_bucket_public_write_prohibited.guard b/rules/aws/amazon_s3/s3_bucket_public_write_prohibited.guard index db7f097..d7a211b 100644 --- a/rules/aws/amazon_s3/s3_bucket_public_write_prohibited.guard +++ b/rules/aws/amazon_s3/s3_bucket_public_write_prohibited.guard @@ -34,10 +34,10 @@ let s3_buckets_public_write_prohibited = Resources.*[ Type == 'AWS::S3::Bucket' rule S3_BUCKET_PUBLIC_WRITE_PROHIBITED when %s3_buckets_public_write_prohibited !empty { %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration exists - %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == true - %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == true - %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == true - %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == true + %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicAcls == /(?i)true/ + %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.BlockPublicPolicy == /(?i)true/ + %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.IgnorePublicAcls == /(?i)true/ + %s3_buckets_public_write_prohibited.Properties.PublicAccessBlockConfiguration.RestrictPublicBuckets == /(?i)true/ << Violation: S3 Bucket Public Write Access controls need to be restricted. Fix: Set S3 Bucket PublicAccessBlockConfiguration properties for BlockPublicAcls, BlockPublicPolicy, IgnorePublicAcls, RestrictPublicBuckets parameters to true.