-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged API Gateway Stage Access Logging Settings Not Defined into API…
… Gateway Access Logging Disabled and corresponding unit tests
- Loading branch information
1 parent
67d10b1
commit 8ac0687
Showing
22 changed files
with
318 additions
and
304 deletions.
There are no files selected for viewing
22 changes: 11 additions & 11 deletions
22
assets/queries/cloudFormation/aws/api_gateway_access_logging_disabled/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"id": "999ecb35-10df-4d73-8f17-3f4b8c3beec5", | ||
"queryName": "API Gateway Access Logging Disabled", | ||
"severity": "MEDIUM", | ||
"category": "Observability", | ||
"descriptionText": "API Gateway should have Access Log Settings defined", | ||
"descriptionUrl": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html#cfn-apigateway-stage-accesslogsetting", | ||
"platform": "CloudFormation", | ||
"descriptionID": "d7151524", | ||
"cloudProvider": "aws", | ||
"cwe": "" | ||
} | ||
"id": "80d45af4-4920-4236-a56e-b7ef419d1941", | ||
"queryName": "API Gateway Access Logging Disabled", | ||
"severity": "MEDIUM", | ||
"category": "Observability", | ||
"descriptionText": "API Gateway Stage should have Access Logging Settings defined", | ||
"descriptionUrl": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-accesslogsettings", | ||
"platform": "CloudFormation", | ||
"descriptionID": "2a69fc63", | ||
"cloudProvider": "aws", | ||
"cwe": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
35 changes: 19 additions & 16 deletions
35
assets/queries/cloudFormation/aws/api_gateway_access_logging_disabled/test/negative2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09T00:00:00Z", | ||
"Resources": { | ||
"NewAmpApp-1": { | ||
"Type": "AWS::Amplify::App", | ||
"MyStage": { | ||
"Type": "AWS::ApiGatewayV2::Stage", | ||
"Properties": { | ||
"OauthToken": "String", | ||
"Repository": "String", | ||
"BasicAuthConfig": { | ||
"Username": "admin", | ||
"EnableBasicAuth": true, | ||
"Password": "@skdsjdk0234!AB" | ||
"StageName": "Prod", | ||
"Description": "Prod Stage", | ||
"DeploymentId": "MyDeployment", | ||
"ApiId": "CFNWebSocket", | ||
"DefaultRouteSettings": { | ||
"DetailedMetricsEnabled": true, | ||
"LoggingLevel": "INFO", | ||
"DataTraceEnabled": false, | ||
"ThrottlingBurstLimit": 10, | ||
"ThrottlingRateLimit": 10 | ||
}, | ||
"CustomHeaders": "String", | ||
"Description": "String", | ||
"Name": "NewAmpApp", | ||
"BuildSpec": "String", | ||
"EnableBranchAutoDeletion": true, | ||
"IAMServiceRole": "String" | ||
"AccessLogSettings": { | ||
"DestinationArn": "arn:aws:logs:us-east-1:123456789:log-group:my-log-group", | ||
"Format": "{\"requestId\":\"$context.requestId\", \"ip\": \"$context.identity.sourceIp\", \"caller\":\"$context.identity.caller\", \"user\":\"$context.identity.user\",\"requestTime\":\"$context.requestTime\", \"eventType\":\"$context.eventType\",\"routeKey\":\"$context.routeKey\", \"status\":\"$context.status\",\"connectionId\":\"$context.connectionId\"}" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "Router53" | ||
} |
44 changes: 24 additions & 20 deletions
44
assets/queries/cloudFormation/aws/api_gateway_access_logging_disabled/test/negative3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Resources": { | ||
"MyStage": { | ||
"Type": "AWS::ApiGateway::Stage", | ||
"Properties": { | ||
"StageName": "Prod", | ||
"Description": "Prod Stage", | ||
"AccessLogSetting": { | ||
"DestinationArn": "dest", | ||
"Format": "format" | ||
}, | ||
"DeploymentId": { | ||
"Ref": "MyDeployment" | ||
}, | ||
"RestApiId": { | ||
"Ref": "CFNWebSocket" | ||
} | ||
} | ||
} | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "Router53", | ||
"Resources": { | ||
"MyStage": { | ||
"Type": "AWS::ApiGatewayV2::Stage", | ||
"Properties": { | ||
"Description": "Prod Stage", | ||
"AccessLogSettings": { | ||
"DestinationArn": "dest", | ||
"Format": "format" | ||
}, | ||
"DeploymentId": "MyDeployment", | ||
"ApiId": "CFNWebSocket", | ||
"DefaultRouteSettings": { | ||
"ThrottlingBurstLimit": 10, | ||
"ThrottlingRateLimit": 10, | ||
"DetailedMetricsEnabled": true, | ||
"LoggingLevel": "INFO", | ||
"DataTraceEnabled": false | ||
}, | ||
"StageName": "Prod" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
assets/queries/cloudFormation/aws/api_gateway_access_logging_disabled/test/negative6.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09T00:00:00Z", | ||
"Resources": { | ||
"NewAmpApp-1": { | ||
"Type": "AWS::Amplify::App", | ||
"Properties": { | ||
"OauthToken": "String", | ||
"Repository": "String", | ||
"BasicAuthConfig": { | ||
"Username": "admin", | ||
"EnableBasicAuth": true, | ||
"Password": "String" | ||
}, | ||
"CustomHeaders": "String", | ||
"Description": "String", | ||
"Name": "NewAmpApp", | ||
"BuildSpec": "String", | ||
"EnableBranchAutoDeletion": true, | ||
"IAMServiceRole": "String" | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
assets/queries/cloudFormation/aws/api_gateway_access_logging_disabled/test/negative7.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Resources": { | ||
"MyStage": { | ||
"Type": "AWS::ApiGateway::Stage", | ||
"Properties": { | ||
"StageName": "Prod", | ||
"Description": "Prod Stage", | ||
"AccessLogSetting": { | ||
"DestinationArn": "dest", | ||
"Format": "format" | ||
}, | ||
"DeploymentId": { | ||
"Ref": "MyDeployment" | ||
}, | ||
"MethodSettings": { | ||
"DetailedMetricsEnabled": true, | ||
"LoggingLevel": "INFO", | ||
"DataTraceEnabled": false, | ||
"ThrottlingBurstLimit": 10, | ||
"ThrottlingRateLimit": 10 | ||
}, | ||
"RestApiId": { | ||
"Ref": "CFNWebSocket" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.