---
inputType: "CA10__CaAwsUser__c"
testData:
  - file: test-data.json
importExtracts:
  - file: /types/CA10__CaAwsUser__c/credReport.extracts.yaml
  - file: /types/CA10__CaAwsUser__c/object.extracts.yaml
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "Requirements of this policy are applicable only to the root user"
    check:
      NOT_EQUAL:
        left:
          EXTRACT: CA10__userName__c
        right:
          TEXT: "root"
  - status: "INCOMPLIANT"
    currentStateMessage: "Either one or both access keys are active for the root user."
    remediationMessage: "Disable all active access keys for the root user."
    check:
      OR:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey1Active__c
              right:
                BOOLEAN: true
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey2Active__c
              right:
                BOOLEAN: true
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "The root user does not have any active access keys."