Skip to content

Commit

Permalink
Add azureresourcemanager to rule S4507
Browse files Browse the repository at this point in the history
  • Loading branch information
petertrr committed Mar 21, 2024
1 parent e7bcbd7 commit 92ea6b2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/S4507/azureresourcemanager/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
84 changes: 84 additions & 0 deletions rules/S4507/azureresourcemanager/rule.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
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": "2019-05-01",
"name": "templateDebug",
"properties": {
"debugSetting": { "detailLevel": "RequestContent, ResponseContent" }
}
}
]
}
----

[source,bicep,diff-id=2,diff-type=noncompliant]
----
resource templateDebug 'Microsoft.Resources/deployments@2019-05-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": "2019-05-01",
"name": "templateDebug",
"properties": {}
}
]
}
----

[source,bicep,diff-id=2,diff-type=compliant]
----
resource templateDebug 'Microsoft.Resources/deployments@2019-05-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[]

0 comments on commit 92ea6b2

Please sign in to comment.