--- policy: /ce/ca/azure/databricks/private-endpoint-connection logic: /ce/ca/azure/databricks/private-endpoint-connection/prod.logic.yaml executionTime: 2026-02-10T22:33:27.775858691Z generationMs: 103 executionMs: 1066 rows: - id: '001' match: true status: expected: DISAPPEARED actual: DISAPPEARED conditionIndex: expected: 99 actual: 99 conditionText: expected: isDisappeared(CA10Z1__disappearanceTime__c) actual: isDisappeared(CA10Z1__disappearanceTime__c) runtimeError: {} - id: '002' match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: CA10Z1__Azure_Private_Endpoint_Connections__r.has(COMPLIANT) actual: CA10Z1__Azure_Private_Endpoint_Connections__r.has(COMPLIANT) runtimeError: {} - id: '003' match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/azure/databricks/private-endpoint-connection/policy.yaml md5Hash: 4FAA0D9E578571C3EA99674AF9CECD80 content: | --- names: full: Azure Databricks Workspace does not use private endpoint connections contextual: Databricks Workspace does not use private endpoint connections description: "Use private endpoints for Azure Databricks workspaces to allow clients and services to\ \ securely access data located over a network via an encrypted Private Link." type: COMPLIANCE_POLICY categories: - SECURITY frameworkMappings: - "/frameworks/cis-azure-v5.0.0/02/01/11" - "/frameworks/cloudaware/resource-security/secure-access" - path: /ce/ca/azure/databricks/private-endpoint-connection/prod.logic.yaml md5Hash: CDD308C9E70A25ABB68378DC9C43942B content: | --- inputType: "CA10Z1__CaAzureDatabricksWorkspace__c" testData: - file: "test-data.json" importExtracts: - file: "/types/CA10Z1__CaAzureDatabricksWorkspace__c/object.extracts.yaml" conditions: - status: "COMPLIANT" currentStateMessage: "The Databricks workspace has an approved private endpoint connection." check: RELATED_LIST_HAS: status: "COMPLIANT" relationshipName: "CA10Z1__Azure_Private_Endpoint_Connections__r" otherwise: status: "INCOMPLIANT" currentStateMessage: "The Databricks workspace does not have an approved private endpoint connection." relatedLists: - relationshipName: "CA10Z1__Azure_Private_Endpoint_Connections__r" recordTypes: - "privateEndpointOnDatabricksWorkspace" importExtracts: - file: "/types/CA10Z1__CaAzurePrivateEndpointConnection__c/object.extracts.yaml" conditions: - status: "COMPLIANT" currentStateMessage: "The private endpoint connection state is Approved." check: IS_EQUAL: left: EXTRACT: "CA10Z1__serviceConnectionStatus__c" right: TEXT: "Approved" otherwise: status: "INCOMPLIANT" currentStateMessage: "The private endpoint connection state is not Approved." - path: /ce/ca/azure/databricks/private-endpoint-connection/test-data.json md5Hash: F1C497E62893BF5A681BF95BB50DBDBB content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2025-11-17T05:18:40Z" }, "CA10Z1__disappearanceTime__c": "2025-11-13T16:22:07Z", "Id": "001", "CA10Z1__Azure_Private_Endpoint_Connections__r": [] }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "199", "conditionText": "CA10Z1__Azure_Private_Endpoint_Connections__r.has(COMPLIANT)", "runtimeError": null }, "context": { "snapshotTime": "2025-11-17T05:18:40Z" }, "CA10Z1__disappearanceTime__c": null, "Id": "002", "CA10Z1__Azure_Private_Endpoint_Connections__r": [ { "CA10Z1__disappearanceTime__c": null, "CA10Z1__serviceConnectionStatus__c": "Approved", "CA10Z1__databricksWorkspace__c": "002", "Id": "ek002", "RecordTypeId": "012Vq000002J7hNIAS", "RecordType": { "DeveloperName": "privateEndpointOnDatabricksWorkspace", "Id": "012Vq000002J7hNIAS" } } ] }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-11-17T05:18:40Z" }, "CA10Z1__disappearanceTime__c": null, "Id": "003", "CA10Z1__Azure_Private_Endpoint_Connections__r": [] } ] - path: /types/CA10Z1__CaAzureDatabricksWorkspace__c/object.extracts.yaml md5Hash: 512495ACDA70E3546508F36E8A6F8AAE content: "---\n# Nullable. The encryption keySource (provider). Possible values\ \ (case-insensitive): Microsoft.Keyvault\nextracts:\n - name: \"CA10Z1__encryptionManagedDisksKeySource__c\"\ \n value: \n FIELD:\n path: \"CA10Z1__encryptionManagedDisksKeySource__c\"\ \n# Text.\n - name: \"CA10Z1__publicNetworkAccess__c\"\n value: \n \ \ FIELD:\n path: \"CA10Z1__publicNetworkAccess__c\"\n - name: \"CA10Z1__parametersJson__c\"\ \n value:\n FIELD:\n path: \"CA10Z1__parametersJson__c\"\n \ \ returnType: BYTES\n - name: \"caJsonFrom__parametersJson__c\"\n value:\n\ \ JSON_FROM:\n arg:\n EXTRACT: \"CA10Z1__parametersJson__c\"\ \n undeterminedIf:\n isInvalid: \"DatabricsWorkspace parameters\ \ JSON is invalid\"\n\n - name: \"caJsonText__parametersJsonCustomVirtualNetworkValue__c\"\ \n value: \n JSON_QUERY_TEXT:\n arg: \n EXTRACT: \"\ caJsonFrom__parametersJson__c\"\n expression: \"customVirtualNetworkId.value\"\ \n undeterminedIf: \n evaluationError: \"The JSON query has\ \ failed.\"\n resultTypeMismatch: \"The JSON query did not return a\ \ boolean.\"\n\n - name: \"caJsonText__parametersJsonEnableNoPublicIpValue__c\"\ \n value: \n JSON_QUERY_BOOLEAN:\n arg: \n EXTRACT:\ \ \"caJsonFrom__parametersJson__c\"\n expression: \"enableNoPublicIp.value\"\ \n undeterminedIf: \n evaluationError: \"The JSON query has\ \ failed.\"\n resultTypeMismatch: \"The JSON query did not return a\ \ boolean.\"\n\n# Nullable. Can't have no access, retrieved via Microsoft.Databricks/workspaces\n\ \ - name: CA10Z1__privateNetworkSubnetId__c\n value: \n FIELD:\n \ \ path: CA10Z1__privateNetworkSubnetId__c \n# Nullable. Can't have no\ \ access, retrieved via Microsoft.Databricks/workspaces \n - name: CA10Z1__publicNetworkSubnetId__c\n\ \ value: \n FIELD:\n path: CA10Z1__publicNetworkSubnetId__c" - path: /types/CA10Z1__CaAzurePrivateEndpointConnection__c/object.extracts.yaml md5Hash: 5CD7A50D4A2794C12C5D70767988C700 content: "---\nextracts:\n# Values: Approved, Reject, Disconnected, Pending. Not\ \ Nullable. Can't have no access, retrieved via Microsoft.DocumentDB/databaseAccounts\n\ \ - name: \"CA10Z1__serviceConnectionStatus__c\"\n value: \n FIELD:\n\ \ path: \"CA10Z1__serviceConnectionStatus__c\"\n undeterminedIf:\n\ \ isEmpty: \"Corrupted data. The Service Connection Status cannot be\ \ empty.\"" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "001", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "002", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "199", "conditionText" : "CA10Z1__Azure_Private_Endpoint_Connections__r.has(COMPLIANT)", "runtimeError" : null } }, { "Id" : "003", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzureDatabricksWorkspace__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-11-17T05:18:40Z") }, "CA10Z1__disappearanceTime__c" : new Date("2025-11-13T16:22:07Z"), "Id" : "001" }, { "context" : { "snapshotTime" : new Date("2025-11-17T05:18:40Z") }, "Id" : "002" }, { "context" : { "snapshotTime" : new Date("2025-11-17T05:18:40Z") }, "Id" : "003" } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzurePrivateEndpointConnection__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-11-17T05:18:40Z") }, "CA10Z1__serviceConnectionStatus__c" : "Approved", "CA10Z1__databricksWorkspace__c" : "002", "Id" : "ek002", "RecordTypeId" : "012Vq000002J7hNIAS" } ]; """; CREATE TEMP FUNCTION mock_RecordType() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-11-17T05:18:40Z") }, "DeveloperName" : "privateEndpointOnDatabricksWorkspace", "Id" : "012Vq000002J7hNIAS" } ]; """; CREATE TEMP FUNCTION process_CA10Z1__CaAzureDatabricksWorkspace__c( obj STRUCT< CA10Z1__disappearanceTime__c TIMESTAMP, Id STRING, CA10Z1__Azure_Private_Endpoint_Connections__r ARRAY, result STRUCT >> >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var references1 = []; // condition[0], conditionIndex:[0..99] references1.push('Deleted From Azure [CA10Z1__disappearanceTime__c]: ' + obj.CA10Z1__disappearanceTime__c); if (obj.CA10Z1__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10Z1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } var count_CA10Z1__Azure_Private_Endpoint_Connections__r_COMPLIANT2 = 0; if (obj.CA10Z1__Azure_Private_Endpoint_Connections__r != null) { for (var i3 = 0; i3 < obj.CA10Z1__Azure_Private_Endpoint_Connections__r.length; i3++) { if (typeof(obj.CA10Z1__Azure_Private_Endpoint_Connections__r[i3].status) !== 'undefined') { if (obj.CA10Z1__Azure_Private_Endpoint_Connections__r[i3].status == 'COMPLIANT') { count_CA10Z1__Azure_Private_Endpoint_Connections__r_COMPLIANT2 += obj.CA10Z1__Azure_Private_Endpoint_Connections__r[i3].count; } } else { if (obj.CA10Z1__Azure_Private_Endpoint_Connections__r[i3].result.status == 'COMPLIANT') { count_CA10Z1__Azure_Private_Endpoint_Connections__r_COMPLIANT2 += 1; } } } } // condition[1], conditionIndex:[100..199] references1.push('Related list [CA10Z1__Azure_Private_Endpoint_Connections__r] ' + (count_CA10Z1__Azure_Private_Endpoint_Connections__r_COMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status'); if (count_CA10Z1__Azure_Private_Endpoint_Connections__r_COMPLIANT2 > 0) { return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "CA10Z1__Azure_Private_Endpoint_Connections__r.has(COMPLIANT)", currentStateMessage: "The Databricks workspace has an approved private endpoint connection.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "The Databricks workspace does not have an approved private endpoint connection.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; """; CREATE TEMP FUNCTION process_CA10Z1__Azure_Private_Endpoint_Connections__r( obj STRUCT< CA10Z1__disappearanceTime__c TIMESTAMP, CA10Z1__serviceConnectionStatus__c STRING, CA10Z1__databricksWorkspace__c STRING, Id STRING, RecordTypeId STRING, RecordType STRUCT< DeveloperName STRING, Id STRING > >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" 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 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 => { let normalized = normalize ? TextLib.normalize(el) : BytesLib.normalize(el); if (!skipEmpty || (normalize ? TextLib.isNotEmpty(el) : BytesLib.isNotEmpty(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.size = function(collection) { return collection == null ? 0 : collection.length; }; this.startsWith = function(collection, search, normalize) { if (collection == null || collection.length === 0) return false; let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search); return collection[0] === normalizedSearch; }; this.endsWith = function(collection, search, normalize) { if (collection == null || collection.length === 0) return false; let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search); return collection[collection.length - 1] === normalizedSearch; }; this.contains = function(collection, search, normalize) { if (collection == null || collection.length === 0) return false; return collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)); }; this.containsAll = function(collection, searchArray, normalize) { if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false; return searchArray.every(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search))); }; this.containsAny = function(collection, searchArray, normalize) { if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false; return searchArray.some(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search))); }; }(); 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 Azure [CA10Z1__disappearanceTime__c]: ' + obj.CA10Z1__disappearanceTime__c); if (obj.CA10Z1__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10Z1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[1], conditionIndex:[100..199] references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName); if (!CollectionLib.contains(CollectionLib.fromArray(['privateEndpointOnDatabricksWorkspace'], true, true, true, true), obj.RecordType.DeveloperName, true)) { return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(setOfText(['privateEndpointOnDatabricksWorkspace']).contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[2], conditionIndex:[200..299] function fieldChecked5() { if (TextLib.isEmpty(obj.CA10Z1__serviceConnectionStatus__c)) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10Z1__serviceConnectionStatus__c.isEmpty()", currentStateMessage: "Corrupted data. The Service Connection Status cannot be empty.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10Z1__serviceConnectionStatus__c; } function extract4() { if (!this.out) { this.out = fieldChecked5(); } return this.out; }; references1.push('Service Connection: Status [obj.CA10Z1__serviceConnectionStatus__c]: ' + obj.CA10Z1__serviceConnectionStatus__c); try { if (TextLib.equal(extract4.call(extract4), 'Approved')) { return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('CA10Z1__serviceConnectionStatus__c') == 'Approved'", currentStateMessage: "The private endpoint connection state is Approved.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "The private endpoint connection state is not Approved.", 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.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.Id AS Id, `CA10Z1__Azure_Private_Endpoint_Connections__r`.arr AS CA10Z1__Azure_Private_Endpoint_Connections__r, process_CA10Z1__CaAzureDatabricksWorkspace__c( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.Id AS Id, `CA10Z1__Azure_Private_Endpoint_Connections__r`.arr AS CA10Z1__Azure_Private_Endpoint_Connections__r ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10Z1__CaAzureDatabricksWorkspace__c()) AS sObject LEFT JOIN ( SELECT sObject.CA10Z1__databricksWorkspace__c, ARRAY_AGG( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__serviceConnectionStatus__c AS CA10Z1__serviceConnectionStatus__c, sObject.CA10Z1__databricksWorkspace__c AS CA10Z1__databricksWorkspace__c, sObject.Id AS Id, sObject.RecordTypeId AS RecordTypeId, STRUCT ( `RecordType`.DeveloperName AS DeveloperName, `RecordType`.Id AS Id ) AS RecordType, process_CA10Z1__Azure_Private_Endpoint_Connections__r( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__serviceConnectionStatus__c AS CA10Z1__serviceConnectionStatus__c, sObject.CA10Z1__databricksWorkspace__c AS CA10Z1__databricksWorkspace__c, sObject.Id AS Id, sObject.RecordTypeId AS RecordTypeId, STRUCT ( `RecordType`.DeveloperName AS DeveloperName, `RecordType`.Id AS Id ) AS RecordType ), sObject.context.snapshotTime ) as result ) ) AS arr FROM UNNEST(mock_CA10Z1__CaAzurePrivateEndpointConnection__c()) AS sObject LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType` ON sObject.RecordTypeId = `RecordType`.Id GROUP BY sObject.CA10Z1__databricksWorkspace__c ) AS `CA10Z1__Azure_Private_Endpoint_Connections__r` ON sObject.Id = `CA10Z1__Azure_Private_Endpoint_Connections__r`.CA10Z1__databricksWorkspace__c ) sObject ON sObject.Id = expectedResult.Id;