🧠 AWS EC2 Security Group allows unrestricted traffic to all ports - prod.logic.yaml🟢
- Contextual name: 🧠 prod.logic.yaml🟢
- ID:
/ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml - Tags:
Uses
Test Results 🟢
Generated at: 2026-02-10T22:32:47.209438879Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| 🟢 | test1 | ✔️ 99 | ✔️ isDisappeared(CA10__disappearanceTime__c) | ✔️ null |
| 🟢 | test2 | ✔️ 199 | ✔️ CA10__AWS_EC2_Security_Group_Rules__r.has(INCOMPLIANT) | ✔️ null |
| 🟢 | test3 | ✔️ 199 | ✔️ CA10__AWS_EC2_Security_Group_Rules__r.has(INCOMPLIANT) | ✔️ null |
| 🟢 | test5 | ✔️ 200 | ✔️ otherwise | ✔️ null |
| 🟢 | test6 | ✔️ 200 | ✔️ otherwise | ✔️ null |
| 🟢 | test7 | ✔️ 200 | ✔️ otherwise | ✔️ null |
| 🟢 | test8 | ✔️ 200 | ✔️ otherwise | ✔️ null |
Generation Bundle
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/policy.yaml | 6A0899EEE38E249A32C47C0B6B1090E5 |
| Open | /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml | A355F3D652C2608E80AFCE8825AF3737 |
| Open | /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/test-data.json | 1FE3DA87009DD3D0A523336A9A37C862 |
| Open | /types/CA10__CaAwsSecurityGroupRule2__c/object.extracts.yaml | 58DC1872D7462985D50972C65C61C237 |
Available Commands
repo-manager policies generate FULL /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-all-ports/prod.logic.yaml
Content
---
inputType: "CA10__CaAwsSecurityGroup__c"
testData:
- file: "test-data.json"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "At least one rule opens common ports to inbound connections."
remediationMessage: "Remove these rules or narrow them to specific CIDRs."
check:
RELATED_LIST_HAS:
relationshipName: "CA10__AWS_EC2_Security_Group_Rules__r"
status: "INCOMPLIANT"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The security group has no rules that open common ports to the internet."
relatedLists:
- relationshipName: "CA10__AWS_EC2_Security_Group_Rules__r"
importExtracts:
- file: "/types/CA10__CaAwsSecurityGroupRule2__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is an outbound security group rule."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__direction__c"
right:
TEXT: "Inbound"
- status: "INAPPLICABLE"
currentStateMessage: "This is not an IP-based security group rule."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__source__c"
right:
TEXT: "IP"
- status: "INAPPLICABLE"
currentStateMessage: "This security group rule does not allow unrestricted access."
check:
AND:
args:
- NOT_EQUAL:
left:
EXTRACT: "CA10__sourceIpRange__c"
right:
TEXT: "0.0.0.0/0"
- NOT_EQUAL:
left:
EXTRACT: "CA10__sourceIpRange__c"
right:
TEXT: "::/0"
- status: "INCOMPLIANT"
currentStateMessage: "This rule opens all protocols and all ports to the internet."
remediationMessage: "Remove the rule or narrow it to a specific port, protocol, and CIDR."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__protocol__c"
right:
TEXT: "All"
- IS_EMPTY:
arg:
EXTRACT: "CA10__fromPort__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10__toPort__c"
- status: "INCOMPLIANT"
currentStateMessage: "This rule opens all protocols and all ports to the internet."
remediationMessage: "Remove the rule or narrow it to a specific port, protocol, and CIDR."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__protocol__c"
right:
TEXT: "tcp"
- IS_EQUAL:
left:
EXTRACT: "CA10__fromPort__c"
right:
NUMBER: 0.0
- IS_EQUAL:
left:
EXTRACT: "CA10__toPort__c"
right:
NUMBER: 65535.0
otherwise:
status: "COMPLIANT"
currentStateMessage: "This security group does not allow unrestricted access."