Skip to main content

🧠 Azure Non-RBAC Key Vault stores Keys without expiration date - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure Key VaultCA10__CaAzureKeyVault__c318

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:45:23.296101988Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ extract('CA10__rbacAuthorization__c') == 'Enabled'βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ CA10__Azure_Key_Vault_Keys__r.has(INCOMPLIANT)βœ”οΈ null
🟒test4βœ”οΈ 399βœ”οΈ CA10__Azure_Key_Vault_Keys__r.has(COMPLIANT)βœ”οΈ null
🟒test5βœ”οΈ 499βœ”οΈ CA10__Azure_Key_Vault_Keys__r.has(INAPPLICABLE)βœ”οΈ null
🟒test6βœ”οΈ 500βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/policy.yamlF1F600D6113EFD2A75ABE2709F2B486D
Open/ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yamlEDBCB1D5172B31ED965E7C471D2127AD
Open/ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/test-data.json459DA43CD4A02BF66DC846A418580595
Open/types/CA10__CaAzureKeyVault__c/object.extracts.yaml6C8158AF4E8A90E532020A68611A20C7
Open/types/CA10__CaAzureKeyVaultKey__c/object.extracts.yaml06CA2E249D85942230AC96CBEE906A4E

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/key-vault/non-rbac-key-vault-keys-expiration-date/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAzureKeyVault__c"
importExtracts:
- file: "/types/CA10__CaAzureKeyVault__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is an RBAC Key Vault."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__rbacAuthorization__c"
right:
TEXT: "Enabled"
- status: "INCOMPLIANT"
currentStateMessage: "The Key Vault has Keys without expiration date."
remediationMessage: "Consider setting the Keys' expiration date."
check:
RELATED_LIST_HAS:
relationshipName: CA10__Azure_Key_Vault_Keys__r
status: "INCOMPLIANT"
- status: "COMPLIANT"
currentStateMessage: "The Key Vault Keys' expiration date is set for all enabled Keys."
check:
RELATED_LIST_HAS:
relationshipName: CA10__Azure_Key_Vault_Keys__r
status: "COMPLIANT"
- status: "INAPPLICABLE"
currentStateMessage: "The Key Vault only has disabled Keys."
check:
RELATED_LIST_HAS:
relationshipName: CA10__Azure_Key_Vault_Keys__r
status: "INAPPLICABLE"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "The Key Vault doesn't have Keys or Cloudaware doesn't have access to view Keys."
relatedLists:
- relationshipName: CA10__Azure_Key_Vault_Keys__r
importExtracts:
- file: "/types/CA10__CaAzureKeyVaultKey__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The Key is disabled."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__enabledStatus__c"
right:
TEXT: "Enabled"
- status: "INCOMPLIANT"
currentStateMessage: "The Key expiration date is not set."
remediationMessage: "Consider setting the Key expiration date."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10__expirationDate__c"
- status: "COMPLIANT"
currentStateMessage: "The Key expiration date is set."
check:
NOT_EMPTY:
arg:
EXTRACT: "CA10__expirationDate__c"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."