🧠 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 - Tags:
Uses
- 📗 Azure Network Watcher Flow Log
- 🔌 Azure Network Watcher Flow Log - object.extracts.yaml
- 🧪 test-data.json
Test Results 🟢
Generated at: 2026-06-06T12:04:13.747090490Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| 🟢 | 001 | ✔️ 299 | ✔️ extract('CA10Z1__logStatus__c') != 'Enabled' | ✔️ null |
| 🟢 | 002 | ✔️ 199 | ✔️ isEmptyLookup('CA10Z1__virtualNetwork__r') | ✔️ null |
| 🟢 | 003 | ✔️ 499 | ✔️ extract('CA10Z1__retentionPolicyDays__c') == number(0.0) || (extract('CA10Z1__retentionPolicyStatus__c') == 'Enabled' && extract('CA10Z1__retentionPolicyDays__c') >= number(90.0)) | ✔️ null |
| 🟢 | 004 | ✔️ 500 | ✔️ otherwise | ✔️ null |
| 🟢 | 005 | ✔️ 499 | ✔️ extract('CA10Z1__retentionPolicyDays__c') == number(0.0) || (extract('CA10Z1__retentionPolicyStatus__c') == 'Enabled' && extract('CA10Z1__retentionPolicyDays__c') >= number(90.0)) | ✔️ null |
| 🟢 | 006 | ✔️ 499 | ✔️ extract('CA10Z1__retentionPolicyDays__c') == number(0.0) || (extract('CA10Z1__retentionPolicyStatus__c') == 'Enabled' && extract('CA10Z1__retentionPolicyDays__c') >= number(90.0)) | ✔️ null |
Generation Bundle
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/policy.yaml | 2069E44FEC611CFB99E2FF06A4EB849F |
| Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml | 69AB972B7E798A96673EE5BE0BC644D1 |
| Open | /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/test-data.json | 24D42EAA4B3CDAB19F319387912E1752 |
| Open | /types/CA10Z1__CaAzureNetworkWatcherFlowLog__c/object.extracts.yaml | 59B4D363F220B72D61773BA679C17EDB |
Available Commands
repo-manager policies generate FULL /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/virtual-network/virtual-network-flow-logs-retention-period-over-90-days/prod.logic.yaml
# Execute tests
repo-manager 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: "Only applicable to virtual network flow logs."
check:
IS_EMPTY_LOOKUP: "CA10Z1__virtualNetwork__r"
- status: "INCOMPLIANT"
currentStateMessage: "Virtual network flow logs are disabled."
remediationMessage: "Enable virtual network flow logs and set retention to 0 or at least 90 days."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__logStatus__c"
right:
TEXT: "Enabled"
- status: "INCOMPLIANT"
currentStateMessage: "Virtual network flow logs retention period is not configured."
remediationMessage: "Set the retention period to 0 or at least 90 days."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10Z1__retentionPolicyDays__c"
- status: "COMPLIANT"
currentStateMessage: "Virtual network flow logs are enabled and the retention period is set to 0 or at least 90 days."
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10Z1__retentionPolicyDays__c"
right:
NUMBER: 0.0
- AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10Z1__retentionPolicyStatus__c"
right:
TEXT: "Enabled"
- 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: "Set the retention period to 0 or at least 90 days."