π§ Azure Subscription Microsoft Defender For Azure Cosmos DB is not set to On - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
- Located in: π Azure Subscription Microsoft Defender For Azure Cosmos DB is not set to On π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure Subscription | CA10__CaAzureAccount__c | 13 | 1 | 31 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:46:19.598885809Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 199 | βοΈ CA10Z1__Azure_SQL_Server_Vulnerability_Assessmnt__r.has(INCOMPLIANT) | βοΈ null |
π’ | test2 | βοΈ 299 | βοΈ CA10Z1__Azure_SQL_Server_Vulnerability_Assessmnt__r.has(COMPLIANT) | βοΈ null |
π’ | test3 | βοΈ 300 | βοΈ otherwise | βοΈ null |
π’ | test4 | βοΈ 300 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/policy.yaml | B26AF0BA7A140C2453C6D0317C0981BE |
Open | /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml | 0DD834B27AEDF8257AFC579F5D96B090 |
Open | /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/test-data.json | 4F8826D0971FC7343EC37E4DCBDA6D2E |
Open | /types/CA10Z1__CaAzureDefenderPlan__c/object.extracts.yaml | 5DCAFDE8B3F3B4436C9A1165F58784CB |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/azure/subscription/microsoft-defender-for-cosmos-db/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAzureAccount__c"
testData:
- file: "test-data.json"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Microsoft Defender for Cosmos DB is in Free tier."
remediationMessage: "Consider enabling Defender for Cosmos DB Standard plan."
check:
RELATED_LIST_HAS:
relationshipName: "CA10Z1__Azure_SQL_Server_Vulnerability_Assessmnt__r"
status: "INCOMPLIANT"
- status: "COMPLIANT"
currentStateMessage: "Microsoft Defender for Cosmos DB Standard tier is enabled."
check:
RELATED_LIST_HAS:
relationshipName: "CA10Z1__Azure_SQL_Server_Vulnerability_Assessmnt__r"
status: "COMPLIANT"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Microsoft Defender for Cosmos DB is not enabled."
remediationMessage: "Consider enabling Microsoft Defender for Cosmos DB Standard plan."
relatedLists:
- relationshipName: "CA10Z1__Azure_SQL_Server_Vulnerability_Assessmnt__r"
importExtracts:
- file: "/types/CA10Z1__CaAzureDefenderPlan__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Other pricing configurations."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__name__c"
right:
TEXT: "CosmosDbs"
- status: "COMPLIANT"
currentStateMessage: "This is a Standard tier."
check:
IS_EQUAL:
left:
EXTRACT: "CA10Z1__pricingTier__c"
right:
TEXT: "Standard"
- status: "INCOMPLIANT"
currentStateMessage: "This is a Free tier."
remediationMessage: "Enable Defender for Cosmos DB Standard plan."
check:
IS_EQUAL:
left:
EXTRACT: "CA10Z1__pricingTier__c"
right:
TEXT: "Free"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."