---
inputType: "CA10__CaAzureActiveDirectory__c"
testData:
  - file: "test-data.json"
conditions:
      - status: "INCOMPLIANT"
        currentStateMessage: "The default user role can create applications."
        remediationMessage: "Consider restricting the default user role from creating applications."
        check:
          RELATED_LIST_HAS:
            status: "INCOMPLIANT"
            relationshipName: "CA10Z1__Azure_Active_Directory_Auth_Policies__r"
      - status: "COMPLIANT"
        currentStateMessage: "The default user role cannot create applications."
        check:
          RELATED_LIST_HAS:
            status: "COMPLIANT"
            relationshipName: "CA10Z1__Azure_Active_Directory_Auth_Policies__r"
      - status: "UNDETERMINED"
        currentStateMessage: "Unable to determine the default user role permissions."
        check:
          RELATED_LIST_HAS:
            status: "UNDETERMINED"
            relationshipName: "CA10Z1__Azure_Active_Directory_Auth_Policies__r"
otherwise:
  status: "UNDETERMINED"
  currentStateMessage: "The Authorization Policy for Microsoft Entra is not present in the CMDB."
relatedLists:
  - relationshipName: "CA10Z1__Azure_Active_Directory_Auth_Policies__r"
    importExtracts:
      - file: "/types/CA10Z1__CaAzureActiveDirectoryAuthPolicy__c/object.extracts.yaml"
    conditions:
      - status: "INCOMPLIANT"
        currentStateMessage: "The default user role can create applications."
        remediationMessage: "Consider restricting the default user role from creating applications."
        check:
          IS_EQUAL:
            left:
              EXTRACT: "CA10Z1__defaultPermissionCreateApps__c"
            right:
              TEXT: "Disabled"
      - status: "COMPLIANT"
        currentStateMessage: "The default user role cannot create applications."
        check:
          IS_EQUAL:
            left:
              EXTRACT: "CA10Z1__defaultPermissionCreateApps__c"
            right:
              TEXT: "Enabled"
    otherwise:
      status: "UNDETERMINED"
      currentStateMessage: "Unexpected value in the field."
