--- policy: /ce/ca/azure/storage/geo-redundant-storage logic: /ce/ca/azure/storage/geo-redundant-storage/prod.logic.yaml executionTime: 2026-05-02T12:05:16.899287573Z generationMs: 78 executionMs: 1776 rows: - id: 111 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: 222 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS') actual: extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS') runtimeError: {} - id: 333 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: 444 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS') actual: extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS') runtimeError: {} usedFiles: - path: /ce/ca/azure/storage/geo-redundant-storage/policy.yaml md5Hash: 6FADCCD32214FFDBB1214D3C4B7DCC48 content: | --- names: full: "Azure Storage Account is not configured to use geo-redundant storage" contextual: "Storage Account is not configured to use geo-redundant storage" description: > Critical Azure Storage Accounts should use a geo-redundant storage option, such as GRS, RA-GRS, GZRS, or RA-GZRS, to reduce the risk of data loss during regional outages. categories: - "RELIABILITY" type: "COMPLIANCE_POLICY" frameworkMappings: - "/frameworks/cloudaware/resource-reliability/system-configuration" - "/frameworks/cis-azure-v6.0.0/09/03/11" - path: /ce/ca/azure/storage/geo-redundant-storage/prod.logic.yaml md5Hash: 445825EB60C90A227DBDA556E8414EA3 content: | --- inputType: "CA10__CaAzureStorageAccount__c" testData: - file: test-data.json importExtracts: - file: /types/CA10__CaAzureStorageAccount__c/object.extracts.yaml conditions: - status: "COMPLIANT" currentStateMessage: "The storage account is configured to use geo-redundant storage." check: OR: args: - ENDS_WITH: arg: EXTRACT: "CA10__skuName__c" search: TEXT: "GRS" - ENDS_WITH: arg: EXTRACT: "CA10__skuName__c" search: TEXT: "GZRS" otherwise: status: "INCOMPLIANT" currentStateMessage: "The storage account is not configured to use geo-redundant storage." remediationMessage: "Change redundancy to GRS, RA-GRS, GZRS, or RA-GZRS." - path: /ce/ca/azure/storage/geo-redundant-storage/test-data.json md5Hash: 86496C35235640FA4E2EA332FB5223D7 content: | [ { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-03-26T11:02:25Z" }, "Id": "111", "RecordTypeId": "RecordTypeId", "CA10__disappearanceTime__c": null, "CA10__skuName__c": "Premium_LRS", "RecordType": { "DeveloperName": "caAzureRMStorageAccount", "Id": "RecordTypeId" } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS')", "runtimeError": null }, "context": { "snapshotTime": "2025-03-26T11:02:25Z" }, "Id": "222", "RecordTypeId": "RecordTypeId", "CA10__disappearanceTime__c": null, "CA10__skuName__c": "Standard_RAGRS", "RecordType": { "DeveloperName": "caAzureRMStorageAccount", "Id": "RecordTypeId" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-03-26T11:02:25Z" }, "Id": "333", "RecordTypeId": "RecordTypeId", "CA10__disappearanceTime__c": null, "CA10__skuName__c": "Standard_ZRS", "RecordType": { "DeveloperName": "caAzureRMStorageAccount", "Id": "RecordTypeId" } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS')", "runtimeError": null }, "context": { "snapshotTime": "2025-03-26T11:02:25Z" }, "Id": "444", "RecordTypeId": "RecordTypeId", "CA10__disappearanceTime__c": null, "CA10__skuName__c": "Standard_RAGZRS", "RecordType": { "DeveloperName": "caAzureRMStorageAccount", "Id": "RecordTypeId" } } ] - path: /types/CA10__CaAzureStorageAccount__c/object.extracts.yaml md5Hash: 2FD9F962F192FC3E335D23D11315B8F9 content: "---\nextracts:\n# This is a checkbox. Not nullable. Can't have no access,\ \ retrieved via Microsoft.Storage/storageAccounts\n - name: \"CA10__secureTransferRequired__c\"\ \n value: \n FIELD:\n path: \"CA10__secureTransferRequired__c\"\ \n# Values: Enabled, Disabled. Not Nullable. Can't have no access, retrieved\ \ via Microsoft.Storage/storageAccounts\n - name: \"CA10__requireInfrastructureEncryptionState__c\"\ \n value: \n FIELD:\n path: \"CA10__requireInfrastructureEncryptionState__c\"\ \n undeterminedIf:\n isEmpty: \"Corrupted data. Require Infrastructure\ \ Encryption setting cannot be empty.\"\n# Values: Enabled, Disabled. Not Nullable.\ \ Can't have no access, retrieved via Microsoft.Storage/storageAccounts\n -\ \ name: \"CA10__publicNetworkAccessState__c\"\n value: \n FIELD:\n \ \ path: \"CA10__publicNetworkAccessState__c\"\n undeterminedIf:\n\ \ isEmpty: \"Corrupted data. Public Network Access cannot be empty.\"\ \n# Values: Allow, Deny. Not nullable. Can't have no access, retrieved via Microsoft.Storage/storageAccounts.\n\ \ - name: \"CA10__networkAclsDefaultAction__c\"\n value: \n FIELD:\n\ \ path: \"CA10__networkAclsDefaultAction__c\"\n undeterminedIf:\n\ \ isEmpty: \"Corrupted data. Default Network Action cannot be empty.\"\ \n# Values: any combination of Logging|Metrics|AzureServices or None. Not nullable.\ \ \n# Can't have no access, retrieved via Microsoft.Storage/storageAccounts.\n\ \ - name: \"CA10__networkAclsBypass__c\"\n value: \n FIELD:\n \ \ path: \"CA10__networkAclsBypass__c\"\n undeterminedIf:\n \ \ isEmpty: \"Corrupted data. Network Bypass cannot be empty.\"\n# Values TLS1_0,\ \ TLS1_1, TLS1_2. Not nullable. Can't have no access, retrieved via Microsoft.Storage/storageAccounts.\n\ \ - name: \"CA10__minimumTlsVersion__c\"\n value: \n FIELD:\n \ \ path: \"CA10__minimumTlsVersion__c\"\n undeterminedIf:\n \ \ isEmpty: \"Corrupted data. TLS Version cannot be empty.\"\n# Values: Allow,\ \ Deny, null (Old storage accounts can have null, which means that the account\ \ can still have replication). \n# Nullable. Can't have no access, retrieved\ \ via Microsoft.Storage/storageAccounts.\n - name: \"CA10__crossTenantReplication__c\"\ \n value: \n FIELD:\n path: \"CA10__crossTenantReplication__c\"\ \n# Values: Allow, Deny. Not nullable. Can't have no access, retrieved via Microsoft.Storage/storageAccounts.\n\ \ - name: \"CA10__blobPublicAccess__c\"\n value: \n FIELD:\n \ \ path: \"CA10__blobPublicAccess__c\"\n undeterminedIf:\n isEmpty:\ \ \"Corrupted data. Allow Blob Anonymous Access cannot be empty.\"\n# Values\ \ Enabled, Disabled. Not Nullable\n - name: \"CA10__blobLoggingReadState__c\"\ \n value: \n FIELD:\n path: \"CA10__blobLoggingReadState__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__blobLoggingReadState__c\"\n currentStateMessage: \"Unable to\ \ determine Blob Container Logging Read property. Possible permission issue\ \ with Microsoft.Storage/storageAccounts/blobServices/containers/read\"\n \ \ isEmpty: \"Storage Blob Logging is not populated yet.\"\n# Values Enabled,\ \ Disabled. Not Nullable\n - name: \"CA10__blobLoggingWriteState__c\"\n \ \ value: \n FIELD:\n path: \"CA10__blobLoggingWriteState__c\"\n\ \ undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__blobLoggingWriteState__c\"\n currentStateMessage: \"Unable\ \ to determine Blob Container Logging Write property. Possible permission issue\ \ with Microsoft.Storage/storageAccounts/blobServices/containers/read\"\n \ \ isEmpty: \"Storage Blob Logging is not populated yet.\"\n # Values\ \ Enabled, Disabled. Not Nullable\n - name: \"CA10__blobLoggingDeleteState__c\"\ \n value: \n FIELD:\n path: \"CA10__blobLoggingDeleteState__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__blobLoggingDeleteState__c\"\n currentStateMessage: \"Unable\ \ to determine Blob Container Logging Delete property. Possible permission issue\ \ with Microsoft.Storage/storageAccounts/blobServices/containers/read\"\n \ \ isEmpty: \"Storage Blob Logging is not populated yet.\"\n# Values Enabled,\ \ Disabled. Not Nullable\n - name: \"CA10__queueLoggingReadState__c\"\n \ \ value: \n FIELD:\n path: \"CA10__queueLoggingReadState__c\"\n\ \ undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__queueLoggingReadState__c\"\n currentStateMessage: \"Unable\ \ to determine Queue Logging Read property. Possible permission issue with Microsoft.Storage/storageAccounts/queueServices/queues/read\"\ \n isEmpty: \"Storage Queue Logging is not populated yet.\"\n# Values\ \ Enabled, Disabled. Not Nullable\n - name: \"CA10__queueLoggingWriteState__c\"\ \n value: \n FIELD:\n path: \"CA10__queueLoggingWriteState__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__queueLoggingWriteState__c\"\n currentStateMessage: \"Unable\ \ to determine Queue Logging Write property. Possible permission issue with\ \ Microsoft.Storage/storageAccounts/queueServices/queues/read\"\n isEmpty:\ \ \"Storage Queue Logging is not populated yet.\"\n# Values Enabled, Disabled.\ \ Not Nullable\n - name: \"CA10__queueLoggingDeleteState__c\"\n value: \n\ \ FIELD:\n path: \"CA10__queueLoggingDeleteState__c\"\n undeterminedIf:\n\ \ noAccessDelegate:\n path: \"CA10__queueLoggingDeleteState__c\"\ \n currentStateMessage: \"Unable to determine Queue Logging Delete\ \ property. Possible permission issue with Microsoft.Storage/storageAccounts/queueServices/queues/read\"\ \n isEmpty: \"Storage Queue Logging is not populated yet.\"\n# Values\ \ Enabled, Disabled. Not Nullable\n - name: \"CA10__tableLoggingReadState__c\"\ \n value: \n FIELD:\n path: \"CA10__tableLoggingReadState__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__tableLoggingReadState__c\"\n currentStateMessage: \"Unable\ \ to determine Table Logging Read property. Possible permission issue with Microsoft.Storage/storageAccounts/tableServices/tables/read\"\ \n isEmpty: \"Storage Table Logging is not populated yet.\"\n# Values\ \ Enabled, Disabled. Not Nullable\n - name: \"CA10__tableLoggingWriteState__c\"\ \n value: \n FIELD:\n path: \"CA10__tableLoggingWriteState__c\"\ \n undeterminedIf:\n noAccessDelegate:\n path: \"\ CA10__tableLoggingWriteState__c\"\n currentStateMessage: \"Unable\ \ to determine Table Logging Write property. Possible permission issue with\ \ Microsoft.Storage/storageAccounts/tableServices/tables/read\"\n isEmpty:\ \ \"Storage Table Logging is not populated yet.\"\n# Values Enabled, Disabled.\ \ Not Nullable\n - name: \"CA10__tableLoggingDeleteState__c\"\n value: \n\ \ FIELD:\n path: \"CA10__tableLoggingDeleteState__c\"\n undeterminedIf:\n\ \ noAccessDelegate:\n path: \"CA10__tableLoggingDeleteState__c\"\ \n currentStateMessage: \"Unable to determine Table Logging Delete\ \ property. Possible permission issue with Microsoft.Storage/storageAccounts/tableServices/tables/read\"\ \n isEmpty: \"Storage Table Logging is not populated yet.\"\n# Values\ \ Microsoft.Storage, Microsoft.Keyvault. Not Nullable. Can't have no access,\ \ retrieved via Microsoft.Storage/storageAccounts\n - name: \"CA10__encryptionKeySource__c\"\ \n value: \n FIELD:\n path: \"CA10__encryptionKeySource__c\"\n\ \ undeterminedIf:\n isEmpty: \"Corrupted data. Encryption Key\ \ Source cannot be empty.\"\n# Nullable. Can't have no access, retrieved via\ \ Microsoft.Storage/storageAccounts\n - name: \"CA10__encryptionKeyVaultUri__c\"\ \n value: \n FIELD:\n path: \"CA10__encryptionKeyVaultUri__c\"\ \n# Nullable. \n - name: \"CA10__blobRetentionPolicyDays__c\"\n value: \n\ \ FIELD:\n path: \"CA10__blobRetentionPolicyDays__c\"\n# Values:\ \ Enabled, Disabled. Nullable. \n - name: \"CA10__blobRetentionPolicyState__c\"\ \n value: \n FIELD:\n path: \"CA10__blobRetentionPolicyState__c\"\ \n# Nullable. \n - name: \"CA10__containerRetentionPolicyDays__c\"\n value:\ \ \n FIELD:\n path: \"CA10__containerRetentionPolicyDays__c\"\n\ # Values: Enabled, Disabled. Nullable. \n - name: \"CA10__containerRetentionPolicyState__c\"\ \n value: \n FIELD:\n path: \"CA10__containerRetentionPolicyState__c\"\ \n# Nullable. Text field.\n - name: \"CA10__skuName__c\"\n value:\n \ \ FIELD:\n path: \"CA10__skuName__c\"\n# Nullable. Text field.\n -\ \ name: \"CA10__defaultToOAuthAuthentication__c\"\n value:\n FIELD:\n\ \ path: \"CA10__defaultToOAuthAuthentication__c\"\n# Nullable. Text field.\n\ \ - name: \"CA10__sharedKeyAccess__c\"\n value:\n FIELD:\n path:\ \ \"CA10__sharedKeyAccess__c\"\n# Nullable. Text field.\n - name: \"CA10__blobVersioning__c\"\ \n value:\n FIELD:\n path: \"CA10__blobVersioning__c\"\n# Text\ \ field.\n - name: \"CA10__locationName__c\"\n value:\n FIELD:\n \ \ path: \"CA10__locationName__c\"\n# Date/Time field.\n - name: \"CA10__primaryKeyCreationTime__c\"\ \n value:\n FIELD:\n path: \"CA10__primaryKeyCreationTime__c\"\ \n# Date/Time field.\n - name: \"CA10__secondaryKeyCreationTime__c\"\n value:\n\ \ FIELD:\n path: \"CA10__secondaryKeyCreationTime__c\"\n# Nullable.\ \ Number field.\n - name: \"CA10__keyExpirationPeriodDays__c\"\n value:\n\ \ FIELD:\n path: \"CA10__keyExpirationPeriodDays__c\"\n\n \ \ " script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "111", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "222", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS')", "runtimeError" : null } }, { "Id" : "333", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "444", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS')", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAzureStorageAccount__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-03-26T11:02:25Z") }, "CA10__skuName__c" : "Premium_LRS", "Id" : "111", "RecordTypeId" : "RecordTypeId" }, { "context" : { "snapshotTime" : new Date("2025-03-26T11:02:25Z") }, "CA10__skuName__c" : "Standard_RAGRS", "Id" : "222", "RecordTypeId" : "RecordTypeId" }, { "context" : { "snapshotTime" : new Date("2025-03-26T11:02:25Z") }, "CA10__skuName__c" : "Standard_ZRS", "Id" : "333", "RecordTypeId" : "RecordTypeId" }, { "context" : { "snapshotTime" : new Date("2025-03-26T11:02:25Z") }, "CA10__skuName__c" : "Standard_RAGZRS", "Id" : "444", "RecordTypeId" : "RecordTypeId" } ]; """; CREATE TEMP FUNCTION mock_RecordType() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-03-26T11:02:25Z") }, "Id" : "RecordTypeId" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAzureStorageAccount__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, CA10__skuName__c STRING, Id STRING, RecordTypeId STRING, RecordType STRUCT< 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 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__skuName__c; } return this.out; }; references1.push('SKU Name [obj.CA10__skuName__c]: ' + obj.CA10__skuName__c); if (TextLib.endsWith(extract3.call(extract3), 'GRS') || TextLib.endsWith(extract3.call(extract3), 'GZRS')) { return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__skuName__c').endsWith('GRS') || extract('CA10__skuName__c').endsWith('GZRS')", currentStateMessage: "The storage account is configured to use geo-redundant storage.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "The storage account is not configured to use geo-redundant storage.", currentStateReferences: references1.join('\n'), remediation: "Change redundancy to GRS, RA-GRS, GZRS, or RA-GZRS.", 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__skuName__c AS CA10__skuName__c, sObject.Id AS Id, sObject.RecordTypeId AS RecordTypeId, STRUCT ( `RecordType`.Id AS Id ) AS RecordType, process_CA10__CaAzureStorageAccount__c( STRUCT( sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__skuName__c AS CA10__skuName__c, sObject.Id AS Id, sObject.RecordTypeId AS RecordTypeId, STRUCT ( `RecordType`.Id AS Id ) AS RecordType ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAzureStorageAccount__c()) AS sObject LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType` ON sObject.RecordTypeId = `RecordType`.Id ) sObject ON sObject.Id = expectedResult.Id;