Description
If an HTTPS backend authenticates API Gateway by client certificate, select the certificate in the stage’s ClientCertificateId. Caller HTTPS and caller authentication are configured separately. A backend with another suitable authentication method can use that instead.
Potential impact
- A backend without certificate verification or another authentication method may accept direct requests.
- Legitimate calls may fail if the certificate expires or the backend does not trust it.
Remediation
Generate a client certificate in API Gateway, attach it to the stage, and configure the HTTPS backend to verify it. Before expiry, update backend trust and rotate the certificate. Check that calls through the API succeed and unauthorized direct requests fail.
Examples
The stage references an existing REST API (MyRestApi) and deployment (ApiDeployment).
Before
Resources:
ProdStage:
Type: AWS::ApiGateway::Stage
Properties:
StageName: Prod
RestApiId: !Ref MyRestApi
DeploymentId: !Ref ApiDeployment
The Prod stage has no client certificate for backend calls.
After
Resources:
ProdStage:
Type: AWS::ApiGateway::Stage
Properties:
StageName: Prod
RestApiId: !Ref MyRestApi
DeploymentId: !Ref ApiDeployment
ClientCertificateId: !Ref ClientCertificate
!Ref ClientCertificate selects an API Gateway–generated certificate. Configure backend trust separately.