From a9c9fb99ffab5bc337f5eed415253736c34fd7d3 Mon Sep 17 00:00:00 2001 From: Egon Okerman Date: Wed, 13 Sep 2023 17:48:09 +0200 Subject: [PATCH] Modify rule S4423, S6378, S6387, S6656: Fix diff view errors in ARM examples (#3067) ## Review A dedicated reviewer checked the rule description successfully for: - [x] logical errors and incorrect information - [x] information gaps and missing content - [x] text style and tone - [x] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule) --- .../how-to-fix-it/azure-storage-account.adoc | 4 ++-- rules/S6378/azureresourcemanager/rule.adoc | 2 +- rules/S6387/azureresourcemanager/rule.adoc | 2 +- rules/S6656/azureresourcemanager/how-to-fix-it/arm.adoc | 4 ++-- rules/S6656/azureresourcemanager/how-to-fix-it/bicep.adoc | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rules/S4423/azureresourcemanager/how-to-fix-it/azure-storage-account.adoc b/rules/S4423/azureresourcemanager/how-to-fix-it/azure-storage-account.adoc index 0c313f3386d..67721aed5fb 100644 --- a/rules/S4423/azureresourcemanager/how-to-fix-it/azure-storage-account.adoc +++ b/rules/S4423/azureresourcemanager/how-to-fix-it/azure-storage-account.adoc @@ -25,7 +25,7 @@ On Storage Accounts, TLS 1.0 and 1.1 are accepted by default. } ---- -[source,bicep,diff-id=1,diff-type=noncompliant] +[source,bicep,diff-id=4,diff-type=noncompliant] ---- resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { name: 'example' @@ -55,7 +55,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { } ---- -[source,bicep,diff-id=1,diff-type=compliant] +[source,bicep,diff-id=4,diff-type=compliant] ---- resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = { name: 'example' diff --git a/rules/S6378/azureresourcemanager/rule.adoc b/rules/S6378/azureresourcemanager/rule.adoc index 5407b2248d1..f8ff86cf280 100644 --- a/rules/S6378/azureresourcemanager/rule.adoc +++ b/rules/S6378/azureresourcemanager/rule.adoc @@ -57,7 +57,7 @@ Using ARM templates: Using Bicep: -[source,json,diff-id=2,diff-type=noncompliant] +[source,bicep,diff-id=2,diff-type=compliant] ---- resource sensitiveApiManagementService 'Microsoft.ApiManagement/service@2022-09-01-preview' = { name: 'apiManagementService' diff --git a/rules/S6387/azureresourcemanager/rule.adoc b/rules/S6387/azureresourcemanager/rule.adoc index 0fc98724efb..152c45457fc 100644 --- a/rules/S6387/azureresourcemanager/rule.adoc +++ b/rules/S6387/azureresourcemanager/rule.adoc @@ -42,7 +42,7 @@ resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { } ---- -[source,json,diff-id=2,diff-type=noncompliant] +[source,json,diff-id=2,diff-type=compliant] ---- { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", diff --git a/rules/S6656/azureresourcemanager/how-to-fix-it/arm.adoc b/rules/S6656/azureresourcemanager/how-to-fix-it/arm.adoc index 32b1c329af8..614b1ede297 100644 --- a/rules/S6656/azureresourcemanager/how-to-fix-it/arm.adoc +++ b/rules/S6656/azureresourcemanager/how-to-fix-it/arm.adoc @@ -5,7 +5,7 @@ By setting `properties.expressionEvaluationOptions.scope` to `Inner` in the pare === Code examples ==== Noncompliant code example -[source,json,diff-id=1,diff-type=noncompliant] +[source,json,diff-id=101,diff-type=noncompliant] ---- { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", @@ -47,7 +47,7 @@ By setting `properties.expressionEvaluationOptions.scope` to `Inner` in the pare ==== Compliant solution -[source,json,diff-id=1,diff-type=compliant] +[source,json,diff-id=101,diff-type=compliant] ---- { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", diff --git a/rules/S6656/azureresourcemanager/how-to-fix-it/bicep.adoc b/rules/S6656/azureresourcemanager/how-to-fix-it/bicep.adoc index 32b520db994..c7943b43e7a 100644 --- a/rules/S6656/azureresourcemanager/how-to-fix-it/bicep.adoc +++ b/rules/S6656/azureresourcemanager/how-to-fix-it/bicep.adoc @@ -7,7 +7,7 @@ If it is not possible to use modules, this issue can be fixed by setting `proper === Code examples ==== Noncompliant code example -[source,bicep,diff-id=1,diff-type=noncompliant] +[source,bicep,diff-id=201,diff-type=noncompliant] ---- @secure() param adminUsername string = newGuid() @@ -39,7 +39,7 @@ resource example 'Microsoft.Resources/deployments@2022-09-01' = { ==== Compliant solution -[source,bicep,diff-id=1,diff-type=compliant] +[source,bicep,diff-id=201,diff-type=compliant] ---- // main.bicep module example 'vm.bicep' = {