Skip to content

Commit

Permalink
tests for partial block access configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
clueleaf committed May 8, 2023
1 parent 55a38c8 commit 3f9bfca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/rules/S3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
StarPrincipal,
} from 'aws-cdk-lib/aws-iam';
import {
BlockPublicAccess,
Bucket,
BucketAccessControl,
BucketEncryption,
Expand Down Expand Up @@ -96,6 +97,18 @@ describe('Amazon Simple Storage Service (S3)', () => {
});
validateStack(stack, ruleId, TestType.NON_COMPLIANCE);
});
test('Noncompliance 2', () => {
new Bucket(stack, 'rBucket', {
blockPublicAccess: new BlockPublicAccess({ blockPublicAcls: true }),
});
validateStack(stack, ruleId, TestType.NON_COMPLIANCE);
});
test('Noncompliance 3', () => {
new CfnBucket(stack, 'Bucket', {
publicAccessBlockConfiguration: { blockPublicAcls: true },
});
validateStack(stack, ruleId, TestType.NON_COMPLIANCE);
});
test('Compliance', () => {
new Bucket(stack, 'rBucket');
new Bucket(stack, 'rBucket2', {
Expand Down

0 comments on commit 3f9bfca

Please sign in to comment.