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 description security group for elasticache #1081

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
13 changes: 13 additions & 0 deletions avd_docs/aws/elasticache/AVD-AWS-0196/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Missing description for security group/security group rule.

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

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

### Links
- https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/SecurityGroups.Creating.html


2 changes: 1 addition & 1 deletion avd_docs/kubernetes/general/AVD-KSV-01010/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Storing sensitive content such as usernames and email addresses in configMaps is unsafe

### Impact
Unsafe storage of sensitive content in configMaps could lead to the information being compromised.
<!-- Add Impact here -->
SanaaYousaf marked this conversation as resolved.
Show resolved Hide resolved

<!-- DO NOT CHANGE -->
{{ remediationActions }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# METADATA
# title: "Elasticache Security Group Description"
# description: "Missing description for security group/security group rule."
# scope: package
# schemas:
# - input: schema.input
# related_resources:
# - https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/SecurityGroups.Creating.html
# custom:
# avd_id: AVD-AWS-0196
# provider: aws
# service: elasticache
# severity: LOW
# short_code: add-description-for-security-group
# recommended_action: "Security groups and security group rules should include a description for auditing purposes. Simplifies auditing, debugging, and managing security groups."
# input:
# selector:
# - type: cloud
package builtin.aws.elasticache.aws0196

deny[res] {
sg := input.aws.elasticache.securitygroups[_]
sg.description.value == ""
res := result.new("Security group does not have a description.", sg.description)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package builtin.aws.elasticache.aws0196

test_detects_when_description_not_have {
r := deny with input as {"aws": {"elasticache": {"securitygroups": [{"description": {"value": ""}}]}}}
count(r) == 1
}

test_when_description_have {
r := deny with input as {"aws": {"elasticache": {"securitygroups": [{"description": {"value": "description"}}]}}}
count(r) == 0
}