π§ Azure Network Security Group allows unrestricted HTTP(S) access from the Internet - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
- Located in: π Azure Network Security Group allows unrestricted HTTP(S) access from the Internet π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure Network Security Group | CA10__CaAzureNetworkSecurityGroup__c | 3 | 1 | 5 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:46:33.484548441Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
π’ | test2 | βοΈ 199 | βοΈ CA10__Azure_Network_Security_Group_Rules__r.has(INCOMPLIANT) | βοΈ null |
π’ | test3 | βοΈ 199 | βοΈ CA10__Azure_Network_Security_Group_Rules__r.has(INCOMPLIANT) | βοΈ null |
π’ | test4 | βοΈ 199 | βοΈ CA10__Azure_Network_Security_Group_Rules__r.has(INCOMPLIANT) | βοΈ null |
π’ | test5 | βοΈ 199 | βοΈ CA10__Azure_Network_Security_Group_Rules__r.has(INCOMPLIANT) | βοΈ null |
π’ | test6 | βοΈ 199 | βοΈ CA10__Azure_Network_Security_Group_Rules__r.has(INCOMPLIANT) | βοΈ null |
π’ | test7 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | test8 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | test9 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | test10 | βοΈ 200 | βοΈ otherwise | βοΈ null |
π’ | test11 | βοΈ 200 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/policy.yaml | 5AFFFB78EB9C51153544DE2DB568C00E |
Open | /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml | BCFD06C14210C7C8F53AB915184969D7 |
Open | /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/test-data.json | 722214B1DAF91C04C1EC42B30DFDB1CA |
Open | /types/CA10__CaAzureNetworkSecurityGroupRule__c/object.extracts.yaml | A60C817EFBC8F066D6D082898E8597BC |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/azure/virtual-network/security-group-rule-disable-https-access-from-internet/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAzureNetworkSecurityGroup__c"
testData:
- file: "test-data.json"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Network Security Group has a rule that allows HTTP(S) access from the Internet."
remediationMessage: "Consider restricting internet-level access to your Azure resources."
check:
RELATED_LIST_HAS:
relationshipName: "CA10__Azure_Network_Security_Group_Rules__r"
status: "INCOMPLIANT"
otherwise:
status: "COMPLIANT"
currentStateMessage: "Network Security Group does not allow unrestricted HTTP(S) access from the internet."
relatedLists:
- relationshipName: "CA10__Azure_Network_Security_Group_Rules__r"
importExtracts:
- file: "/types/CA10__CaAzureNetworkSecurityGroupRule__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "NSG Deny Rule."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__access__c"
right:
TEXT: "Allow"
- status: "INAPPLICABLE"
currentStateMessage: "NSG Outbound Rule."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__direction__c"
right:
TEXT: "Inbound"
- status: "INAPPLICABLE"
currentStateMessage: "NSG Rule with the port other than UDP."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__protocol__c"
right:
TEXT: "TCP"
- status: "INAPPLICABLE"
currentStateMessage: "NSG Rule source is not any address."
check:
# returns true when source is neither Internet, *, 0.0.0.0, /0, or Any
NOT:
arg:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__sourceAddressPrefix__c"
right:
TEXT: "Internet"
- IS_EQUAL:
left:
EXTRACT: "CA10__sourceAddressPrefix__c"
right:
TEXT: "*"
- IS_EQUAL:
left:
EXTRACT: "CA10__sourceAddressPrefix__c"
right:
TEXT: "0.0.0.0"
- CONTAINS:
arg:
EXTRACT: "CA10__sourceAddressPrefix__c"
substring:
TEXT: "/0"
- IS_EQUAL:
left:
EXTRACT: "CA10__sourceAddressPrefix__c"
right:
TEXT: "Any"
- status: "INCOMPLIANT"
currentStateMessage: "NSG Rule with HTTP(S) access from the Internet."
remediationMessage: "Consider restricting internet-level access to your Azure resources."
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__destinationPortRange__c"
right:
TEXT: "80"
- IS_EQUAL:
left:
EXTRACT: "CA10__destinationPortRange__c"
right:
TEXT: "443"
- IS_EQUAL:
left:
EXTRACT: "CA10__destinationPortRange__c"
right:
TEXT: "*"
- AND:
args:
- LESS_THAN_EQUAL:
left:
EXTRACT: "CA10__destinationPortFrom__c"
right:
NUMBER: 80.0
- GREATER_THAN_EQUAL:
left:
EXTRACT: "CA10__destinationPortTo__c"
right:
NUMBER: 80.0
- AND:
args:
- LESS_THAN_EQUAL:
left:
EXTRACT: "CA10__destinationPortFrom__c"
right:
NUMBER: 443.0
- GREATER_THAN_EQUAL:
left:
EXTRACT: "CA10__destinationPortTo__c"
right:
NUMBER: 443.0
otherwise:
status: "INAPPLICABLE"
currentStateMessage: "Unrelated rule."