---
inputType: "CA10__CaAwsUser__c"
testData:
  - file: test-data.json
importExtracts:
  - file: /types/CA10__CaAwsUser__c/credReport.extracts.yaml
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "This user doesn't have active access keys."
    check:
      AND:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey1Active__c
              right:
                BOOLEAN: false
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey2Active__c
              right:
                BOOLEAN: false
  - status: "INCOMPLIANT"
    currentStateMessage: "Access Key 1 hasn't been rotated for over 90 days."
    check: 
      AND:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey1Active__c
              right:
                BOOLEAN: true
          - IS_BEYOND_LAST_DAYS:
              offsetDays: 90
              arg:
                EXTRACT: CA10__credReportAccessKey1LastRotated__c
  - status: "INCOMPLIANT"
    currentStateMessage: "Access Key 2 hasn't been rotated for over 90 days."
    check: 
      AND:
        args:
          - IS_EQUAL:
              left:
                EXTRACT: CA10__credReportAccessKey2Active__c
              right:
                BOOLEAN: true
          - IS_BEYOND_LAST_DAYS:
              offsetDays: 90
              arg:
                EXTRACT: CA10__credReportAccessKey2LastRotated__c
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "All access keys are regularly rotated." 