-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix policies * small change
- Loading branch information
Showing
5 changed files
with
50 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
metadata: | ||
version: 0.2 | ||
approach: define failing | ||
id: CKV_AWS_19 | ||
name: Ensure all data stored in the S3 bucket is securely encrypted at rest | ||
category: ENCRYPTION | ||
framework: cdk | ||
scope: | ||
languages: | ||
- javascript | ||
- typescript | ||
definition: | ||
or: | ||
- pattern: new $FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, encryption: $METHOD ,<ANY>)' | ||
conditions: | ||
- metavariable: $METHOD | ||
regex: (?i)(BucketEncryption.KMS_MANAGED|BucketEncryption.S3_MANAGED|BucketEncryption.KMS) | ||
- pattern: new $S3.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, encryption: $METHOD ,<ANY>)' | ||
conditions: | ||
- metavariable: $METHOD | ||
regex: (?i)($S3.BucketEncryption.KMS_MANAGED|$S3.BucketEncryption.S3_MANAGED|$S3.BucketEncryption.KMS) | ||
pattern: new $AWS.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: $AWS.BucketEncryption.KMS_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: $AWS.BucketEncryption.S3_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: $AWS.BucketEncryption.KMS, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: BucketEncryption.KMS_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: BucketEncryption.S3_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: BucketEncryption.KMS, <ANY> } ,<ANY>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
metadata: | ||
version: 0.2 | ||
approach: define failing | ||
id: CKV_AWS_145 | ||
name: Ensure that S3 buckets are encrypted with KMS by default | ||
category: ENCRYPTION | ||
framework: cdk | ||
scope: | ||
languages: | ||
- javascript | ||
- typescript | ||
definition: | ||
or: | ||
- pattern: new $FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, encryption: $METHOD ,<ANY>)' | ||
conditions: | ||
- metavariable: $METHOD | ||
regex: (?i)(aws_cdk.aws_s3.BucketEncryption.KMS_MANAGED|aws_cdk.aws_s3.BucketEncryption.KMS) | ||
- pattern: new $S3.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, encryption: $METHOD ,<ANY>)' | ||
conditions: | ||
- metavariable: $METHOD | ||
regex: (?i)(aws_cdk.aws_s3.BucketEncryption.KMS_MANAGED|aws_cdk.aws_s3.BucketEncryption.KMS) | ||
pattern: new $AWS.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: $AWS.BucketEncryption.KMS_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: $AWS.BucketEncryption.KMS, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: BucketEncryption.KMS_MANAGED, <ANY> } ,<ANY>) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, encryption: BucketEncryption.KMS, <ANY> } ,<ANY>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,17 @@ | ||
metadata: | ||
version: 0.2 | ||
approach: define failing | ||
id: CKV_AWS_18 | ||
name: Ensure the S3 bucket has access logging enabled | ||
category: LOGGING | ||
framework: cdk | ||
scope: | ||
languages: | ||
- javascript | ||
- typescript | ||
definition: | ||
or: | ||
- pattern: new $FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, serverAccessLogsBucket: $BUCKET.$LOGGER(<ANY>) ,<ANY>)' | ||
conditions: | ||
- metavariable: $LOGGER | ||
regex: (?i)(fromBucketArn|fromBucketAttributes|fromBucketName|fromBucketRegionalAttributes|fromBucketUrl) | ||
- pattern: new $S3.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, serverAccessLogsBucket: $S3.$BUCKET.$LOGGER(<ANY>) ,<ANY>)' | ||
conditions: | ||
- metavariable: $LOGGER | ||
regex: (?i)(fromBucketArn|fromBucketAttributes|fromBucketName|fromBucketRegionalAttributes|fromBucketUrl) | ||
pattern: new $AWS.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (Bucket|CfnBucket) | ||
- not_pattern: | | ||
new $AWS.$FUNC(<ANY>, { <ANY>, serverAccessLogsBucket: <ANY> , <ANY> } ,<ANY>) |
27 changes: 7 additions & 20 deletions
27
checkov/cdk/checks/typescript/S3BucketPublicAccessBlock.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,17 @@ | ||
metadata: | ||
version: 0.2 | ||
approach: define failing | ||
id: CKV2_AWS_6 | ||
name: Ensure that S3 bucket has a Public Access block | ||
category: NETWORKING | ||
framework: cdk | ||
scope: | ||
languages: | ||
- javascript | ||
- typescript | ||
definition: | ||
or: | ||
- pattern: new $FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $FUNC(<ANY>, blockPublicAccess: BlockPublicAccess.$ATR ,<ANY>)' | ||
conditions: | ||
- metavariable: $ATR | ||
regex: (?i)(BLOCK_ALL|BLOCK_ACLS|BLOCK_POLICY|RESTRICTED) | ||
- pattern: new $S3.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
'new $S3.$FUNC(<ANY>, blockPublicAccess: $S3.BlockPublicAccess.$ATR ,<ANY>)' | ||
conditions: | ||
- metavariable: $ATR | ||
regex: (?i)(BLOCK_ALL|BLOCK_ACLS|BLOCK_POLICY|RESTRICTED) | ||
pattern: new $S3.$FUNC(<ANY>) | ||
conditions: | ||
- metavariable: $FUNC | ||
regex: (?i)(Bucket|CfnBucket) | ||
- not_pattern: | | ||
new $S3.$FUNC(<ANY>, { <ANY>, blockPublicAccess: <ANY> , <ANY> } ,<ANY>) |