--- policy: /ce/ca/azure/bastion/shareable-link logic: /ce/ca/azure/bastion/shareable-link/prod.logic.yaml executionTime: 2026-11-14T12:03:21.418999126Z generationMs: 37 executionMs: 813 rows: - id: bastion-0 match: true status: expected: INAPPLICABLE actual: INAPPLICABLE conditionIndex: expected: 199 actual: 199 conditionText: expected: "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" actual: "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" runtimeError: {} - id: bastion-1 match: true status: expected: INAPPLICABLE actual: INAPPLICABLE conditionIndex: expected: 199 actual: 199 conditionText: expected: "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" actual: "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" runtimeError: {} - id: bastion-2 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10Z1__shareableLinkState__c') == 'Enabled' actual: extract('CA10Z1__shareableLinkState__c') == 'Enabled' runtimeError: {} - id: bastion-3 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 499 actual: 499 conditionText: expected: extract('CA10Z1__shareableLinkState__c') == 'Disabled' actual: extract('CA10Z1__shareableLinkState__c') == 'Disabled' runtimeError: {} - id: bastion-4 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 500 actual: 500 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: bastion-5 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 299 actual: 299 conditionText: expected: "not(setOfText(['Standard', 'Premium']).contains(extract('CA10Z1__skuName__c')))" actual: "not(setOfText(['Standard', 'Premium']).contains(extract('CA10Z1__skuName__c')))" runtimeError: {} - id: bastion-6 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 101 actual: 101 conditionText: expected: CA10Z1__skuName__c.isEmpty() actual: CA10Z1__skuName__c.isEmpty() runtimeError: {} usedFiles: - path: /ce/ca/azure/bastion/shareable-link/policy.yaml md5Hash: 7987395BBAD66DEE1E96A13D4FE5065E content: | --- names: full: Azure Bastion Host shareable links are enabled contextual: Bastion Host shareable links are enabled description: Ensure 'Shareable Link' is Disabled on Azure Bastion Hosts. type: COMPLIANCE_POLICY categories: - SECURITY frameworkMappings: - /frameworks/cloudaware/resource-security/secure-access - /frameworks/cis-azure-v7.0.0/08/04/02 - path: /ce/ca/azure/bastion/shareable-link/prod.logic.yaml md5Hash: B765B92D5867BC1D00B3866E24EB56D6 content: | --- inputType: CA10Z1__CaAzureBastionHost__c testData: - file: test-data.json importExtracts: - file: /types/CA10Z1__CaAzureBastionHost__c/object.extracts.yaml conditions: - status: INAPPLICABLE currentStateMessage: This Bastion SKU does not support shareable links. check: CONTAINS: arg: SET: itemType: TEXT items: - Basic - Developer search: EXTRACT: CA10Z1__skuName__c - status: UNDETERMINED currentStateMessage: The Bastion SKU is unexpected. check: NOT: arg: CONTAINS: arg: SET: itemType: TEXT items: - Standard - Premium search: EXTRACT: CA10Z1__skuName__c - status: INCOMPLIANT currentStateMessage: Shareable links are enabled on this Bastion host. remediationMessage: Disable shareable links on the Bastion host. check: IS_EQUAL: left: EXTRACT: CA10Z1__shareableLinkState__c right: TEXT: Enabled - status: COMPLIANT currentStateMessage: Shareable links are disabled on this Bastion host. check: IS_EQUAL: left: EXTRACT: CA10Z1__shareableLinkState__c right: TEXT: Disabled otherwise: status: UNDETERMINED currentStateMessage: The Bastion shareable-link setting is missing or unexpected. - path: /ce/ca/azure/bastion/shareable-link/test-data.json md5Hash: B15B4C1F8129A7D4255BB4371FE6E0B7 content: | [ { "Id": "bastion-0", "CA10Z1__skuName__c": "Basic", "CA10Z1__shareableLinkState__c": null, "expectedResult": { "status": "INAPPLICABLE", "runtimeError": null, "conditionIndex": 199, "conditionText": "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-1", "CA10Z1__skuName__c": "Developer", "CA10Z1__shareableLinkState__c": null, "expectedResult": { "status": "INAPPLICABLE", "runtimeError": null, "conditionIndex": 199, "conditionText": "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-2", "CA10Z1__skuName__c": "Standard", "CA10Z1__shareableLinkState__c": "Enabled", "expectedResult": { "status": "INCOMPLIANT", "runtimeError": null, "conditionIndex": 399, "conditionText": "extract('CA10Z1__shareableLinkState__c') == 'Enabled'" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-3", "CA10Z1__skuName__c": "Premium", "CA10Z1__shareableLinkState__c": "Disabled", "expectedResult": { "status": "COMPLIANT", "runtimeError": null, "conditionIndex": 499, "conditionText": "extract('CA10Z1__shareableLinkState__c') == 'Disabled'" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-4", "CA10Z1__skuName__c": "Standard", "CA10Z1__shareableLinkState__c": null, "expectedResult": { "status": "UNDETERMINED", "runtimeError": null, "conditionIndex": 500, "conditionText": "otherwise" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-5", "CA10Z1__skuName__c": "Other", "CA10Z1__shareableLinkState__c": "Disabled", "expectedResult": { "status": "UNDETERMINED", "runtimeError": null, "conditionIndex": 299, "conditionText": "not(setOfText(['Standard', 'Premium']).contains(extract('CA10Z1__skuName__c')))" }, "CA10Z1__disappearanceTime__c": null }, { "Id": "bastion-6", "CA10Z1__skuName__c": null, "CA10Z1__shareableLinkState__c": "Disabled", "expectedResult": { "status": "UNDETERMINED", "runtimeError": null, "conditionIndex": 101, "conditionText": "CA10Z1__skuName__c.isEmpty()" }, "CA10Z1__disappearanceTime__c": null } ] - path: /types/CA10Z1__CaAzureBastionHost__c/object.extracts.yaml md5Hash: D44B8226865A67C63162737E7CB085D7 content: | --- extracts: - name: "CA10Z1__skuName__c" value: FIELD: path: "CA10Z1__skuName__c" undeterminedIf: isEmpty: "The CA10Z1__skuName__c value is unavailable." - name: "CA10Z1__shareableLinkState__c" value: FIELD: path: "CA10Z1__shareableLinkState__c" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "bastion-0", "expectedResult" : { "status" : "INAPPLICABLE", "runtimeError" : null, "conditionIndex" : 199, "conditionText" : "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" } }, { "Id" : "bastion-1", "expectedResult" : { "status" : "INAPPLICABLE", "runtimeError" : null, "conditionIndex" : 199, "conditionText" : "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))" } }, { "Id" : "bastion-2", "expectedResult" : { "status" : "INCOMPLIANT", "runtimeError" : null, "conditionIndex" : 399, "conditionText" : "extract('CA10Z1__shareableLinkState__c') == 'Enabled'" } }, { "Id" : "bastion-3", "expectedResult" : { "status" : "COMPLIANT", "runtimeError" : null, "conditionIndex" : 499, "conditionText" : "extract('CA10Z1__shareableLinkState__c') == 'Disabled'" } }, { "Id" : "bastion-4", "expectedResult" : { "status" : "UNDETERMINED", "runtimeError" : null, "conditionIndex" : 500, "conditionText" : "otherwise" } }, { "Id" : "bastion-5", "expectedResult" : { "status" : "UNDETERMINED", "runtimeError" : null, "conditionIndex" : 299, "conditionText" : "not(setOfText(['Standard', 'Premium']).contains(extract('CA10Z1__skuName__c')))" } }, { "Id" : "bastion-6", "expectedResult" : { "status" : "UNDETERMINED", "runtimeError" : null, "conditionIndex" : 101, "conditionText" : "CA10Z1__skuName__c.isEmpty()" } } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzureBastionHost__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "CA10Z1__skuName__c" : "Basic", "CA10Z1__shareableLinkState__c" : null, "Id" : "bastion-0" }, { "CA10Z1__skuName__c" : "Developer", "CA10Z1__shareableLinkState__c" : null, "Id" : "bastion-1" }, { "CA10Z1__skuName__c" : "Standard", "CA10Z1__shareableLinkState__c" : "Enabled", "Id" : "bastion-2" }, { "CA10Z1__skuName__c" : "Premium", "CA10Z1__shareableLinkState__c" : "Disabled", "Id" : "bastion-3" }, { "CA10Z1__skuName__c" : "Standard", "CA10Z1__shareableLinkState__c" : null, "Id" : "bastion-4" }, { "CA10Z1__skuName__c" : "Other", "CA10Z1__shareableLinkState__c" : "Disabled", "Id" : "bastion-5" }, { "CA10Z1__skuName__c" : null, "CA10Z1__shareableLinkState__c" : "Disabled", "Id" : "bastion-6" } ]; """; CREATE TEMP FUNCTION process_CA10Z1__CaAzureBastionHost__c( obj STRUCT< CA10Z1__disappearanceTime__c TIMESTAMP, CA10Z1__skuName__c STRING, CA10Z1__shareableLinkState__c STRING, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" 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 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 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 fieldChecked4() { if (TextLib.isEmpty(obj.CA10Z1__skuName__c)) { throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10Z1__skuName__c.isEmpty()", currentStateMessage: "The CA10Z1__skuName__c value is unavailable.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10Z1__skuName__c; } function extract3() { if (!this.out) { this.out = fieldChecked4(); } return this.out; }; references1.push('SKU: Name [obj.CA10Z1__skuName__c]: ' + obj.CA10Z1__skuName__c); try { if (CollectionLib.contains(CollectionLib.fromArray(['Basic', 'Developer'], true, true, true, true), extract3.call(extract3), true)) { return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "setOfText(['Basic', 'Developer']).contains(extract('CA10Z1__skuName__c'))", currentStateMessage: "This Bastion SKU does not support shareable links.", currentStateReferences: references1.join('\n'), remediation: null, 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.CA10Z1__skuName__c)) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "CA10Z1__skuName__c.isEmpty()", currentStateMessage: "The CA10Z1__skuName__c value is unavailable.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10Z1__skuName__c; } function extract6() { if (!this.out) { this.out = fieldChecked7(); } return this.out; }; try { if (!CollectionLib.contains(CollectionLib.fromArray(['Standard', 'Premium'], true, true, true, true), extract6.call(extract6), true)) { return {status: 'UNDETERMINED', conditionIndex: 299, conditionText: "not(setOfText(['Standard', 'Premium']).contains(extract('CA10Z1__skuName__c')))", currentStateMessage: "The Bastion SKU is unexpected.", 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 extract9() { if (!this.out) { this.out = obj.CA10Z1__shareableLinkState__c; } return this.out; }; references1.push('Shareable Link State [obj.CA10Z1__shareableLinkState__c]: ' + obj.CA10Z1__shareableLinkState__c); if (TextLib.equal(extract9.call(extract9), 'Enabled')) { return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('CA10Z1__shareableLinkState__c') == 'Enabled'", currentStateMessage: "Shareable links are enabled on this Bastion host.", currentStateReferences: references1.join('\n'), remediation: "Disable shareable links on the Bastion host.", runtimeError: null}; } // condition[4], conditionIndex:[400..499] function extract12() { if (!this.out) { this.out = obj.CA10Z1__shareableLinkState__c; } return this.out; }; if (TextLib.equal(extract12.call(extract12), 'Disabled')) { return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "extract('CA10Z1__shareableLinkState__c') == 'Disabled'", currentStateMessage: "Shareable links are disabled on this Bastion host.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'UNDETERMINED', conditionIndex: 500, conditionText: "otherwise", currentStateMessage: "The Bastion shareable-link setting is missing or unexpected.", 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__skuName__c AS CA10Z1__skuName__c, sObject.CA10Z1__shareableLinkState__c AS CA10Z1__shareableLinkState__c, sObject.Id AS Id, process_CA10Z1__CaAzureBastionHost__c( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__skuName__c AS CA10Z1__skuName__c, sObject.CA10Z1__shareableLinkState__c AS CA10Z1__shareableLinkState__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10Z1__CaAzureBastionHost__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;