π§ Azure Virtual Network Flow Logs retention period is less than 90 days - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
- Located in: π Azure Virtual Network Flow Logs retention period is less than 90 days π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure Network Watcher Flow Log | CA10Z1__CaAzureNetworkWatcherFlowLog__c | 3 | 1 | 1 |
Usesβ
Test Results π’β
Generated at: 2025-07-21T17:40:59.010074911Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | 001 | βοΈ 199 | βοΈ extract('CA10Z1__logStatus__c') != 'Enabled' | βοΈ null |
π’ | 002 | βοΈ 299 | βοΈ isEmptyLookup('CA10Z1__virtualNetwork__r') | βοΈ null |
π’ | 003 | βοΈ 399 | βοΈ extract('CA10Z1__retentionPolicyStatus__c') != 'Enabled' | βοΈ null |
π’ | 004 | βοΈ 500 | βοΈ otherwise | βοΈ null |
π’ | 005 | βοΈ 499 | βοΈ extract('CA10Z1__retentionPolicyDays__c') == number(0.0) || extract('CA10Z1__retentionPolicyDays__c') >= number(90.0) | βοΈ null |
π’ | 006 | βοΈ 499 | βοΈ extract('CA10Z1__retentionPolicyDays__c') == number(0.0) || extract('CA10Z1__retentionPolicyDays__c') >= number(90.0) | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/policy.yaml | ACEEDF9AE78970D827F4C3B56EA5CDBE |
Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml | 0E63FC49C6A917F8F58E1A0DC14E00E4 |
Open | /types/CA10Z1__CaAzureNetworkWatcherFlowLog__c/object.extracts.yaml | 59B4D363F220B72D61773BA679C17EDB |
Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/test-data.json | 7006BE66A50B1A7F8EB9BBE14B5B813C |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
Contentβ
---
inputType: "CA10Z1__CaAzureNetworkWatcherFlowLog__c"
importExtracts:
- file: /types/CA10Z1__CaAzureNetworkWatcherFlowLog__c/object.extracts.yaml
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Flow Log is disabled."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__logStatus__c"
right:
TEXT: "Enabled"
- status: "INAPPLICABLE"
currentStateMessage: "Only for Virtual network Flow Logs."
check:
IS_EMPTY_LOOKUP: "CA10Z1__virtualNetwork__r"
- status: "INCOMPLIANT"
currentStateMessage: "Virtual network Flow Logs retention policy is disabled."
remediationMessage: "Consider enabling retention policy for Virtual network Flow Logs."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__retentionPolicyStatus__c"
right:
TEXT: "Enabled"
- status: "COMPLIANT"
currentStateMessage: "Virtual network Flow Logs are enabled and the retention period is set to 'greater than or equal to 90 days'."
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10Z1__retentionPolicyDays__c"
right:
NUMBER: 0.0
- GREATER_THAN_EQUAL:
left:
EXTRACT: "CA10Z1__retentionPolicyDays__c"
right:
NUMBER: 90.0
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Virtual network Flow Logs retention period is less than 90 days."
remediationMessage: "Consider setting the retention period to 'greater then or equal to 90 days'."