--- policy: /ce/ca/azure/databricks/customer-managed-virtual-network logic: /ce/ca/azure/databricks/customer-managed-virtual-network/prod.logic.yaml executionTime: 2026-02-10T22:33:26.554516219Z generationMs: 53 executionMs: 724 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: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() actual: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() runtimeError: {} - id: '003' match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() actual: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() runtimeError: {} - id: '004' match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() actual: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty() runtimeError: {} - id: '005' match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isNotEmpty() actual: extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isNotEmpty() runtimeError: {} usedFiles: - path: /ce/ca/azure/databricks/customer-managed-virtual-network/policy.yaml md5Hash: 74E59B4178BC06543ED8D7ADE3E294A7 content: "---\nnames:\n full: Azure Databricks Workspace is not deployed in a\ \ customer-managed virtual network (VNet)\n contextual: Workspace is not deployed\ \ in a customer-managed virtual network (VNet)\ndescription: >\n Deploy Azure\ \ Databricks Workspaces using customer-managed Virtual Network \n injection\ \ so that compute clusters and control-plane components reside securely \n \ \ within your organization's network perimeter. The default Databricks-managed\ \ \n VNet offers only limited control over network security policies, firewall\ \ \n configurations and routing.\ntype: COMPLIANCE_POLICY\ncategories:\n -\ \ SECURITY\nframeworkMappings:\n - \"/frameworks/cis-azure-v5.0.0/02/01/01\"\ \n - \"/frameworks/cloudaware/resource-security/threat-protection\"\n" - path: /ce/ca/azure/databricks/customer-managed-virtual-network/prod.logic.yaml md5Hash: F1ABD43E55A689AD829361F5365FEF64 content: | --- inputType: "CA10Z1__CaAzureDatabricksWorkspace__c" testData: - file: "test-data.json" importExtracts: - file: "/types/CA10Z1__CaAzureDatabricksWorkspace__c/object.extracts.yaml" conditions: - status: "INCOMPLIANT" currentStateMessage: "The Databricks workspace is not deployed in a customer-managed virtual network." remediationMessage: "Delete the existing Databricks workspace and deploying a new Azure Databricks workspace in a custom virtual network." check: IS_EMPTY: arg: EXTRACT: "caJsonText__parametersJsonCustomVirtualNetworkValue__c" - status: "COMPLIANT" currentStateMessage: "The Databricks workspace is deployed in a customer-managed virtual network." check: NOT_EMPTY: arg: EXTRACT: "caJsonText__parametersJsonCustomVirtualNetworkValue__c" otherwise: status: "UNDETERMINED" currentStateMessage: "Unexpected value in the field." - path: /ce/ca/azure/databricks/customer-managed-virtual-network/test-data.json md5Hash: 2C838A9C6E91A402ADCED8CF48344C05 content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2025-07-11T04:12:25Z" }, "Id": "001", "CA10Z1__disappearanceTime__c": "2025-07-02T14:15:13Z", "CA10Z1__parametersJson__c": "null" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2025-07-11T04:12:25Z" }, "Id": "002", "CA10Z1__disappearanceTime__c": null, "CA10Z1__parametersJson__c": "null" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2025-07-11T04:12:25Z" }, "Id": "003", "CA10Z1__disappearanceTime__c": null, "CA10Z1__parametersJson__c": "{\"customVirtualNetworkId\":{\"type\":\"STRING\",\"value\":\"\"},\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2025-07-11T04:12:25Z" }, "Id": "004", "CA10Z1__disappearanceTime__c": null, "CA10Z1__parametersJson__c": "{\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}" }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "299", "conditionText": "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isNotEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2025-07-11T04:12:25Z" }, "Id": "005", "CA10Z1__disappearanceTime__c": null, "CA10Z1__parametersJson__c": "{\"customVirtualNetworkId\":{\"type\":\"STRING\",\"value\":\"/subscriptions/8064/resourceGroups/AZ-Network/providers/Microsoft.Network/virtualNetworks/AZ-prd\"},\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}" } ] - 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" 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" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError" : null } }, { "Id" : "003", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError" : null } }, { "Id" : "004", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", "runtimeError" : null } }, { "Id" : "005", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "299", "conditionText" : "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isNotEmpty()", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzureDatabricksWorkspace__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-07-11T04:12:25Z") }, "CA10Z1__disappearanceTime__c" : new Date("2025-07-02T14:15:13Z"), "CA10Z1__parametersJson__c" : "null", "Id" : "001" }, { "context" : { "snapshotTime" : new Date("2025-07-11T04:12:25Z") }, "CA10Z1__parametersJson__c" : "null", "Id" : "002" }, { "context" : { "snapshotTime" : new Date("2025-07-11T04:12:25Z") }, "CA10Z1__parametersJson__c" : "{\"customVirtualNetworkId\":{\"type\":\"STRING\",\"value\":\"\"},\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}", "Id" : "003" }, { "context" : { "snapshotTime" : new Date("2025-07-11T04:12:25Z") }, "CA10Z1__parametersJson__c" : "{\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}", "Id" : "004" }, { "context" : { "snapshotTime" : new Date("2025-07-11T04:12:25Z") }, "CA10Z1__parametersJson__c" : "{\"customVirtualNetworkId\":{\"type\":\"STRING\",\"value\":\"/subscriptions/8064/resourceGroups/AZ-Network/providers/Microsoft.Network/virtualNetworks/AZ-prd\"},\"customPublicSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"customPrivateSubnetName\":{\"type\":\"STRING\",\"value\":\"Consumer-SN\"},\"enableNoPublicIp\":{\"type\":\"BOOL\",\"value\":false}}", "Id" : "005" } ]; """; CREATE TEMP FUNCTION process_CA10Z1__CaAzureDatabricksWorkspace__c( obj STRUCT< CA10Z1__disappearanceTime__c TIMESTAMP, CA10Z1__parametersJson__c STRING, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT 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 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] function jsonQueryChecked4() { var input = extract6.call(extract6); var out; try { out = jmespath.search(input, 'customVirtualNetworkId.value'); if (out != null && typeof out != 'string') { throw new Error("UNDETERMINED condition:102", {cause: {status: 'UNDETERMINED', conditionIndex: 102, conditionText: "extract('caJsonFrom__parametersJson__c').jsonQueryText('customVirtualNetworkId.value').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return a boolean.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } } catch (e) { throw new Error("UNDETERMINED condition:103", {cause: {status: 'UNDETERMINED', conditionIndex: 103, conditionText: "extract('caJsonFrom__parametersJson__c').jsonQueryText('customVirtualNetworkId.value').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}}); } return out; } function jsonChecked7() { var input = extract9.call(extract9); input = TextLib.isEmpty(input) ? null : input; var out; try { out = JSON.parse(input); } catch (e) { throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "extract('CA10Z1__parametersJson__c').asJson().isInvalid()", currentStateMessage: "DatabricsWorkspace parameters JSON is invalid", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}}); } return out; } function extract9() { if (!this.out) { this.out = obj.CA10Z1__parametersJson__c; } return this.out; }; function extract6() { if (!this.out) { this.out = jsonChecked7(); } return this.out; }; function extract3() { if (!this.out) { this.out = jsonQueryChecked4(); } return this.out; }; references1.push('Parameters JSON [obj.CA10Z1__parametersJson__c]: ' + obj.CA10Z1__parametersJson__c); try { if (TextLib.isEmpty(extract3.call(extract3))) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isEmpty()", currentStateMessage: "The Databricks workspace is not deployed in a customer-managed virtual network.", currentStateReferences: references1.join('\n'), remediation: "Delete the existing Databricks workspace and deploying a new Azure Databricks workspace in a custom virtual network.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[2], conditionIndex:[200..299] function jsonQueryChecked13() { var input = extract15.call(extract15); var out; try { out = jmespath.search(input, 'customVirtualNetworkId.value'); if (out != null && typeof out != 'string') { throw new Error("UNDETERMINED condition:202", {cause: {status: 'UNDETERMINED', conditionIndex: 202, conditionText: "extract('caJsonFrom__parametersJson__c').jsonQueryText('customVirtualNetworkId.value').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return a boolean.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } } catch (e) { throw new Error("UNDETERMINED condition:203", {cause: {status: 'UNDETERMINED', conditionIndex: 203, conditionText: "extract('caJsonFrom__parametersJson__c').jsonQueryText('customVirtualNetworkId.value').isEvaluationFailed()", currentStateMessage: "The JSON query has failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}}); } return out; } function jsonChecked16() { var input = extract18.call(extract18); input = TextLib.isEmpty(input) ? null : input; var out; try { out = JSON.parse(input); } catch (e) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "extract('CA10Z1__parametersJson__c').asJson().isInvalid()", currentStateMessage: "DatabricsWorkspace parameters JSON is invalid", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}}); } return out; } function extract18() { if (!this.out) { this.out = obj.CA10Z1__parametersJson__c; } return this.out; }; function extract15() { if (!this.out) { this.out = jsonChecked16(); } return this.out; }; function extract12() { if (!this.out) { this.out = jsonQueryChecked13(); } return this.out; }; try { if (TextLib.isNotEmpty(extract12.call(extract12))) { return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('caJsonText__parametersJsonCustomVirtualNetworkValue__c').isNotEmpty()", currentStateMessage: "The Databricks workspace is deployed in a customer-managed virtual network.", 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: 300, conditionText: "otherwise", currentStateMessage: "Unexpected value in the 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.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__parametersJson__c AS CA10Z1__parametersJson__c, sObject.Id AS Id, process_CA10Z1__CaAzureDatabricksWorkspace__c( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__parametersJson__c AS CA10Z1__parametersJson__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10Z1__CaAzureDatabricksWorkspace__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;