Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added policy to check domain encryption added or not for elasticsearch #1084

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions avd_docs/aws/elasticsearch/AVD-AWS-0199/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Elasticsearch domain isn't encrypted at rest.

### Impact
<!-- Add Impact here -->

<!-- DO NOT CHANGE -->
{{ remediationActions }}

### Links
- https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/encryption-at-rest.html


Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# METADATA
# title: "Elasticsearch Domain Encryption"
# description: "Elasticsearch domain isn't encrypted at rest."
# scope: package
# schemas:
# - input: schema.input
# related_resources:
# - https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/encryption-at-rest.html
# custom:
# avd_id: AVD-AWS-0199
# provider: aws
# service: elasticsearch
# severity: HIGH
# short_code: enable-domain-encryption
# recommended_action: "You should ensure your Elasticsearch data is encrypted at rest to help prevent sensitive information from being read by unauthorised users."
# input:
# selector:
# - type: cloud
package builtin.aws.elasticsearch.aws0199

deny[res] {
domain := input.aws.elasticsearch.domains[_]
not domain.atrestencryption.enabled.value
res := result.new("Domain does not have at-rest encryption enabled.", domain.atrestencryption.enabled)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package builtin.aws.elasticsearch.aws0199

test_detects_when_disabled {
r := deny with input as {"aws": {"elasticsearch": {"domains": [{"atrestencryption": {"enabled": {"value": false}}}]}}}
count(r) == 1
}

test_when_enabled {
r := deny with input as {"aws": {"elasticsearch": {"domains": [{"atrestencryption": {"enabled": {"value": true}}}]}}}
count(r) == 0
}