-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added policy to check encyption enable for efs
- Loading branch information
1 parent
ad5cd7b
commit 139668d
Showing
7 changed files
with
57 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
Ensures that EFS volumes are encrypted at rest | ||
|
||
### Impact | ||
<!-- Add Impact here --> | ||
|
||
<!-- DO NOT CHANGE --> | ||
{{ remediationActions }} | ||
|
||
### Links | ||
- https://docs.aws.amazon.com/efs/latest/ug/encryption.html | ||
|
||
|
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,10 +1,13 @@ | ||
|
||
apiVersion and kind has been deprecated | ||
apiVersion '' and kind '' has been deprecated on: '' and planned for removal on:'' | ||
|
||
### Impact | ||
<!-- Add Impact here --> | ||
|
||
<!-- DO NOT CHANGE --> | ||
{{ remediationActions }} | ||
|
||
### Links | ||
- | ||
|
||
|
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
25 changes: 25 additions & 0 deletions
25
internal/rules/policies/cloud/policies/aws/efs/enable_at_rest_encryption.rego
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# METADATA | ||
# title: "EFS Encryption Enabled" | ||
# description: "Ensures that EFS volumes are encrypted at rest" | ||
# scope: package | ||
# schemas: | ||
# - input: schema.input | ||
# related_resources: | ||
# - https://docs.aws.amazon.com/efs/latest/ug/encryption.html | ||
# custom: | ||
# avd_id: AVD-AWS-0194 | ||
# provider: aws | ||
# service: efs | ||
# severity: HIGH | ||
# short_code: enable-at-rest-encryption | ||
# recommended_action: "Encryption of data at rest can only be enabled during file system creation. Encryption of data in transit is configured when mounting your file system. 1. Backup your data in not encrypted efs 2. Recreate the EFS and select \'Enable encryption of data at rest\'" | ||
# input: | ||
# selector: | ||
# - type: cloud | ||
package builtin.aws.efs.aws0193 | ||
|
||
deny[res] { | ||
fs := input.aws.efs.filesystems[_] | ||
not fs.encrypted.value | ||
res := result.new("File system is not encrypted.", fs.encrypted) | ||
} |
11 changes: 11 additions & 0 deletions
11
internal/rules/policies/cloud/policies/aws/efs/enable_at_rest_encryption_test.rego
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package builtin.aws.efs.aws0193 | ||
|
||
test_detects_when_decrypted { | ||
r := deny with input as {"aws": {"efs": {"filesystems": [{"encrypted": {"value": false}}]}}} | ||
count(r) == 1 | ||
} | ||
|
||
test_when_encrypted { | ||
r := deny with input as {"aws": {"efs": {"filesystems": [{"encrypted": {"value": true}}]}}} | ||
count(r) == 0 | ||
} |