nuclei-templates/cloud/azure/apimanagement/azure-apim-http2-not-enable...

56 lines
2.2 KiB
YAML

id: azure-apim-http2-not-enabled
info:
name: Azure API Management HTTP/2 Support Not Enabled
author: princechaddha
severity: medium
description: |
Ensure that your Azure API Management API gateways are configured to use HTTP/2 to increase API performance on the client-side. HTTP/2 is designed to reduce the impact of latency and connection load on servers by using features like full request and response multiplexing, minimizing protocol overhead, and supporting request prioritization and server push.
impact: |
Not enabling HTTP/2 in Azure API Management gateways can result in less efficient communication, increased latency, and higher load on the API gateways, which can degrade the performance of the API services.
remediation: |
Enable HTTP/2 support in Azure API Management gateways by setting the 'Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2' property to 'true'.
reference:
- https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-http2
tags: cloud,devops,azure,microsoft,api-management,azure-cloud-config
flow: |
code(1);
for (let APIData of iterate(template.apiList)) {
APIData = JSON.parse(APIData);
set("name", APIData.name);
set("resourceGroup", APIData.resourceGroup);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az apim list --output json --query '[*].{name:name, resourceGroup:resourceGroup}'
extractors:
- type: json
name: apiList
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
az apim show --name "$name" --resource-group "$resourceGroup" --output json --query 'customProperties'
matchers-condition: and
matchers:
- type: word
words:
- '"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"'
extractors:
- type: dsl
dsl:
- 'name + " in resource group " + resourceGroup + " does not have HTTP/2 enabled"'
# digest: 4a0a00473045022100ec315dc114d470de67fd90837c8b566f23d05536cbd717e92bce5057a591adaf02204c110606cb46589375b512fd82ca829c61c09f724015b92cc207cd71e6f5c1a4:922c64590222798bb761d5b6d8e72950