π AWS API Gateway API Route Authorization Type is not configured π’
- Contextual name: π API Route Authorization Type is not configured π’
- ID:
/ce/ca/aws/apigateway/api-route-authorization-type
- Located in: π AWS API Gateway
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Internal
dec-x-5fa71eac
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-5fa71eac | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Ensure that each AWS API Gateway API Route is configured with a mechanisms for controlling and managing access to the API. API Gateway supports the following mechanisms:
- Lambda authorizers - Leverage custom AWS Lambda functions to evaluate incoming requests and determine access.
- JWT authorizers - Validate JSON Web Tokens (JWTs) issued by trusted identity providers to control access.
- AWS IAM - Use standard AWS Identity and Access Management (IAM) roles and policies to authorize requests.
Rationaleβ
Enhance API Security: Enforcing authorization at the route level is essential to ensure that only authenticated and authorized clients can access your API endpoints. This mitigates the risk of unauthorized access, abuse, and exposure of internal services.
Protect Sensitive Data and Functionality: APIs often handle sensitive data or critical business logic. Without proper authorization, malicious actors could exploit unsecured endpoints, leading to data leaks, service interruptions, or unauthorized operations.
... see more
Remediationβ
Remediationβ
Configure an appropriate
Authorization Type
for each route in AWS API Gateway. Select the authorization mechanism based on your security requirements - for example, IAM, JWT, or Lambda authorizers for HTTP APIs, and IAM or Lambda authorizers for WebSocket APIs.From AWS CLIβ
To update an API Route to use IAM authorization, run the following command:
aws apigatewayv2 update-route \
--api-id {{api-id}} \
--route-id {{route-id}} \
--authorization-type AWS_IAMReplace
{{api-id}}
with the ID of your API Gateway API and{{route-id}}
with the ID of the Route you are updating.When IAM authorization is enabled, clients must use Signature Version 4 (SigV4) to sign their requests with AWS credentials. API Gateway invokes your API route only if the client has
execute-api
permission for the route.To configure a Lambda or JWT authorizer, use the
create-authorizer
command:aws apigatewayv2 create-authorizer \
--api-id {{api-id}} \... see more