Gallery › App Service › Azure built-in policies
[Deprecated]: Ensure that 'HTTP Version' is the latest, if used to run the API app
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 2.0.0-deprecated Deprecated
Periodically, newer versions are released for HTTP either due to security flaws or to include additional functionality. Using the latest HTTP version for web apps to take advantage of security fixes, if any, and/or new functionalities of the newer version. We recommend all customers who are still using API Apps to implement the built-in policy called 'App Service apps should use latest 'HTTP Version'', which is scoped to include API apps in addition to Web Apps.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "[Deprecated]: Ensure that 'HTTP Version' is the latest, if used to run the API app",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Periodically, newer versions are released for HTTP either due to security flaws or to include additional functionality. Using the latest HTTP version for web apps to take advantage of security fixes, if any, and/or new functionalities of the newer version. We recommend all customers who are still using API Apps to implement the built-in policy called 'App Service apps should use latest 'HTTP Version'', which is scoped to include API apps in addition to Web Apps.",
"metadata": {
"version": "2.0.0-deprecated",
"category": "App Service",
"deprecated": true
},
"version": "2.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites"
},
{
"field": "kind",
"like": "*api"
},
{
"field": "kind",
"contains": "linux"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Web/sites/config",
"name": "web",
"existenceCondition": {
"field": "Microsoft.Web/sites/config/web.http20Enabled",
"equals": "true"
}
}
}
},
"versions": [
"2.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/991310cd-e9f3-47bc-b7b6-f57b557d07db",
"name": "991310cd-e9f3-47bc-b7b6-f57b557d07db"
}# Converted from ApiApp_Audit_HTTP_Latest.json by ConvertTo-Bylaw.
Policy '991310cd-e9f3-47bc-b7b6-f57b557d07db' {
Properties @{
DisplayName = '[Deprecated]: Ensure that ''HTTP Version'' is the latest, if used to run the API app'
Description = 'Periodically, newer versions are released for HTTP either due to security flaws or to include additional functionality. Using the latest HTTP version for web apps to take advantage of security fixes, if any, and/or new functionalities of the newer version. We recommend all customers who are still using API Apps to implement the built-in policy called ''App Service apps should use latest ''HTTP Version'''', which is scoped to include API apps in addition to Web Apps.'
Version = '2.0.0-deprecated'
Category = 'App Service'
Deprecated = $true
PolicyVersion = '2.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites' {
When {
Field kind | Must -BeLike '*api'
}
Require 'kind does not contain linux' {
Field kind | Must -Not -ContainText 'linux' -IfPresent
}
}
AuditIfNotExists 'Microsoft.Web/sites/config' -Name 'web' -Effect (Param Effect) {
Require 'web.http20Enabled is true' {
Field web.http20Enabled | Must -Be 'true'
}
}
}Source: built-in-policies/policyDefinitions/App Service/ApiApp_Audit_HTTP_Latest.json in Azure/azure-policy, under the MIT licence.
Bylaw