github-actions[bot] 554f7db36c
Create rule S4507: Delivering code in production with debug features activated is security-sensitive, add ARM (#3802)
Co-authored-by: Peter Trifanov <peter.trifanov@sonarsource.com>
2024-03-22 13:10:41 +00:00

85 lines
1.7 KiB
Plaintext

include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
[source,json,diff-id=1,diff-type=noncompliant]
----
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "templateDebug",
"properties": {
"debugSetting": { "detailLevel": "RequestContent, ResponseContent" }
}
}
]
}
----
[source,bicep,diff-id=2,diff-type=noncompliant]
----
resource templateDebug 'Microsoft.Resources/deployments@2022-09-01' = {
name: 'templateDebug'
properties: {
debugSetting: { // Noncompliant
detailLevel: 'RequestContent, ResponseContent'
}
}
}
----
== Compliant Solution
[source,json,diff-id=1,diff-type=compliant]
----
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "templateDebug",
"properties": {}
}
]
}
----
[source,bicep,diff-id=2,diff-type=compliant]
----
resource templateDebug 'Microsoft.Resources/deployments@2022-09-01' = {
name: 'templateDebug'
}
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
=== Highlighting
Highlight the "debugSetting" property and its value.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]