---
inputType: "CA10__CaAzureStorageAccount__c"
importExtracts:
  - file: "/types/CA10__CaAzureStorageAccount__c/object.extracts.yaml"
testData:
  - file: "test-data.json"
conditions:
  - status: "INCOMPLIANT"
    currentStateMessage: "The soft delete configuration for Azure Storage Blob Storage is not enabled."
    remediationMessage: "Consider enabling soft delete for Blob Storage."
    check:
      OR:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: "CA10__blobRetentionPolicyState__c"
              right:
                TEXT: "Disabled"
          - IS_EMPTY:
              arg:
                EXTRACT: "CA10__blobRetentionPolicyState__c"
          - IS_EMPTY:
              arg:
                EXTRACT: "CA10__blobRetentionPolicyDays__c"
  - status: "INCOMPLIANT"
    currentStateMessage: "The soft delete configuration for Azure Storage Containers is not enabled."
    remediationMessage: "Consider enabling soft delete for Containers."
    check:
      OR:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: "CA10__containerRetentionPolicyState__c"
              right:
                TEXT: "Disabled"
          - IS_EMPTY:
              arg:
                EXTRACT: "CA10__containerRetentionPolicyState__c"
          - IS_EMPTY:
              arg:
                EXTRACT: "CA10__containerRetentionPolicyDays__c"
  - status: "COMPLIANT"
    currentStateMessage: "The soft delete for Azure Storage Containers is enabled."
    check:
      AND:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: "CA10__containerRetentionPolicyState__c"
              right:
                TEXT: "Enabled"
          - NOT_EMPTY:
              arg:
                EXTRACT: "CA10__containerRetentionPolicyDays__c"
          - IS_EQUAL:
              left:
                EXTRACT: "CA10__blobRetentionPolicyState__c"
              right:
                TEXT: "Enabled"
          - NOT_EMPTY:
              arg:
                EXTRACT: "CA10__blobRetentionPolicyDays__c"
otherwise:
  status: "UNDETERMINED"
  currentStateMessage: "Unexpected values in the fields."