Skip to content

Commit 2e5f3a5

Browse files
feat(aws): enhance metadata for apigatewayv2 service (#8719)
Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
1 parent 231a5fa commit 2e5f3a5

File tree

3 files changed

+41
-24
lines changed

3 files changed

+41
-24
lines changed

prowler/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ All notable changes to the **Prowler SDK** are documented in this file.
1212
- Add explicit "name" field for each compliance framework and include "FRAMEWORK" and "NAME" in CSV output [(#7920)](https://github.com/prowler-cloud/prowler/pull/7920)
1313

1414
### Changed
15+
1516
- Update AWS Neptune service metadata to new format [(#8494)](https://github.com/prowler-cloud/prowler/pull/8494)
1617
- Update AWS Config service metadata to new format [(#8641)](https://github.com/prowler-cloud/prowler/pull/8641)
18+
- Update AWS Api Gateway V2 service metadata to new format [(#8719)](https://github.com/prowler-cloud/prowler/pull/8719)
1719
- Update AWS AppSync service metadata to new format [(#8721)](https://github.com/prowler-cloud/prowler/pull/8721)
1820
- HTML output now properly renders markdown syntax in Risk and Recommendation fields [(#8727)](https://github.com/prowler-cloud/prowler/pull/8727)
1921
- Update `moto` dependency from 5.0.28 to 5.1.11 [(#7100)](https://github.com/prowler-cloud/prowler/pull/7100)

prowler/providers/aws/services/apigatewayv2/apigatewayv2_api_access_logging_enabled/apigatewayv2_api_access_logging_enabled.metadata.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
{
22
"Provider": "aws",
33
"CheckID": "apigatewayv2_api_access_logging_enabled",
4-
"CheckTitle": "Ensure API Gateway V2 has Access Logging enabled.",
4+
"CheckTitle": "API Gateway V2 API stage has access logging enabled",
55
"CheckAliases": [
66
"apigatewayv2_access_logging_enabled"
77
],
88
"CheckType": [
9-
"IAM"
9+
"Software and Configuration Checks/AWS Security Best Practices"
1010
],
1111
"ServiceName": "apigatewayv2",
1212
"SubServiceName": "",
13-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
13+
"ResourceIdTemplate": "",
1414
"Severity": "medium",
15-
"ResourceType": "AwsApiGatewayV2Api",
16-
"Description": "Ensure API Gateway V2 has Access Logging enabled.",
17-
"Risk": "If no authorizer is enabled anyone can use the service.",
15+
"ResourceType": "AwsApiGatewayV2Stage",
16+
"Description": "**API Gateway v2** stages have **access logging** configured to capture request details and deliver them to a logging destination (e.g., CloudWatch Logs or Firehose). The evaluation looks for logging being enabled at each API stage.",
17+
"Risk": "Without access logs, API calls lack traceability, making it hard to spot credential misuse, route abuse, or anomalous traffic.\n\nThis reduces confidentiality and integrity through undetected data access or manipulation, and impacts availability by slowing incident response.",
1818
"RelatedUrl": "",
19+
"AdditionalURLs": [
20+
"https://docs.aws.amazon.com/apigateway/latest/developerguide/security-monitoring.html",
21+
"https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html",
22+
"https://support.icompaas.com/support/solutions/articles/62000229562-ensure-api-gateway-v2-has-access-logging-enabled",
23+
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/APIGateway/api-gateway-stage-access-logging.html"
24+
],
1925
"Remediation": {
2026
"Code": {
21-
"CLI": "",
22-
"NativeIaC": "",
23-
"Other": "https://docs.prowler.com/checks/aws/logging-policies/bc_aws_logging_30#aws-console",
24-
"Terraform": "https://docs.prowler.com/checks/aws/logging-policies/bc_aws_logging_30#cloudformation"
27+
"CLI": "aws apigatewayv2 update-stage --api-id <API_ID> --stage-name <STAGE_NAME> --access-log-settings DestinationArn=<LOG_GROUP_ARN>,Format='{\"requestId\":\"$context.requestId\"}'",
28+
"NativeIaC": "```yaml\n# CloudFormation: Enable access logging on API Gateway V2 stage\nResources:\n <example_resource_name>:\n Type: AWS::ApiGatewayV2::Stage\n Properties:\n ApiId: <example_resource_id>\n StageName: <example_resource_name>\n AccessLogSettings: # Critical: enables access logging for the stage\n DestinationArn: <example_log_group_arn> # CloudWatch Logs log group ARN\n Format: '{\"requestId\":\"$context.requestId\"}' # Minimal required format\n```",
29+
"Other": "1. In the AWS Console, go to API Gateway > your HTTP/WebSocket API\n2. Open Stages and select the target stage\n3. In Access logging, enable Access logging\n4. Set Log destination ARN to your CloudWatch log group (or Firehose stream)\n5. Set Log format to: {\"requestId\":\"$context.requestId\"}\n6. Click Save",
30+
"Terraform": "```hcl\n# Terraform: Enable access logging on API Gateway V2 stage\nresource \"aws_apigatewayv2_stage\" \"<example_resource_name>\" {\n api_id = \"<example_resource_id>\"\n name = \"<example_resource_name>\"\n\n access_log_settings { # Critical: enables access logging for the stage\n destination_arn = \"<example_log_group_arn>\"\n format = \"{\\\"requestId\\\":\\\"$context.requestId\\\"}\"\n }\n}\n```"
2531
},
2632
"Recommendation": {
27-
"Text": "Monitoring is an important part of maintaining the reliability, availability and performance of API Gateway and your AWS solutions. You should collect monitoring data from all of the parts of your AWS solution. CloudTrail provides a record of actions taken by a user, role, or an AWS service in API Gateway. Using the information collected by CloudTrail, you can determine the request that was made to API Gateway, the IP address from which the request was made, who made the request, etc.",
28-
"Url": "https://docs.aws.amazon.com/apigateway/latest/developerguide/security-monitoring.html"
33+
"Text": "Enable **stage-level access logging** to a centralized destination and use structured formats. Apply appropriate retention and restrict log access per **least privilege**. Integrate logs with monitoring and alerts to detect anomalies, and complement with **defense in depth** controls.",
34+
"Url": "https://hub.prowler.com/check/apigatewayv2_api_access_logging_enabled"
2935
}
3036
},
3137
"Categories": [

prowler/providers/aws/services/apigatewayv2/apigatewayv2_api_authorizers_enabled/apigatewayv2_api_authorizers_enabled.metadata.json

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
11
{
22
"Provider": "aws",
33
"CheckID": "apigatewayv2_api_authorizers_enabled",
4-
"CheckTitle": "Checks if API Gateway V2 has configured authorizers.",
4+
"CheckTitle": "API Gateway V2 API has an authorizer configured",
55
"CheckAliases": [
66
"apigatewayv2_authorizers_enabled"
77
],
88
"CheckType": [
9-
"Logging and Monitoring"
9+
"Software and Configuration Checks/AWS Security Best Practices",
10+
"TTPs/Initial Access",
11+
"Effects/Data Exposure"
1012
],
1113
"ServiceName": "apigatewayv2",
1214
"SubServiceName": "",
13-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
15+
"ResourceIdTemplate": "",
1416
"Severity": "medium",
1517
"ResourceType": "AwsApiGatewayV2Api",
16-
"Description": "Checks if API Gateway V2 has configured authorizers.",
17-
"Risk": "If no authorizer is enabled anyone can use the service.",
18+
"Description": "**API Gateway v2 APIs** use **authorizers** (JWT/Cognito or Lambda) to authenticate requests. This evaluates whether an API has an authorizer configured to control access to its routes.",
19+
"Risk": "Without an authorizer, anyone can invoke routes.\n- Confidentiality: exposure of data and metadata\n- Integrity: unauthorized state changes or actions\n- Availability/Cost: automated abuse of backends, traffic spikes, and unexpected spend",
1820
"RelatedUrl": "",
21+
"AdditionalURLs": [
22+
"https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html",
23+
"https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html",
24+
"https://support.icompaas.com/support/solutions/articles/62000127114-ensure-api-gateway-has-configured-authorizers"
25+
],
1926
"Remediation": {
2027
"Code": {
21-
"CLI": "",
22-
"NativeIaC": "",
23-
"Other": "",
24-
"Terraform": ""
28+
"CLI": "aws apigatewayv2 create-authorizer --api-id <API_ID> --authorizer-type REQUEST --name <example_resource_name> --authorizer-uri arn:aws:apigateway:<REGION>:lambda:path/2015-03-31/functions/<LAMBDA_FUNCTION_ARN>/invocations --identity-source '$request.header.Authorization'",
29+
"NativeIaC": "```yaml\n# CloudFormation: create a minimal Lambda authorizer for API Gateway v2\nResources:\n <example_resource_name>:\n Type: AWS::ApiGatewayV2::Authorizer\n Properties:\n ApiId: <example_resource_id>\n AuthorizerType: REQUEST # Critical: enables a Lambda REQUEST authorizer on the API\n AuthorizerUri: arn:aws:apigateway:<REGION>:lambda:path/2015-03-31/functions/<LAMBDA_FUNCTION_ARN>/invocations # Critical: Lambda authorizer function to invoke\n IdentitySource: # Critical: where to read the auth token from\n - \"$request.header.Authorization\"\n Name: <example_resource_name>\n```",
30+
"Other": "1. In the AWS Console, go to API Gateway > APIs and select your HTTP/WebSocket API\n2. In the left nav, click Authorizers > Create authorizer\n3. Choose Lambda as the authorizer type and select your Lambda function\n4. Set Identity source to: $request.header.Authorization\n5. Click Create to add the authorizer",
31+
"Terraform": "```hcl\n# Minimal AWS API Gateway v2 Lambda authorizer\nresource \"aws_apigatewayv2_authorizer\" \"<example_resource_name>\" {\n api_id = \"<example_resource_id>\"\n name = \"<example_resource_name>\"\n authorizer_type = \"REQUEST\" # Critical: creates a Lambda REQUEST authorizer\n authorizer_uri = \"arn:aws:apigateway:<REGION>:lambda:path/2015-03-31/functions/<LAMBDA_FUNCTION_ARN>/invocations\" # Critical: Lambda to invoke\n identity_sources = [\"$request.header.Authorization\"] # Critical: identity source for authorization\n}\n```"
2532
},
2633
"Recommendation": {
27-
"Text": "Implement Amazon Cognito or a Lambda function to control access to your API",
28-
"Url": "https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html"
34+
"Text": "Enable an **authorizer** (JWT/Cognito or Lambda) so only authenticated principals can invoke routes.\n- Enforce **least privilege** with scopes/claims or policy decisions\n- Apply **defense in depth** with resource policies, throttling, and WAF\n- Avoid public routes unless explicitly required",
35+
"Url": "https://hub.prowler.com/check/apigatewayv2_api_authorizers_enabled"
2936
}
3037
},
31-
"Categories": [],
38+
"Categories": [
39+
"identity-access"
40+
],
3241
"DependsOn": [],
3342
"RelatedTo": [],
3443
"Notes": ""

0 commit comments

Comments
 (0)