--- policy: /ce/ca/aws/account/ebs-volume-encryption-attribute-in-all-regions logic: /ce/ca/aws/account/ebs-volume-encryption-attribute-in-all-regions/prod.logic.yaml executionTime: 2026-06-06T12:02:25.071750794Z generationMs: 109 executionMs: 1206 rows: - id: a01 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: CA10__AWS_Account_Regions__r.has(INCOMPLIANT) actual: CA10__AWS_Account_Regions__r.has(INCOMPLIANT) runtimeError: {} - id: a02 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 299 actual: 299 conditionText: expected: CA10__AWS_Account_Regions__r.has(UNDETERMINED) actual: CA10__AWS_Account_Regions__r.has(UNDETERMINED) runtimeError: {} - id: a03 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: CA10__AWS_Account_Regions__r.has(COMPLIANT) actual: CA10__AWS_Account_Regions__r.has(COMPLIANT) runtimeError: {} - id: a04 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 400 actual: 400 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: a05 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 299 actual: 299 conditionText: expected: CA10__AWS_Account_Regions__r.has(UNDETERMINED) actual: CA10__AWS_Account_Regions__r.has(UNDETERMINED) runtimeError: {} usedFiles: - path: /ce/ca/aws/account/ebs-volume-encryption-attribute-in-all-regions/policy.yaml md5Hash: 766A2EDA424843BF1E46B24079FDA77E content: | --- names: full: AWS Account EBS Volume Encryption Attribute is not enabled in all regions contextual: EBS Volume Encryption Attribute is not enabled in all regions description: "EBS encryption by default encrypts newly\ \ created EBS volumes automatically and should be enabled in every active AWS Region." type: COMPLIANCE_POLICY categories: - SECURITY frameworkMappings: - "/frameworks/cis-aws-v7.0.0/06/01/01" - "/frameworks/cloudaware/resource-security/data-encryption" - "/frameworks/aws-fsbp-v1.0.0/ec2/07" - "/frameworks/aws-well-architected/sec/08/03" - "/frameworks/aws-well-architected/sec/08/02" similarPolicies: internal: - dec-x-0bdcd276 cloudConformity: - url: https://www.trendmicro.com/cloudoneconformity-staging/knowledge-base/aws/EBS/configure-default-encryption.html name: Enable Encryption by Default for EBS Volumes - path: /ce/ca/aws/account/ebs-volume-encryption-attribute-in-all-regions/prod.logic.yaml md5Hash: 9697E07FE7793990A7AAEC74ED4E8961 content: | --- inputType: "CA10__CaAwsAccount__c" testData: - file: test-data.json importExtracts: - file: /types/CA10__CaAwsAccount__c/object.extracts.yaml conditions: - status: "INCOMPLIANT" currentStateMessage: "Default EBS volume encryption is disabled in at least one active region." remediationMessage: "Enable default EBS volume encryption in every active region." check: RELATED_LIST_HAS: status: "INCOMPLIANT" relationshipName: "CA10__AWS_Account_Regions__r" - status: "UNDETERMINED" currentStateMessage: "Unable to determine the default EBS encryption status for at least one active region." check: RELATED_LIST_HAS: status: "UNDETERMINED" relationshipName: "CA10__AWS_Account_Regions__r" - status: "COMPLIANT" currentStateMessage: "Default EBS volume encryption is enabled in all active regions." check: RELATED_LIST_HAS: status: "COMPLIANT" relationshipName: "CA10__AWS_Account_Regions__r" otherwise: status: "UNDETERMINED" currentStateMessage: "No active AWS regions were found, or region data could not be collected." relatedLists: - relationshipName: "CA10__AWS_Account_Regions__r" importExtracts: - file: "/types/CA10__CaAwsAccountRegion__c/object.extracts.yaml" conditions: - status: "INAPPLICABLE" currentStateMessage: "This AWS account region is not active." check: IS_EQUAL: left: EXTRACT: "CA10__status__c" right: TEXT: "not-opted-in" - status: "UNDETERMINED" currentStateMessage: "Unable to determine the default EBS encryption status." check: IS_EMPTY: arg: EXTRACT: "CA10__ebsStorageEncryption__c" - status: "INCOMPLIANT" currentStateMessage: "Default EBS volume encryption is disabled for this region." check: IS_EQUAL: left: EXTRACT: "CA10__ebsStorageEncryption__c" right: TEXT: "Disabled" - status: "COMPLIANT" currentStateMessage: "Default EBS volume encryption is enabled for this region." check: IS_EQUAL: left: EXTRACT: "CA10__ebsStorageEncryption__c" right: TEXT: "Enabled" otherwise: status: "UNDETERMINED" currentStateMessage: "Unable to determine the default EBS encryption status for this active region." - path: /ce/ca/aws/account/ebs-volume-encryption-attribute-in-all-regions/test-data.json md5Hash: 195B9F11EA2CCAE1DB6277478B9B183A content: | [ { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "CA10__AWS_Account_Regions__r.has(INCOMPLIANT)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a01", "CA10__AWS_Account_Regions__r": [ { "Id": "aD1", "CA10__status__c": "not-opted-in", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a01" }, { "Id": "aD2", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Enabled", "CA10__account__c": "a01" }, { "Id": "aD3", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Disabled", "CA10__account__c": "a01" } ] }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "299", "conditionText": "CA10__AWS_Account_Regions__r.has(UNDETERMINED)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a02", "CA10__AWS_Account_Regions__r": [ { "Id": "aD12", "CA10__status__c": "not-opted-in", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a02" }, { "Id": "aD22", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a02" }, { "Id": "aD32", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Enabled", "CA10__account__c": "a02" } ] }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "399", "conditionText": "CA10__AWS_Account_Regions__r.has(COMPLIANT)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a03", "CA10__AWS_Account_Regions__r": [ { "Id": "aD13", "CA10__status__c": "not-opted-in", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a03" }, { "Id": "aD23", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Enabled", "CA10__account__c": "a03" }, { "Id": "aD33", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Enabled", "CA10__account__c": "a03" } ] }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "400", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a04", "CA10__AWS_Account_Regions__r": [ { "Id": "aD14", "CA10__status__c": "not-opted-in", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a04" } ] }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "299", "conditionText": "CA10__AWS_Account_Regions__r.has(UNDETERMINED)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a05", "CA10__AWS_Account_Regions__r": [ { "Id": "aD15", "CA10__status__c": "not-opted-in", "CA10__ebsStorageEncryption__c": "", "CA10__account__c": "a05" }, { "Id": "aD25", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Unknown", "CA10__account__c": "a05" }, { "Id": "aD35", "CA10__status__c": "opt-in-not-required", "CA10__ebsStorageEncryption__c": "Enabled", "CA10__account__c": "a05" } ] } ] - path: /types/CA10__CaAwsAccount__c/object.extracts.yaml md5Hash: 926999C100E8C1066EC8BD4B82B0F362 content: "---\nextracts:\n - name: CA10__accountId__c\n value: \n FIELD:\n\ \ path: CA10__accountId__c\n undeterminedIf:\n isEmpty:\ \ \"Account ID can not be empty. Possibly corrupted data.\"\n# Not nullable\n\ \ - name: \"CA10__shieldAdvancedState__c\"\n value: \n FIELD:\n \ \ path: \"CA10__shieldAdvancedState__c\"\n undeterminedIf:\n \ \ noAccessDelegate:\n path: \"CA10__shieldAdvancedState__c\"\ \n currentStateMessage: \"Shield Advanced subscription state cannot\ \ be empty. Possible permission issue with shield:GetSubscriptionState\"\n#\ \ Not nullable\n - name: \"CA10__shieldAdvancedSrtSupportConfigured__c\"\n\ \ value: \n FIELD:\n path: \"CA10__shieldAdvancedSrtSupportConfigured__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__shieldAdvancedSrtSupportConfigured__c\"\n currentStateMessage:\ \ \"Shield Advanced SRT Access state cannot be empty. Possible permission issue\ \ with shield:DescribeDRTAccess\"\n# Not nullable\n - name: \"CA10__status__c\"\ \n value: \n FIELD:\n path: \"CA10__status__c\"\n - name: \"\ CA10__inspectorStatus__c\"\n value: \n FIELD:\n path: \"CA10__inspectorStatus__c\"\ \n - name: \"CA10__inspectorEc2Status__c\"\n value: \n FIELD:\n \ \ path: \"CA10__inspectorEc2Status__c\"\n - name: \"CA10__inspectorEcrStatus__c\"\ \n value: \n FIELD:\n path: \"CA10__inspectorEcrStatus__c\"\n\ \ - name: \"CA10__inspectorLambdaCodeStatus__c\"\n value: \n FIELD:\n\ \ path: \"CA10__inspectorLambdaCodeStatus__c\"\n - name: \"CA10__inspectorLambdaStatus__c\"\ \n value: \n FIELD:\n path: \"CA10__inspectorLambdaStatus__c\"\ \n" - path: /types/CA10__CaAwsAccountRegion__c/object.extracts.yaml md5Hash: B5D54D4844B8E77238E14E730ABEE3C4 content: "---\nextracts:\n - name: CA10__status__c\n value: \n FIELD:\n\ \ path: CA10__status__c\n undeterminedIf:\n isEmpty:\ \ \"Account Region status must be specified \"\n - name: CA10__ebsStorageEncryption__c\n\ \ value: \n FIELD:\n path: CA10__ebsStorageEncryption__c\n \ \ undeterminedIf:\n isEmpty: \"EBS Storage Encryption can not\ \ be empty. Possibly corrupted data.\"" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "a01", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "CA10__AWS_Account_Regions__r.has(INCOMPLIANT)", "runtimeError" : null } }, { "Id" : "a02", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "299", "conditionText" : "CA10__AWS_Account_Regions__r.has(UNDETERMINED)", "runtimeError" : null } }, { "Id" : "a03", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "399", "conditionText" : "CA10__AWS_Account_Regions__r.has(COMPLIANT)", "runtimeError" : null } }, { "Id" : "a04", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "400", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "a05", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "299", "conditionText" : "CA10__AWS_Account_Regions__r.has(UNDETERMINED)", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsAccountRegion__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "not-opted-in", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a01", "Id" : "aD1" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Enabled", "CA10__account__c" : "a01", "Id" : "aD2" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Disabled", "CA10__account__c" : "a01", "Id" : "aD3" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "not-opted-in", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a02", "Id" : "aD12" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a02", "Id" : "aD22" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Enabled", "CA10__account__c" : "a02", "Id" : "aD32" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "not-opted-in", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a03", "Id" : "aD13" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Enabled", "CA10__account__c" : "a03", "Id" : "aD23" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Enabled", "CA10__account__c" : "a03", "Id" : "aD33" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "not-opted-in", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a04", "Id" : "aD14" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "not-opted-in", "CA10__ebsStorageEncryption__c" : "", "CA10__account__c" : "a05", "Id" : "aD15" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Unknown", "CA10__account__c" : "a05", "Id" : "aD25" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__status__c" : "opt-in-not-required", "CA10__ebsStorageEncryption__c" : "Enabled", "CA10__account__c" : "a05", "Id" : "aD35" } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsAccount__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "Id" : "a01" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "Id" : "a02" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "Id" : "a03" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "Id" : "a04" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "Id" : "a05" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAwsAccount__c( obj STRUCT< CA10__AWS_Account_Regions__r ARRAY >>, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var references1 = []; // condition[0], conditionIndex:[0..99] if (false) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared()", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } var count_CA10__AWS_Account_Regions__r_INCOMPLIANT2 = 0; if (obj.CA10__AWS_Account_Regions__r != null) { for (var i3 = 0; i3 < obj.CA10__AWS_Account_Regions__r.length; i3++) { if (typeof(obj.CA10__AWS_Account_Regions__r[i3].status) !== 'undefined') { if (obj.CA10__AWS_Account_Regions__r[i3].status == 'INCOMPLIANT') { count_CA10__AWS_Account_Regions__r_INCOMPLIANT2 += obj.CA10__AWS_Account_Regions__r[i3].count; } } else { if (obj.CA10__AWS_Account_Regions__r[i3].result.status == 'INCOMPLIANT') { count_CA10__AWS_Account_Regions__r_INCOMPLIANT2 += 1; } } } } // condition[1], conditionIndex:[100..199] references1.push('Related list [CA10__AWS_Account_Regions__r] ' + (count_CA10__AWS_Account_Regions__r_INCOMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in INCOMPLIANT status'); if (count_CA10__AWS_Account_Regions__r_INCOMPLIANT2 > 0) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "CA10__AWS_Account_Regions__r.has(INCOMPLIANT)", currentStateMessage: "Default EBS volume encryption is disabled in at least one active region.", currentStateReferences: references1.join('\n'), remediation: "Enable default EBS volume encryption in every active region.", runtimeError: null}; } var count_CA10__AWS_Account_Regions__r_UNDETERMINED4 = 0; if (obj.CA10__AWS_Account_Regions__r != null) { for (var i5 = 0; i5 < obj.CA10__AWS_Account_Regions__r.length; i5++) { if (typeof(obj.CA10__AWS_Account_Regions__r[i5].status) !== 'undefined') { if (obj.CA10__AWS_Account_Regions__r[i5].status == 'UNDETERMINED') { count_CA10__AWS_Account_Regions__r_UNDETERMINED4 += obj.CA10__AWS_Account_Regions__r[i5].count; } } else { if (obj.CA10__AWS_Account_Regions__r[i5].result.status == 'UNDETERMINED') { count_CA10__AWS_Account_Regions__r_UNDETERMINED4 += 1; } } } } // condition[2], conditionIndex:[200..299] if (count_CA10__AWS_Account_Regions__r_UNDETERMINED4 > 0) { return {status: 'UNDETERMINED', conditionIndex: 299, conditionText: "CA10__AWS_Account_Regions__r.has(UNDETERMINED)", currentStateMessage: "Unable to determine the default EBS encryption status for at least one active region.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } var count_CA10__AWS_Account_Regions__r_COMPLIANT6 = 0; if (obj.CA10__AWS_Account_Regions__r != null) { for (var i7 = 0; i7 < obj.CA10__AWS_Account_Regions__r.length; i7++) { if (typeof(obj.CA10__AWS_Account_Regions__r[i7].status) !== 'undefined') { if (obj.CA10__AWS_Account_Regions__r[i7].status == 'COMPLIANT') { count_CA10__AWS_Account_Regions__r_COMPLIANT6 += obj.CA10__AWS_Account_Regions__r[i7].count; } } else { if (obj.CA10__AWS_Account_Regions__r[i7].result.status == 'COMPLIANT') { count_CA10__AWS_Account_Regions__r_COMPLIANT6 += 1; } } } } // condition[3], conditionIndex:[300..399] if (count_CA10__AWS_Account_Regions__r_COMPLIANT6 > 0) { return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "CA10__AWS_Account_Regions__r.has(COMPLIANT)", currentStateMessage: "Default EBS volume encryption is enabled in all active regions.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'UNDETERMINED', conditionIndex: 400, conditionText: "otherwise", currentStateMessage: "No active AWS regions were found, or region data could not be collected.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; """; CREATE TEMP FUNCTION process_CA10__AWS_Account_Regions__r( obj STRUCT< CA10__status__c STRING, CA10__ebsStorageEncryption__c STRING, CA10__account__c STRING, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT 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)); }; 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] if (false) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared()", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[1], conditionIndex:[100..199] function extract3() { if (!this.out) { this.out = obj.CA10__status__c; } return this.out; }; references1.push('Status [obj.CA10__status__c]: ' + obj.CA10__status__c); if (TextLib.equal(extract3.call(extract3), 'not-opted-in')) { return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "extract('CA10__status__c') == 'not-opted-in'", currentStateMessage: "This AWS account region is not active.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[2], conditionIndex:[200..299] function fieldChecked7() { if (TextLib.isEmpty(obj.CA10__ebsStorageEncryption__c)) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10__ebsStorageEncryption__c.isEmpty()", currentStateMessage: "EBS Storage Encryption can not be empty. Possibly corrupted data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10__ebsStorageEncryption__c; } function extract6() { if (!this.out) { this.out = fieldChecked7(); } return this.out; }; references1.push('EBS Storage Encryption [obj.CA10__ebsStorageEncryption__c]: ' + obj.CA10__ebsStorageEncryption__c); try { if (TextLib.isEmpty(extract6.call(extract6))) { return {status: 'UNDETERMINED', conditionIndex: 299, conditionText: "extract('CA10__ebsStorageEncryption__c').isEmpty()", currentStateMessage: "Unable to determine the default EBS encryption status.", 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 fieldChecked10() { if (TextLib.isEmpty(obj.CA10__ebsStorageEncryption__c)) { throw new Error("UNDETERMINED condition:301", {cause: {status: 'UNDETERMINED', conditionIndex: 301, conditionText: "CA10__ebsStorageEncryption__c.isEmpty()", currentStateMessage: "EBS Storage Encryption can not be empty. Possibly corrupted data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10__ebsStorageEncryption__c; } function extract9() { if (!this.out) { this.out = fieldChecked10(); } return this.out; }; try { if (TextLib.equal(extract9.call(extract9), 'Disabled')) { return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('CA10__ebsStorageEncryption__c') == 'Disabled'", currentStateMessage: "Default EBS volume encryption is disabled for this region.", 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 fieldChecked13() { if (TextLib.isEmpty(obj.CA10__ebsStorageEncryption__c)) { throw new Error("UNDETERMINED condition:401", {cause: {status: 'UNDETERMINED', conditionIndex: 401, conditionText: "CA10__ebsStorageEncryption__c.isEmpty()", currentStateMessage: "EBS Storage Encryption can not be empty. Possibly corrupted data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10__ebsStorageEncryption__c; } function extract12() { if (!this.out) { this.out = fieldChecked13(); } return this.out; }; try { if (TextLib.equal(extract12.call(extract12), 'Enabled')) { return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "extract('CA10__ebsStorageEncryption__c') == 'Enabled'", currentStateMessage: "Default EBS volume encryption is enabled for this region.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } return {status: 'UNDETERMINED', conditionIndex: 500, conditionText: "otherwise", currentStateMessage: "Unable to determine the default EBS encryption status for this active region.", 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 `CA10__AWS_Account_Regions__r`.arr AS CA10__AWS_Account_Regions__r, sObject.Id AS Id, process_CA10__CaAwsAccount__c( STRUCT( `CA10__AWS_Account_Regions__r`.arr AS CA10__AWS_Account_Regions__r, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAwsAccount__c()) AS sObject LEFT JOIN ( SELECT sObject.CA10__account__c, ARRAY_AGG( STRUCT( sObject.CA10__status__c AS CA10__status__c, sObject.CA10__ebsStorageEncryption__c AS CA10__ebsStorageEncryption__c, sObject.CA10__account__c AS CA10__account__c, sObject.Id AS Id, process_CA10__AWS_Account_Regions__r( STRUCT( sObject.CA10__status__c AS CA10__status__c, sObject.CA10__ebsStorageEncryption__c AS CA10__ebsStorageEncryption__c, sObject.CA10__account__c AS CA10__account__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result ) ) AS arr FROM UNNEST(mock_CA10__CaAwsAccountRegion__c()) AS sObject GROUP BY sObject.CA10__account__c ) AS `CA10__AWS_Account_Regions__r` ON sObject.Id = `CA10__AWS_Account_Regions__r`.CA10__account__c ) sObject ON sObject.Id = expectedResult.Id;