---
policy: /ce/ca/aws/eks/cluster-logging
logic: /ce/ca/aws/eks/cluster-logging/prod.logic.yaml
executionTime: 2025-06-28T12:02:51.600546488Z
rows:
  - id: test1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10A1__disappearanceTime__c)
      actual: isDisappeared(CA10A1__disappearanceTime__c)
    runtimeError: {}
  - id: test2
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: "extract('caExtract_logging_asCollection__c').contains('api: Disabled')"
      actual: "extract('caExtract_logging_asCollection__c').contains('api: Disabled')"
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: "extract('caExtract_logging_asCollection__c').contains('audit: Disabled')"
      actual: "extract('caExtract_logging_asCollection__c').contains('audit: Disabled')"
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: "extract('caExtract_logging_asCollection__c').contains('authenticator:\
        \ Disabled')"
      actual: "extract('caExtract_logging_asCollection__c').contains('authenticator:\
        \ Disabled')"
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: "extract('caExtract_logging_asCollection__c').contains('controllerManager:\
        \ Disabled')"
      actual: "extract('caExtract_logging_asCollection__c').contains('controllerManager:\
        \ Disabled')"
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: "extract('caExtract_logging_asCollection__c').contains('scheduler:\
        \ Disabled')"
      actual: "extract('caExtract_logging_asCollection__c').contains('scheduler: Disabled')"
    runtimeError: {}
  - id: test7
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 600
      actual: 600
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/eks/cluster-logging/policy.yaml
    md5Hash: 16BD1E3E7D16A73EACE46F9A5445DD36
    content: "names:\n  full: \"AWS EKS Cluster Logging is not enabled for all control\
      \ plane logs types\"\n  contextual: \"Cluster Logging is not enabled for all\
      \ control plane logs types\"\ndescription: >\n  Ensure that EKS cluster control\
      \ plane logs are enabled and configured to capture \n  API, audit, authenticator,\
      \ controller manager, and scheduler activity.\ncategories:\n  - \"RELIABILITY\"\
      \ntype: \"COMPLIANCE_POLICY\"\nframeworkMappings:\n  - \"/frameworks/cloudaware/logging-and-monitoring/logging-and-monitoring-configuration\"\
      \nsimilarPolicies:\n  internal:\n    - \"dec-x-8ccccedc\""
  - path: /ce/ca/aws/eks/cluster-logging/prod.logic.yaml
    md5Hash: B9E3C6651582D1FB66F0BB5264601A4F
    content: "inputType: \"CA10A1__CaAwsEksCluster__c\"\nimportExtracts:\n  - file:\
      \ \"/types/CA10A1__CaAwsEksCluster__c/object.extracts.yaml\"\ntestData:\n  -\
      \ file: \"test-data.json\"\nconditions:\n  - status: \"INCOMPLIANT\"\n    currentStateMessage:\
      \ \"EKS cluster control plane logging is not configured for API server logs.\"\
      \n    check:\n      COLLECTION_CONTAINS:\n        arg: \n          EXTRACT:\
      \ \"caExtract_logging_asCollection__c\"\n        search:\n          TEXT: \"\
      api: Disabled\"\n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"EKS\
      \ cluster control plane logging is not configured for Audit logs.\"\n    check:\n\
      \      COLLECTION_CONTAINS:\n        arg: \n          EXTRACT: \"caExtract_logging_asCollection__c\"\
      \n        search:\n          TEXT: \"audit: Disabled\"\n  - status: \"INCOMPLIANT\"\
      \n    currentStateMessage: \"EKS cluster control plane logging is not configured\
      \ for Authenticator logs.\"\n    check:\n      COLLECTION_CONTAINS:\n      \
      \  arg: \n          EXTRACT: \"caExtract_logging_asCollection__c\"\n       \
      \ search:\n          TEXT: \"authenticator: Disabled\"\n  - status: \"INCOMPLIANT\"\
      \n    currentStateMessage: \"EKS cluster control plane logging is not configured\
      \ for Controller manager logs.\"\n    check:\n      COLLECTION_CONTAINS:\n \
      \       arg: \n          EXTRACT: \"caExtract_logging_asCollection__c\"\n  \
      \      search:\n          TEXT: \"controllerManager: Disabled\"\n  - status:\
      \ \"INCOMPLIANT\"\n    currentStateMessage: \"EKS cluster control plane logging\
      \ is not configured for Scheduler logs.\"\n    check:\n      COLLECTION_CONTAINS:\n\
      \        arg: \n          EXTRACT: \"caExtract_logging_asCollection__c\"\n \
      \       search:\n          TEXT: \"scheduler: Disabled\"\notherwise:\n  status:\
      \ \"COMPLIANT\" \n  currentStateMessage: \"EKS Cluster logging is configured\
      \ for all control plane log types.\""
  - path: /types/CA10A1__CaAwsEksCluster__c/object.extracts.yaml
    md5Hash: 601E751040B9EB5B832935218E31F406
    content: "---\nextracts:\n#Values: Enabled | Disabled. Not Nullable.\n  - name:\
      \ CA10A1__endpointPublicAccess__c\n    value: \n      FIELD:\n        path:\
      \ CA10A1__endpointPublicAccess__c\n        undeterminedIf:\n          noAccessDelegate:\n\
      \            path: CA10A1__endpointPublicAccess__c\n            currentStateMessage:\
      \ \"Endpoint Public Access cannot be empty. Possible permission issues with\
      \ eks:DescribeCluster.\"\n#LONG_TEXT_AREA with IP addresses divided by \\n.\
      \ Nullable\n  - name: CA10A1__publicAccessCidrs__c\n    value: \n      FIELD:\n\
      \        path: CA10A1__publicAccessCidrs__c\n#Values: array of strings\n   \
      \   # api: Enabled\\n\n      # audit: Enabled\\n\n      # authenticator: Enabled\\\
      n\n      # controllerManager: Enabled\\n\n      # scheduler: Enabled\\n\n  -\
      \ name: CA10A1__logging__c\n    value: \n      FIELD:\n        path: CA10A1__logging__c\n\
      \        undeterminedIf:\n          noAccessDelegate:\n            path: CA10A1__logging__c\n\
      \            currentStateMessage: \"Cluster Logging cannot be empty. Possible\
      \ permission issues with eks:DescribeCluster.\"\n  - name: caExtract_logging_asCollection__c\n\
      \    value:\n      COLLECTION_FROM:\n        separator: \"\\n\"\n        emptyValues:\
      \ SKIP\n        duplicateValues: SKIP\n        ordering: SORTED\n        arg:\
      \ \n          EXTRACT: \"CA10A1__logging__c\""
  - path: /ce/ca/aws/eks/cluster-logging/test-data.json
    md5Hash: AD893E6E1D602EC63E2A2932AC6D8043
    content: |-
      [
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "99",
                  "conditionText": "isDisappeared(CA10A1__disappearanceTime__c)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test1",
              "CA10A1__disappearanceTime__c": "2025-05-22T08:12:49Z",
              "CA10A1__logging__c": "api: Disabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "extract('caExtract_logging_asCollection__c').contains('api: Disabled')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test2",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Disabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "299",
                  "conditionText": "extract('caExtract_logging_asCollection__c').contains('audit: Disabled')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test3",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Enabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "extract('caExtract_logging_asCollection__c').contains('authenticator: Disabled')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test4",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Enabled\naudit: Enabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "499",
                  "conditionText": "extract('caExtract_logging_asCollection__c').contains('controllerManager: Disabled')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test5",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Disabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "599",
                  "conditionText": "extract('caExtract_logging_asCollection__c').contains('scheduler: Disabled')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test6",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Enabled\nscheduler: Disabled"
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "600",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-22T08:12:49Z"
              },
              "Id": "test7",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__logging__c": "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Enabled\nscheduler: Enabled"
          }
      ]
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "test1",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "99",
      "conditionText" : "isDisappeared(CA10A1__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caExtract_logging_asCollection__c').contains('api: Disabled')",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "extract('caExtract_logging_asCollection__c').contains('audit: Disabled')",
      "runtimeError" : null
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "extract('caExtract_logging_asCollection__c').contains('authenticator: Disabled')",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "499",
      "conditionText" : "extract('caExtract_logging_asCollection__c').contains('controllerManager: Disabled')",
      "runtimeError" : null
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "599",
      "conditionText" : "extract('caExtract_logging_asCollection__c').contains('scheduler: Disabled')",
      "runtimeError" : null
    }
  }, {
    "Id" : "test7",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "600",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsEksCluster__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__logging__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test1",
    "CA10A1__disappearanceTime__c" : new Date("2025-05-22T08:12:49Z"),
    "CA10A1__logging__c" : "api: Disabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test2",
    "CA10A1__logging__c" : "api: Disabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test3",
    "CA10A1__logging__c" : "api: Enabled\naudit: Disabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test4",
    "CA10A1__logging__c" : "api: Enabled\naudit: Enabled\nauthenticator: Disabled\ncontrollerManager: Disabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test5",
    "CA10A1__logging__c" : "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Disabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test6",
    "CA10A1__logging__c" : "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Enabled\nscheduler: Disabled"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-22T08:12:49Z")
    },
    "Id" : "test7",
    "CA10A1__logging__c" : "api: Enabled\naudit: Enabled\nauthenticator: Enabled\ncontrollerManager: Enabled\nscheduler: Enabled"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10A1__CaAwsEksCluster__c(
      obj STRUCT<
          Id STRING,
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__logging__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var CollectionLib = new function () {
          this.parse = function(arg, separator, skipEmpty, skipDuplicates, sort, normalize) {
              if (arg == null) return [];
              let parts = arg.split(separator);
              return this.fromArray(parts, skipEmpty, skipDuplicates, sort, normalize);
          };
          this.fromArray = function(arr, skipEmpty, skipDuplicates, sort, normalize) {
              if (arr == null) return [];
              let result = [];
              let seen = new Set();
              arr.forEach(el => {
                  if (!skipEmpty || TextLib.isNotEmpty(el)) {
                      let normalized = normalize ? TextLib.normalize(el) : el;
                      if (!skipDuplicates || !seen.has(normalized)) {
                          if (skipDuplicates) seen.add(normalized);
                          result.push(normalized);
                      }
                  }
              });
              if (sort) result.sort();
              return result;
          };
          this.equal = function(left, right) {
              left = left == null ? [] : left;
              right = right == null ? [] : right;
              if (left.length !== right.length) return false;
              for (let i = 0; i < left.length; i++) {
                  if (left[i] !== right[i]) return false;
              }
              return true;
          };
          this.notEqual = function(left, right) {
              return !this.equal(left, right);
          };
          this.contains = function(collection, search, normalize) {
              if (collection == null) return false;
              return collection.includes(normalize ? TextLib.normalize(search) : search);
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.length;
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10A1__disappearanceTime__c]: ' + obj.CA10A1__disappearanceTime__c);
      if (obj.CA10A1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10A1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      function fieldChecked6() {
          if (TextLib.isEmpty(obj.CA10A1__logging__c)) {
              throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10A1__logging__c.delegatedTo(CA10A1__logging__c).isEmpty()", currentStateMessage: "Cluster Logging cannot be empty. Possible permission issues with eks:DescribeCluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__logging__c;
      }
      function extract5() { if (!this.out) { this.out = fieldChecked6(); } return this.out; };
      function extract3() { if (!this.out) { this.out = CollectionLib.parse(extract5.call(extract5), '\n', true, true, true, true); } return this.out; };
      references1.push('Logging [obj.CA10A1__logging__c]: ' + obj.CA10A1__logging__c);
      try {
          if (CollectionLib.contains(extract3.call(extract3), 'api: Disabled', true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('caExtract_logging_asCollection__c').contains('api: Disabled')", currentStateMessage: "EKS cluster control plane logging is not configured for API server logs.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[2], conditionIndex:[200..299]
      function fieldChecked12() {
          if (TextLib.isEmpty(obj.CA10A1__logging__c)) {
              throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10A1__logging__c.delegatedTo(CA10A1__logging__c).isEmpty()", currentStateMessage: "Cluster Logging cannot be empty. Possible permission issues with eks:DescribeCluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__logging__c;
      }
      function extract11() { if (!this.out) { this.out = fieldChecked12(); } return this.out; };
      function extract9() { if (!this.out) { this.out = CollectionLib.parse(extract11.call(extract11), '\n', true, true, true, true); } return this.out; };
      try {
          if (CollectionLib.contains(extract9.call(extract9), 'audit: Disabled', true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('caExtract_logging_asCollection__c').contains('audit: Disabled')", currentStateMessage: "EKS cluster control plane logging is not configured for Audit logs.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[3], conditionIndex:[300..399]
      function fieldChecked18() {
          if (TextLib.isEmpty(obj.CA10A1__logging__c)) {
              throw new Error("UNDETERMINED condition:301", {cause: {status: 'UNDETERMINED', conditionIndex: 301, conditionText: "CA10A1__logging__c.delegatedTo(CA10A1__logging__c).isEmpty()", currentStateMessage: "Cluster Logging cannot be empty. Possible permission issues with eks:DescribeCluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__logging__c;
      }
      function extract17() { if (!this.out) { this.out = fieldChecked18(); } return this.out; };
      function extract15() { if (!this.out) { this.out = CollectionLib.parse(extract17.call(extract17), '\n', true, true, true, true); } return this.out; };
      try {
          if (CollectionLib.contains(extract15.call(extract15), 'authenticator: Disabled', true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('caExtract_logging_asCollection__c').contains('authenticator: Disabled')", currentStateMessage: "EKS cluster control plane logging is not configured for Authenticator logs.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[4], conditionIndex:[400..499]
      function fieldChecked24() {
          if (TextLib.isEmpty(obj.CA10A1__logging__c)) {
              throw new Error("UNDETERMINED condition:401", {cause: {status: 'UNDETERMINED', conditionIndex: 401, conditionText: "CA10A1__logging__c.delegatedTo(CA10A1__logging__c).isEmpty()", currentStateMessage: "Cluster Logging cannot be empty. Possible permission issues with eks:DescribeCluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__logging__c;
      }
      function extract23() { if (!this.out) { this.out = fieldChecked24(); } return this.out; };
      function extract21() { if (!this.out) { this.out = CollectionLib.parse(extract23.call(extract23), '\n', true, true, true, true); } return this.out; };
      try {
          if (CollectionLib.contains(extract21.call(extract21), 'controllerManager: Disabled', true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 499, conditionText: "extract('caExtract_logging_asCollection__c').contains('controllerManager: Disabled')", currentStateMessage: "EKS cluster control plane logging is not configured for Controller manager logs.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[5], conditionIndex:[500..599]
      function fieldChecked30() {
          if (TextLib.isEmpty(obj.CA10A1__logging__c)) {
              throw new Error("UNDETERMINED condition:501", {cause: {status: 'UNDETERMINED', conditionIndex: 501, conditionText: "CA10A1__logging__c.delegatedTo(CA10A1__logging__c).isEmpty()", currentStateMessage: "Cluster Logging cannot be empty. Possible permission issues with eks:DescribeCluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__logging__c;
      }
      function extract29() { if (!this.out) { this.out = fieldChecked30(); } return this.out; };
      function extract27() { if (!this.out) { this.out = CollectionLib.parse(extract29.call(extract29), '\n', true, true, true, true); } return this.out; };
      try {
          if (CollectionLib.contains(extract27.call(extract27), 'scheduler: Disabled', true)) {
              return {status: 'INCOMPLIANT', conditionIndex: 599, conditionText: "extract('caExtract_logging_asCollection__c').contains('scheduler: Disabled')", currentStateMessage: "EKS cluster control plane logging is not configured for Scheduler logs.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      return {status: 'COMPLIANT', conditionIndex: 600, conditionText: "otherwise", currentStateMessage: "EKS Cluster logging is configured for all control plane log types.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
          sObject.CA10A1__logging__c AS CA10A1__logging__c,
          process_CA10A1__CaAwsEksCluster__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                  sObject.CA10A1__logging__c AS CA10A1__logging__c
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10A1__CaAwsEksCluster__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
