Description
AuthorizationType: NONE leaves caller authentication off for that method. Determine which methods serve public content or CORS preflight and which require protection.
Potential impact
Without a resource policy or backend authorization, unintended callers may read or change data. Unnecessary requests can also increase load and cost.
Remediation
Protect the required methods with AWS_IAM, Cognito or a Lambda authorizer. Limit each caller to the actions and resources they need. Deploy to the intended stage and verify that permitted calls succeed and others are denied.
Examples
The excerpts show two separate unauthenticated methods. OPTIONS can handle CORS preflight. To protect GET, change that method itself. The API and integration settings are omitted.
Before
Resources:
MockMethod:
Type: AWS::ApiGateway::Method
Properties:
RestApiId: !Ref MyApi
ResourceId: !GetAtt MyApi.RootResourceId
HttpMethod: GET
AuthorizationType: NONE
After
Resources:
CorsOptionsMethod:
Type: AWS::ApiGateway::Method
Properties:
RestApiId: !Ref MyApi
ResourceId: !GetAtt MyApi.RootResourceId
HttpMethod: OPTIONS
AuthorizationType: NONE