/
awscdk-bucket-encryption.yml
48 lines (48 loc) · 1.58 KB
/
awscdk-bucket-encryption.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
rules:
- id: awscdk-bucket-encryption
message: >-
Add "encryption: $Y.BucketEncryption.KMS_MANAGED" or "encryption: $Y.BucketEncryption.S3_MANAGED"
to the bucket props
for Bucket construct $X
metadata:
cwe:
- 'CWE-311: Missing Encryption of Sensitive Data'
category: security
technology:
- AWS-CDK
references:
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/security-best-practices.html
owasp:
- A03:2017 - Sensitive Data Exposure
- A04:2021 - Insecure Design
subcategory:
- vuln
likelihood: LOW
impact: HIGH
confidence: MEDIUM
languages:
- typescript
severity: ERROR
pattern-either:
- patterns:
- pattern-inside: |
import {Bucket} from '@aws-cdk/aws-s3'
...
- pattern: const $X = new Bucket(...)
- pattern-not: |
const $X = new Bucket(..., {..., encryption: BucketEncryption.KMS_MANAGED, ...})
- pattern-not: |
const $X = new Bucket(..., {..., encryption: BucketEncryption.KMS, ...})
- pattern-not: |
const $X = new Bucket(..., {..., encryption: BucketEncryption.S3_MANAGED, ...})
- patterns:
- pattern-inside: |
import * as $Y from '@aws-cdk/aws-s3'
...
- pattern: const $X = new $Y.Bucket(...)
- pattern-not: |
const $X = new $Y.Bucket(..., {..., encryption: $Y.BucketEncryption.KMS_MANAGED, ...})
- pattern-not: |
const $X = new $Y.Bucket(..., {..., encryption: $Y.BucketEncryption.KMS, ...})
- pattern-not: |
const $X = new $Y.Bucket(..., {..., encryption: $Y.BucketEncryption.S3_MANAGED, ...})