--- policy: /ce/ca/oracle/bucket/bucket-public-access logic: /ce/ca/oracle/bucket/bucket-public-access/prod.logic.yaml executionTime: 2026-05-02T12:07:19.097501296Z generationMs: 65 executionMs: 1535 rows: - id: test1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10O1__publicAccessType__c') == 'NoPublicAccess' actual: extract('CA10O1__publicAccessType__c') == 'NoPublicAccess' runtimeError: {} - id: test2 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10O1__publicAccessType__c') == 'ObjectRead' actual: extract('CA10O1__publicAccessType__c') == 'ObjectRead' runtimeError: {} - id: test3 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('CA10O1__publicAccessType__c') == 'ObjectReadWithoutList' actual: extract('CA10O1__publicAccessType__c') == 'ObjectReadWithoutList' runtimeError: {} - id: test4 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 101 actual: 101 conditionText: expected: CA10O1__publicAccessType__c.isEmpty() actual: CA10O1__publicAccessType__c.isEmpty() runtimeError: {} - id: test5 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 400 actual: 400 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/oracle/bucket/bucket-public-access/policy.yaml md5Hash: 6A65B4CD44ED0D4F36815A37E7CBC0F2 content: "---\nnames:\n full: \"Oracle Storage Bucket allows public access\"\n\ \ contextual: \"Storage Bucket allows public access\"\ndescription: >\n Ensure\ \ that Oracle Storage Buckets do not allow public access. Public buckets \n\ \ can expose stored objects to anonymous users without requiring Oracle Cloud\ \ authentication.\ntype: \"COMPLIANCE_POLICY\"\ncategories:\n - \"SECURITY\"\ \nframeworkMappings:\n - \"/frameworks/cis-oracle-v3.1.0/05/01/01\"\n - \"\ /frameworks/cloudaware/resource-security/public-data-access\"\nsimilarPolicies:\n\ \ internal:\n - \"dec-x-87b8e6c7\"\n" - path: /ce/ca/oracle/bucket/bucket-public-access/prod.logic.yaml md5Hash: 4D0030D54F4A8B0A2846267384F8F641 content: | --- inputType: "CA10O1__CaOracleStorageBucket__c" testData: - file: "test-data.json" importExtracts: - file: "/types/CA10O1__CaOracleStorageBucket__c/object.extracts.yaml" conditions: - status: "INCOMPLIANT" currentStateMessage: "The bucket allows public object read access and object listing." remediationMessage: "Set the bucket Public Access Type to NoPublicAccess." check: IS_EQUAL: left: EXTRACT: "CA10O1__publicAccessType__c" right: TEXT: "ObjectRead" - status: "INCOMPLIANT" currentStateMessage: "The bucket allows public object read access." remediationMessage: "Set the bucket Public Access Type to NoPublicAccess." check: IS_EQUAL: left: EXTRACT: "CA10O1__publicAccessType__c" right: TEXT: "ObjectReadWithoutList" - status: "COMPLIANT" currentStateMessage: "The bucket does not allow public access." check: IS_EQUAL: left: EXTRACT: "CA10O1__publicAccessType__c" right: TEXT: "NoPublicAccess" otherwise: status: "UNDETERMINED" currentStateMessage: "Unexpected value in the bucket Public Access Type field." - path: /ce/ca/oracle/bucket/bucket-public-access/test-data.json md5Hash: 3927961D7B452F976A85CFF3D0B20F9B content: | [ { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "399", "conditionText": "extract('CA10O1__publicAccessType__c') == 'NoPublicAccess'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test1", "CA10O1__disappearanceTime__c": null, "CA10O1__publicAccessType__c": "NoPublicAccess" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10O1__publicAccessType__c') == 'ObjectRead'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test2", "CA10O1__disappearanceTime__c": null, "CA10O1__publicAccessType__c": "ObjectRead" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "299", "conditionText": "extract('CA10O1__publicAccessType__c') == 'ObjectReadWithoutList'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test3", "CA10O1__disappearanceTime__c": null, "CA10O1__publicAccessType__c": "ObjectReadWithoutList" }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "101", "conditionText": "CA10O1__publicAccessType__c.isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test4", "CA10O1__disappearanceTime__c": null, "CA10O1__publicAccessType__c": null }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "400", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test5", "CA10O1__disappearanceTime__c": null, "CA10O1__publicAccessType__c": "UnexpectedPublicAccessType" } ] - path: /types/CA10O1__CaOracleStorageBucket__c/object.extracts.yaml md5Hash: 4A2A185CC5E21E043DA4F3BC71A4FDDA content: | --- extracts: - name: "CA10O1__publicAccessType__c" value: FIELD: path: "CA10O1__publicAccessType__c" undeterminedIf: isEmpty: "The bucket Public Access Type is empty." - name: "CA10O1__versioning__c" value: FIELD: path: "CA10O1__versioning__c" undeterminedIf: isEmpty: "The bucket Versioning field is empty." - name: "CA10O1__kmsKeyOcid__c" value: FIELD: path: "CA10O1__kmsKeyOcid__c" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "399", "conditionText" : "extract('CA10O1__publicAccessType__c') == 'NoPublicAccess'", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10O1__publicAccessType__c') == 'ObjectRead'", "runtimeError" : null } }, { "Id" : "test3", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "299", "conditionText" : "extract('CA10O1__publicAccessType__c') == 'ObjectReadWithoutList'", "runtimeError" : null } }, { "Id" : "test4", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "101", "conditionText" : "CA10O1__publicAccessType__c.isEmpty()", "runtimeError" : null } }, { "Id" : "test5", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "400", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10O1__CaOracleStorageBucket__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__publicAccessType__c" : "NoPublicAccess", "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__publicAccessType__c" : "ObjectRead", "Id" : "test2" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__publicAccessType__c" : "ObjectReadWithoutList", "Id" : "test3" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__publicAccessType__c" : null, "Id" : "test4" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__publicAccessType__c" : "UnexpectedPublicAccessType", "Id" : "test5" } ]; """; CREATE TEMP FUNCTION process_CA10O1__CaOracleStorageBucket__c( obj STRUCT< CA10O1__disappearanceTime__c TIMESTAMP, CA10O1__publicAccessType__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] references1.push('Deleted From Oracle [CA10O1__disappearanceTime__c]: ' + obj.CA10O1__disappearanceTime__c); if (obj.CA10O1__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10O1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[1], conditionIndex:[100..199] function fieldChecked4() { if (TextLib.isEmpty(obj.CA10O1__publicAccessType__c)) { throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10O1__publicAccessType__c.isEmpty()", currentStateMessage: "The bucket Public Access Type is empty.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10O1__publicAccessType__c; } function extract3() { if (!this.out) { this.out = fieldChecked4(); } return this.out; }; references1.push('Public Access Type [obj.CA10O1__publicAccessType__c]: ' + obj.CA10O1__publicAccessType__c); try { if (TextLib.equal(extract3.call(extract3), 'ObjectRead')) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10O1__publicAccessType__c') == 'ObjectRead'", currentStateMessage: "The bucket allows public object read access and object listing.", currentStateReferences: references1.join('\n'), remediation: "Set the bucket Public Access Type to NoPublicAccess.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[2], conditionIndex:[200..299] function fieldChecked7() { if (TextLib.isEmpty(obj.CA10O1__publicAccessType__c)) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10O1__publicAccessType__c.isEmpty()", currentStateMessage: "The bucket Public Access Type is empty.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10O1__publicAccessType__c; } function extract6() { if (!this.out) { this.out = fieldChecked7(); } return this.out; }; try { if (TextLib.equal(extract6.call(extract6), 'ObjectReadWithoutList')) { return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('CA10O1__publicAccessType__c') == 'ObjectReadWithoutList'", currentStateMessage: "The bucket allows public object read access.", currentStateReferences: references1.join('\n'), remediation: "Set the bucket Public Access Type to NoPublicAccess.", 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.CA10O1__publicAccessType__c)) { throw new Error("UNDETERMINED condition:301", {cause: {status: 'UNDETERMINED', conditionIndex: 301, conditionText: "CA10O1__publicAccessType__c.isEmpty()", currentStateMessage: "The bucket Public Access Type is empty.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10O1__publicAccessType__c; } function extract9() { if (!this.out) { this.out = fieldChecked10(); } return this.out; }; try { if (TextLib.equal(extract9.call(extract9), 'NoPublicAccess')) { return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "extract('CA10O1__publicAccessType__c') == 'NoPublicAccess'", currentStateMessage: "The bucket does not allow public access.", 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: 400, conditionText: "otherwise", currentStateMessage: "Unexpected value in the bucket Public Access Type field.", 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.CA10O1__disappearanceTime__c AS CA10O1__disappearanceTime__c, sObject.CA10O1__publicAccessType__c AS CA10O1__publicAccessType__c, sObject.Id AS Id, process_CA10O1__CaOracleStorageBucket__c( STRUCT( sObject.CA10O1__disappearanceTime__c AS CA10O1__disappearanceTime__c, sObject.CA10O1__publicAccessType__c AS CA10O1__publicAccessType__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10O1__CaOracleStorageBucket__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;