π§ AWS GuardDuty Detector Malware Protection for EC2 is not enabled - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
Test Results π’β
Generated at: 2025-10-30T16:52:14.500033795Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | test1 | βοΈ 201 | βοΈ CA10__featuresJson__c.delegatedTo(CA10__featuresJson__c).isEmpty() | βοΈ null |
| π’ | test2 | βοΈ 299 | βοΈ extract('caJsonFrom__featuresJson__c').jsonQueryText('[?name==\'EBS_MALWARE_PROTECTION\'].status | [0]') == 'DISABLED' | βοΈ null |
| π’ | test3 | βοΈ 399 | βοΈ extract('caJsonFrom__featuresJson__c').jsonQueryText('[?name==\'EBS_MALWARE_PROTECTION\'].status | [0]') == 'ENABLED' | βοΈ null |
| π’ | test4 | βοΈ 199 | βοΈ extract('CA10__status__c') != 'ENABLED' | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/policy.yaml | 39AAA686A56761D47FE6499A6DCCDC9E |
| Open | /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml | 2FE24508FFFD018F1A67EB17AA8462FA |
| Open | /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/test-data.json | 4F5FCEDD6CD9B26C3460F28083CAD472 |
| Open | /types/CA10__CaAwsGuardDutyDetector__c/object.extracts.yaml | 8B76173EB0902B7F969958A52EDB9AD5 |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/guardduty/detector-malware-protection-for-ec2/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsGuardDutyDetector__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10__CaAwsGuardDutyDetector__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This GuardDuty Detector is not enabled."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__status__c"
right:
TEXT: "ENABLED"
- status: "INCOMPLIANT"
currentStateMessage: "Malware Protection for EC2 is not enabled for this detector."
remediationMessage: "Enable Malware Protection for EC2 to detect potential malware on your instances."
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
expression: "[?name=='EBS_MALWARE_PROTECTION'].status | [0]"
arg:
EXTRACT: "caJsonFrom__featuresJson__c"
undeterminedIf:
evaluationError: "Json query text has failed."
resultTypeMismatch: "Json query text did not return text type."
right:
TEXT: "DISABLED"
- status: "COMPLIANT"
currentStateMessage: "Malware Protection for EC2 is enabled for this detector."
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
expression: "[?name=='EBS_MALWARE_PROTECTION'].status | [0]"
arg:
EXTRACT: "caJsonFrom__featuresJson__c"
undeterminedIf:
evaluationError: "Json query text has failed."
resultTypeMismatch: "Json query text did not return text type."
right:
TEXT: "ENABLED"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the field."