---
policy: /ce/ca/aws/ecr/disable-repository-manual-scanning
logic: /ce/ca/aws/ecr/disable-repository-manual-scanning/prod.logic.yaml
executionTime: 2025-10-04T12:03:04.229070641Z
generationMs: 66
executionMs: 1227
rows:
  - id: test1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10__disappearanceTime__c)
      actual: isDisappeared(CA10__disappearanceTime__c)
    runtimeError: {}
  - id: test2
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)')
        == number(0.0)
      actual: extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)')
        == number(0.0)
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 300
      actual: 300
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: UNDETERMINED
      actual: UNDETERMINED
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: isEmptyLookup('CA10A1__registry__r')
      actual: isEmptyLookup('CA10A1__registry__r')
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/ecr/disable-repository-manual-scanning/policy.yaml
    md5Hash: 4EE1EFE0B52AB72E513794FCC368AF08
    content: "---\nnames:\n  full: \"AWS ECR Repository Manual Scanning is enabled\"\
      \n  contextual: \"Repository Manual Scanning is enabled\"\ndescription: >\n\
      \  AWS ECR Repository can be configured to automatically scan container images\
      \ for\n  software vulnerabilities. It is recommended to enable Scan On Push\
      \ or Enhanced \n  Scanning to ensure vulnerabilities are identified as soon\
      \ as an image is pushed \n  to the registry, rather than relying on manual scans.\n\
      type: \"COMPLIANCE_POLICY\"\ncategories:\n  - \"SECURITY\"\nframeworkMappings:\n\
      \  - \"/frameworks/cloudaware/resource-security/threat-protection\"\n  - \"\
      /frameworks/aws-fsbp-v1.0.0/ecr/01\"\nsimilarPolicies:\n  awsSecurityHub:\n\
      \    - name: \"[ECR.1] ECR private repositories should have image scanning configured\"\
      \n      url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/ecr-controls.html#ecr-1\"\
      \n  internal:\n    - \"dec-x-7f041b04\""
  - path: /ce/ca/aws/ecr/disable-repository-manual-scanning/prod.logic.yaml
    md5Hash: D6E92BE0632454122DAFC21BF7ACC00F
    content: "---\ninputType: \"CA10__CaAwsEcrRepository__c\"\ntestData:\n  - file:\
      \ test-data.json\nimportExtracts:\n  - file: /types/CA10A1__CaAwsEcrRegistry__c/object.extracts.yaml\n\
      conditions:\n  - status: \"UNDETERMINED\"\n    currentStateMessage: \"The Repository's\
      \ registry is not present in the CMDB.\"\n    check:\n      IS_EMPTY_LOOKUP:\
      \ \"CA10A1__registry__r\"\n  - status: \"INCOMPLIANT\"\n    currentStateMessage:\
      \ \"The ECR Registry scanning is configured for manual scans.\"\n    remediationMessage:\
      \ \"Configure the Registry scanning to use Scan On Push or Continuous Scanning.\"\
      \n    check:\n      IS_EQUAL:\n        left:\n          JSON_QUERY_NUMBER:\n\
      \            arg:  \n              EXTRACT: \"CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c\"\
      \n            expression: \"length(rules)\"\n            undeterminedIf:\n \
      \             evaluationError: \"Json query number has filed.\" \n         \
      \     resultTypeMismatch: \"Json query number did not return a number type.\"\
      \ \n        right:\n          NUMBER: 0.0\notherwise:\n  status: \"COMPLIANT\"\
      \n  currentStateMessage: \"The Registry is configured for automated vulnerability\
      \ scanning.\""
  - path: /ce/ca/aws/ecr/disable-repository-manual-scanning/test-data.json
    md5Hash: 82468D6EE2A865CE03544A4CC218CE18
    content: |-
      [
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "99",
                  "conditionText": "isDisappeared(CA10__disappearanceTime__c)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-01T13:35:59Z"
              },
              "Id": "test1",
              "CA10__disappearanceTime__c": "2025-09-29T18:15:00Z",
              "CA10A1__registry__c": "registry1",
              "CA10A1__registryId__c": "040099283057",
              "CA10A1__registry__r": {
                  "Id": "registry1",
                  "CA10A1__disappearanceTime__c": null,
                  "CA10A1__scanningConfigurationRulesJson__c": "{\"scanType\":\"BASIC\",\"rules\":[{\"scanFrequency\":\"CONTINUOUS_SCAN\",\"repositoryFilters\":[{\"filter\":\"*\",\"filterType\":\"WILDCARD\"}]}]}"
              }
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "299",
                  "conditionText": "extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)') == number(0.0)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-01T13:35:59Z"
              },
              "Id": "test2",
              "CA10__disappearanceTime__c": null,
              "CA10A1__registry__c": "registry2",
              "CA10A1__registryId__c": "631005640713",
              "CA10A1__registry__r": {
                  "Id": "registry2",
                  "CA10A1__disappearanceTime__c": null,
                  "CA10A1__scanningConfigurationRulesJson__c": "{\"scanType\":\"BASIC\",\"rules\":[]}"
              }
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "300",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-01T13:35:59Z"
              },
              "Id": "test3",
              "CA10__disappearanceTime__c": null,
              "CA10A1__registry__c": "registry3",
              "CA10A1__registryId__c": "242050238694",
              "CA10A1__registry__r": {
                  "Id": "registry3",
                  "CA10A1__disappearanceTime__c": null,
                  "CA10A1__scanningConfigurationRulesJson__c": "{\"scanType\":\"ENHANCED\",\"rules\":[{\"scanFrequency\":\"CONTINUOUS_SCAN\",\"repositoryFilters\":[{\"filter\":\"*\",\"filterType\":\"WILDCARD\"}]}]}"
              }
          },
          {
              "expectedResult": {
                  "status": "UNDETERMINED",
                  "conditionIndex": "199",
                  "conditionText": "isEmptyLookup('CA10A1__registry__r')",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-01T13:35:59Z"
              },
              "Id": "test5",
              "CA10__disappearanceTime__c": null,
              "CA10A1__registry__c": null,
              "CA10A1__registryId__c": "242050238694",
              "CA10A1__registry__r": {
                  "Id": null,
                  "CA10A1__disappearanceTime__c": null,
                  "CA10A1__scanningConfigurationRulesJson__c": null
              }
          }
      ]
  - path: /types/CA10A1__CaAwsEcrRegistry__c/object.extracts.yaml
    md5Hash: D76BB48E60AE366BA0ECB444FE9C92C6
    content: "---\nextracts:\n# Not nullable.\n  - name: \"CA10A1__scanningConfigurationRulesJson__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10A1__scanningConfigurationRulesJson__c\"\
      \n        undeterminedIf:\n          noAccessDelegate:\n            path: \"\
      CA10A1__scanningConfigurationRulesJson__c\"\n            currentStateMessage:\
      \ \"Unable to determine Scanning Configuration. Possible permission issue with\
      \ ecr:GetRegistryScanningConfiguration\"\n  - name: \"caJsonFrom__scanningConfigurationRulesJson__c\"\
      \n    value:\n      JSON_FROM:\n        arg:\n          EXTRACT: \"CA10A1__scanningConfigurationRulesJson__c\"\
      \n        undeterminedIf:\n          isInvalid: \"The Scanning Configuration\
      \ Rules Json is invalid.\""
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(CA10__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)') == number(0.0)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "300",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "UNDETERMINED",
      "conditionIndex" : "199",
      "conditionText" : "isEmptyLookup('CA10A1__registry__r')",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsEcrRepository__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10A1__registry__c STRING,
      CA10A1__registryId__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "test1",
    "CA10__disappearanceTime__c" : new Date("2025-09-29T18:15:00Z"),
    "CA10A1__registry__c" : "registry1",
    "CA10A1__registryId__c" : "040099283057"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "test2",
    "CA10A1__registry__c" : "registry2",
    "CA10A1__registryId__c" : "631005640713"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "test3",
    "CA10A1__registry__c" : "registry3",
    "CA10A1__registryId__c" : "242050238694"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "test5",
    "CA10A1__registry__c" : null,
    "CA10A1__registryId__c" : "242050238694"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsEcrRegistry__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__scanningConfigurationRulesJson__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "registry1",
    "CA10A1__scanningConfigurationRulesJson__c" : "{\"scanType\":\"BASIC\",\"rules\":[{\"scanFrequency\":\"CONTINUOUS_SCAN\",\"repositoryFilters\":[{\"filter\":\"*\",\"filterType\":\"WILDCARD\"}]}]}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "registry2",
    "CA10A1__scanningConfigurationRulesJson__c" : "{\"scanType\":\"BASIC\",\"rules\":[]}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : "registry3",
    "CA10A1__scanningConfigurationRulesJson__c" : "{\"scanType\":\"ENHANCED\",\"rules\":[{\"scanFrequency\":\"CONTINUOUS_SCAN\",\"repositoryFilters\":[{\"filter\":\"*\",\"filterType\":\"WILDCARD\"}]}]}"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-01T13:35:59Z")
    },
    "Id" : null,
    "CA10A1__scanningConfigurationRulesJson__c" : null
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaAwsEcrRepository__c(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10A1__registry__c STRING,
          CA10A1__registryId__c STRING,
          CA10A1__registry__r STRUCT<
              Id STRING,
              CA10A1__disappearanceTime__c TIMESTAMP,
              CA10A1__scanningConfigurationRulesJson__c STRING
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  OPTIONS (library=['gs://compliance-platform-public/jmespath.min.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));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var BytesLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg;
          };
          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));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      if (TextLib.isEmpty(obj.CA10A1__registryId__c) || TextLib.isEmpty(obj.CA10A1__registry__c) || obj.CA10A1__registry__r.CA10A1__disappearanceTime__c != null) {
          return {status: 'UNDETERMINED', conditionIndex: 199, conditionText: "isEmptyLookup('CA10A1__registry__r')", currentStateMessage: "The Repository's registry is not present in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function jsonQueryChecked2() {
          var input = extractChecked3();
          var out;
          try {
              out = jmespath.search(input, 'length(rules)');
          if (out != null && typeof out != 'number') {
              throw new Error("UNDETERMINED condition:206", {cause: {status: 'UNDETERMINED', conditionIndex: 206, conditionText: "extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)').isResultTypeMismatch()", currentStateMessage: "Json query number did not return a number type.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:207", {cause: {status: 'UNDETERMINED', conditionIndex: 207, conditionText: "extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)').isEvaluationFailed()", currentStateMessage: "Json query number has filed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extractChecked3() {
          if (TextLib.isEmpty(obj.CA10A1__registryId__c)) {
              throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "extractCheck(obj.CA10A1__registryId__c)", currentStateMessage: "Related object via CA10A1__registryId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          if (TextLib.isEmpty(obj.CA10A1__registry__c)) {
              throw new Error("UNDETERMINED condition:202", {cause: {status: 'UNDETERMINED', conditionIndex: 202, conditionText: "extractCheck(obj.CA10A1__registry__c)", currentStateMessage: "Related object via CA10A1__registry__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          if (obj.CA10A1__registry__r.CA10A1__disappearanceTime__c != null) {
              throw new Error("UNDETERMINED condition:203", {cause: {status: 'UNDETERMINED', conditionIndex: 203, conditionText: "extractCheck(obj.CA10A1__registry__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__registry__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return extract4.call(extract4);
      }
      function jsonChecked5() {
          var input = extract7.call(extract7);
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:205", {cause: {status: 'UNDETERMINED', conditionIndex: 205, conditionText: "extract('CA10A1__scanningConfigurationRulesJson__c').asJson().isInvalid()", currentStateMessage: "The Scanning Configuration Rules Json is invalid.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function fieldChecked8() {
          if (BytesLib.isEmpty(obj.CA10A1__registry__r.CA10A1__scanningConfigurationRulesJson__c)) {
              throw new Error("UNDETERMINED condition:204", {cause: {status: 'UNDETERMINED', conditionIndex: 204, conditionText: "CA10A1__scanningConfigurationRulesJson__c.delegatedTo(CA10A1__scanningConfigurationRulesJson__c).isEmpty()", currentStateMessage: "Unable to determine Scanning Configuration. Possible permission issue with ecr:GetRegistryScanningConfiguration", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10A1__registry__r.CA10A1__scanningConfigurationRulesJson__c;
      }
      function extract7() { if (!this.out) { this.out = fieldChecked8(); } return this.out; };
      function extract4() { if (!this.out) { this.out = jsonChecked5(); } return this.out; };
      references1.push('Scanning Configuration Rules JSON [obj.CA10A1__registry__r.CA10A1__scanningConfigurationRulesJson__c]: ' + obj.CA10A1__registry__r.CA10A1__scanningConfigurationRulesJson__c);
      try {
          if (jsonQueryChecked2() == 0.0) {
              return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('CA10A1__registry__r.caJsonFrom__scanningConfigurationRulesJson__c').jsonQueryText('length(rules)') == number(0.0)", currentStateMessage: "The ECR Registry scanning is configured for manual scans.", currentStateReferences: references1.join('\n'), remediation: "Configure the Registry scanning to use Scan On Push or Continuous Scanning.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      return {status: 'COMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "The Registry is configured for automated vulnerability scanning.", 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.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          sObject.CA10A1__registry__c AS CA10A1__registry__c,
          sObject.CA10A1__registryId__c AS CA10A1__registryId__c,
          STRUCT (
              `CA10A1__registry__r`.Id AS Id,
              `CA10A1__registry__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
              `CA10A1__registry__r`.CA10A1__scanningConfigurationRulesJson__c AS CA10A1__scanningConfigurationRulesJson__c
          ) AS CA10A1__registry__r,
          process_CA10__CaAwsEcrRepository__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                  sObject.CA10A1__registry__c AS CA10A1__registry__c,
                  sObject.CA10A1__registryId__c AS CA10A1__registryId__c,
                  STRUCT (
                      `CA10A1__registry__r`.Id AS Id,
                      `CA10A1__registry__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                      `CA10A1__registry__r`.CA10A1__scanningConfigurationRulesJson__c AS CA10A1__scanningConfigurationRulesJson__c
                  ) AS CA10A1__registry__r
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaAwsEcrRepository__c()) AS sObject
      LEFT JOIN UNNEST(mock_CA10A1__CaAwsEcrRegistry__c()) AS `CA10A1__registry__r`
          ON sObject.CA10A1__registry__c = `CA10A1__registry__r`.Id
  ) sObject ON sObject.Id = expectedResult.Id;
