Skip to content

Commit

Permalink
Swap Web Apps for Containers and App Service
Browse files Browse the repository at this point in the history
  • Loading branch information
egon-okerman-sonarsource committed Jul 18, 2023
1 parent 0ff4349 commit 6a23a29
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions rules/S6382/terraform/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ include::../common/recommended.adoc[]

== Sensitive Code Example

For https://azure.microsoft.com/en-us/services/app-service/[App Service]:
For https://azure.microsoft.com/en-us/services/app-service/containers/[Linux and Windows Web Apps]:

[source,terraform,diff-id=1,diff-type=noncompliant]
----
resource "azurerm_app_service" "example" {
resource "azurerm_linux_web_app" "example" {
client_cert_enabled = false # Sensitive
}
resource "azurerm_linux_web_app" "example2" {
client_certificate_enabled = true
client_certificate_mode = "Optional" # Sensitive
}
----

For https://azure.microsoft.com/en-us/services/logic-apps/[Logic App Standards] and https://azure.microsoft.com/en-us/services/functions/[Function Apps]:
Expand Down Expand Up @@ -43,27 +47,24 @@ resource "azurerm_api_management" "example" {
}
----

For https://azure.microsoft.com/en-us/services/app-service/containers/[Linux and Windows Web Apps]:
For https://azure.microsoft.com/en-us/services/app-service/[App Service]:

[source,terraform,diff-id=5,diff-type=noncompliant]
----
resource "azurerm_linux_web_app" "example" {
resource "azurerm_app_service" "example" {
client_cert_enabled = false # Sensitive
}
resource "azurerm_linux_web_app" "example2" {
client_certificate_enabled = true
client_certificate_mode = "Optional" # Sensitive
}
----

== Compliant Solution

For https://azure.microsoft.com/en-us/services/app-service/[App Service]:
For https://azure.microsoft.com/en-us/services/app-service/containers/[Linux and Windows Web Apps]:

[source,terraform,diff-id=1,diff-type=compliant]
----
resource "azurerm_app_service" "example" {
client_cert_enabled = true
resource "azurerm_linux_web_app" "example" {
client_certificate_enabled = true
client_certificate_mode = "Required"
}
----

Expand Down Expand Up @@ -95,13 +96,12 @@ resource "azurerm_api_management" "example" {
}
----

For https://azure.microsoft.com/en-us/services/app-service/containers/[Linux and Windows Web Apps]:
For https://azure.microsoft.com/en-us/services/app-service/[App Service]:

[source,terraform,diff-id=5,diff-type=compliant]
----
resource "azurerm_linux_web_app" "example" {
client_certificate_enabled = true
client_certificate_mode = "Required"
resource "azurerm_app_service" "example" {
client_cert_enabled = true
}
----

Expand Down

0 comments on commit 6a23a29

Please sign in to comment.