--- policy: /ce/ca/breeze/coverage/azure-vm-scale-set-instance logic: /ce/ca/breeze/coverage/azure-vm-scale-set-instance/prod.logic.yaml executionTime: 2026-06-06T12:04:19.729520489Z generationMs: 60 executionMs: 1013 rows: - id: test1 match: true status: expected: DISAPPEARED actual: DISAPPEARED conditionIndex: expected: 99 actual: 99 conditionText: expected: isDisappeared(CA10__disappearanceTime__c) actual: isDisappeared(CA10__disappearanceTime__c) runtimeError: {} - id: test2 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('breezeLastUpdate').isEmpty() actual: extract('breezeLastUpdate').isEmpty() runtimeError: {} - id: test3 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('breezeLastUpdate').beyondLastDays(1) actual: extract('breezeLastUpdate').beyondLastDays(1) runtimeError: {} - id: test4 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 300 actual: 300 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/breeze/coverage/azure-vm-scale-set-instance/policy.yaml md5Hash: 9EC4B23DB2E8D143C6729C6677DD8DA2 content: | --- names: full: Azure VM Scale Set Instance Should Have Breeze Agent Installed contextual: Azure VM Scale Set Instance Should Have Breeze Agent Installed description: "Ensure that Breeze Agent is installed on the VM Scale Set Instance.\ \ The Breeze Agent streams OS-level data into Cloudaware CMDB and seamlessly enables\ \ other Cloudaware modules such as Intrusion Detection (IDS), Vulnerability Scanning,\ \ Patch Management, CIS Benchmarking, and Event Monitoring." type: BEST_PRACTICE categories: - RELIABILITY - path: /ce/ca/breeze/coverage/azure-vm-scale-set-instance/prod.logic.yaml md5Hash: 788B279E9C1FA9F21918534B1D61B864 content: |+ --- inputType: CA10__CaAzureVmScaleSetInstance__c importExtracts: - file: /types/CA10__CaAzureVmScaleSetInstance__c/breeze.extracts.yaml testData: - file: ../test-data-ca10.json conditions: - status: INCOMPLIANT currentStateMessage: "The instance has never had the breeze agent installed." remediationMessage: "Install the breeze agent on the instance." check: IS_EMPTY: arg: EXTRACT: breezeLastUpdate - status: INCOMPLIANT currentStateMessage: "The latest breeze report for this instance is more than a day old." remediationMessage: "Reinstall the breeze agent on the instance and confirm it is reporting." check: IS_BEYOND_LAST_DAYS: offsetDays: 1 arg: EXTRACT: breezeLastUpdate otherwise: status: COMPLIANT currentStateMessage: "The breeze agent is installed on the instance and has a recent report." - path: /ce/ca/breeze/coverage/test-data-ca10.json md5Hash: 3F29F9B4DB309E9EEA69E663C01435DE content: |- [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-24T00:11:51Z" }, "Id": "test1", "RecordTypeId": "rtId", "CA10__disappearanceTime__c": "2024-06-14T21:33:57Z", "CA10__breezeLastUpdate__c": null, "RecordType": { "DeveloperName": "RecordType1", "Id": "rtId" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('breezeLastUpdate').isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2024-06-24T00:11:51Z" }, "Id": "test2", "RecordTypeId": "rtId", "CA10__disappearanceTime__c": null, "CA10__breezeLastUpdate__c": null, "RecordType": { "DeveloperName": "RecordType1", "Id": "rtId" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "299", "conditionText": "extract('breezeLastUpdate').beyondLastDays(1)", "runtimeError": null }, "context": { "snapshotTime": "2024-06-24T00:11:51Z" }, "Id": "test3", "RecordTypeId": "rtId", "CA10__disappearanceTime__c": null, "CA10__breezeLastUpdate__c": "2023-03-20T03:06:08Z", "RecordType": { "DeveloperName": "RecordType1", "Id": "rtId" } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "300", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2024-06-24T00:11:51Z" }, "Id": "test4", "RecordTypeId": "rtId", "CA10__disappearanceTime__c": null, "CA10__breezeLastUpdate__c": "2024-06-23T22:58:43Z", "RecordType": { "DeveloperName": "RecordType1", "Id": "rtId" } } ] - path: /types/CA10__CaAzureVmScaleSetInstance__c/breeze.extracts.yaml md5Hash: 2E0FA731FC929EE1D3BA9374B84DF3A3 content: "---\nextracts:\n - name: breezeLastUpdate\n value:\n FIELD:\ \ \n # can be empty\n # always accessible\n path: CA10__breezeLastUpdate__c\n" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('breezeLastUpdate').isEmpty()", "runtimeError" : null } }, { "Id" : "test3", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "299", "conditionText" : "extract('breezeLastUpdate').beyondLastDays(1)", "runtimeError" : null } }, { "Id" : "test4", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "300", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAzureVmScaleSetInstance__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-06-24T00:11:51Z") }, "CA10__disappearanceTime__c" : new Date("2024-06-14T21:33:57Z"), "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2024-06-24T00:11:51Z") }, "Id" : "test2" }, { "context" : { "snapshotTime" : new Date("2024-06-24T00:11:51Z") }, "CA10__breezeLastUpdate__c" : new Date("2023-03-20T03:06:08Z"), "Id" : "test3" }, { "context" : { "snapshotTime" : new Date("2024-06-24T00:11:51Z") }, "CA10__breezeLastUpdate__c" : new Date("2024-06-23T22:58:43Z"), "Id" : "test4" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAzureVmScaleSetInstance__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, CA10__breezeLastUpdate__c TIMESTAMP, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var IsEmptyLib = new function () { this.simpleIsEmpty = function(arg) { return arg == null; }; this.simpleIsNotEmpty = function(arg) { return arg != null; }; }(); var todayMinus1Day = new Date(snapshotTime.toISOString().substr(0,10)+'T00:00:00.000Z').getTime() + (-1 * 86400000); var references1 = []; // condition[0], conditionIndex:[0..99] references1.push('Deleted From Azure [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c); if (obj.CA10__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", 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__breezeLastUpdate__c; } return this.out; }; references1.push('Breeze: Last Update [obj.CA10__breezeLastUpdate__c]: ' + obj.CA10__breezeLastUpdate__c); if (IsEmptyLib.simpleIsEmpty(extract3.call(extract3))) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('breezeLastUpdate').isEmpty()", currentStateMessage: "The instance has never had the breeze agent installed.", currentStateReferences: references1.join('\n'), remediation: "Install the breeze agent on the instance.", runtimeError: null}; } // condition[2], conditionIndex:[200..299] function extract6() { if (!this.out) { this.out = obj.CA10__breezeLastUpdate__c; } return this.out; }; if (extract6.call(extract6) != null && extract6.call(extract6).getTime() < todayMinus1Day) { return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('breezeLastUpdate').beyondLastDays(1)", currentStateMessage: "The latest breeze report for this instance is more than a day old.", currentStateReferences: references1.join('\n'), remediation: "Reinstall the breeze agent on the instance and confirm it is reporting.", runtimeError: null}; } return {status: 'COMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "The breeze agent is installed on the instance and has a recent report.", 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.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__breezeLastUpdate__c AS CA10__breezeLastUpdate__c, sObject.Id AS Id, process_CA10__CaAzureVmScaleSetInstance__c( STRUCT( sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__breezeLastUpdate__c AS CA10__breezeLastUpdate__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAzureVmScaleSetInstance__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;