Description
Require HTTPS to encrypt traffic from clients to Alibaba Cloud API Gateway. Allowing HTTP alongside HTTPS still permits plaintext requests.
Potential impact
Authentication headers and request or response data sent over HTTP can be read or altered in transit.
Remediation
Set request_config.protocol to HTTPS and update clients to use the HTTPS URL. To encrypt the backend connection, configure TLS separately between the gateway and backend.
Examples
Both excerpts use GET /test/path1. Only the client-facing protocol changes. Supply the API group, authentication and backend settings separately.
Before
hcl
resource "alicloud_api_gateway_api" "api_gateway" {
request_config {
protocol = "HTTP"
method = "GET"
path = "/test/path1"
mode = "MAPPING"
}
}
After
hcl
resource "alicloud_api_gateway_api" "api_gateway" {
request_config {
protocol = "HTTPS"
method = "GET"
path = "/test/path1"
mode = "MAPPING"
}
}