forked from aquasecurity/tfsec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is primarily to get aquasecurity/defsec#1338 I'm following https://github.com/aquasecurity/tfsec/blob/master/CONTRIBUTING.md
- Loading branch information
1 parent
39a6d2e
commit fd56c11
Showing
51 changed files
with
1,827 additions
and
58 deletions.
There are no files selected for viewing
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
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,86 @@ | ||
--- | ||
title: Ensure that response caching is enabled for your Amazon API Gateway REST APIs. | ||
--- | ||
|
||
# Ensure that response caching is enabled for your Amazon API Gateway REST APIs. | ||
|
||
### Default Severity: <span class="severity low">low</span> | ||
|
||
### Explanation | ||
|
||
A REST API in API Gateway is a collection of resources and methods that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can enable API caching in Amazon API Gateway to cache your endpoint responses. With caching, you can reduce the number of calls made to your endpoint and also improve the latency of requests to your API. | ||
|
||
### Possible Impact | ||
Reduce the number of calls made to your API endpoint and also improve the latency of requests to your API with response caching. | ||
|
||
### Suggested Resolution | ||
Enable cache | ||
|
||
|
||
### Insecure Example | ||
|
||
The following example will fail the aws-api-gateway-enable-cache check. | ||
```terraform | ||
resource "aws_api_gateway_rest_api" "example" { | ||
} | ||
resource "aws_api_gateway_stage" "example" { | ||
rest_api_id = aws_api_gateway_rest_api.example.id | ||
} | ||
resource "aws_api_gateway_method_settings" "bad_example" { | ||
rest_api_id = aws_api_gateway_rest_api.example.id | ||
stage_name = aws_api_gateway_stage.example.stage_name | ||
method_path = "path1/GET" | ||
settings { | ||
metrics_enabled = true | ||
logging_level = "INFO" | ||
caching_enabled = false | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
### Secure Example | ||
|
||
The following example will pass the aws-api-gateway-enable-cache check. | ||
```terraform | ||
resource "aws_api_gateway_rest_api" "example" { | ||
} | ||
resource "aws_api_gateway_stage" "example" { | ||
} | ||
resource "aws_api_gateway_method_settings" "good_example" { | ||
rest_api_id = aws_api_gateway_rest_api.example.id | ||
stage_name = aws_api_gateway_stage.example.stage_name | ||
method_path = "path1/GET" | ||
settings { | ||
metrics_enabled = true | ||
logging_level = "INFO" | ||
caching_enabled = true | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
### Links | ||
|
||
|
||
- [https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_settings#cache_enabled](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_method_settings#cache_enabled){:target="_blank" rel="nofollow noreferrer noopener"} | ||
|
||
- [https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html){:target="_blank" rel="nofollow noreferrer noopener"} | ||
|
||
|
||
|
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
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
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
29 changes: 29 additions & 0 deletions
29
docs/checks/aws/ec2/require-vpc-flow-logs-for-all-vpcs/index.md
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 @@ | ||
--- | ||
title: VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. After you've created a flow log, you can view and retrieve its data in Amazon CloudWatch Logs. It is recommended that VPC Flow Logs be enabled for packet "Rejects" for VPCs. | ||
--- | ||
|
||
# VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. After you've created a flow log, you can view and retrieve its data in Amazon CloudWatch Logs. It is recommended that VPC Flow Logs be enabled for packet "Rejects" for VPCs. | ||
|
||
### Default Severity: <span class="severity medium">medium</span> | ||
|
||
### Explanation | ||
|
||
VPC Flow Logs provide visibility into network traffic that traverses the VPC and can be used to detect anomalous traffic or insight during security workflows. | ||
|
||
### Possible Impact | ||
Without VPC flow logs, you risk not having enough information about network traffic flow to investigate incidents or identify security issues. | ||
|
||
### Suggested Resolution | ||
Enable flow logs for VPC | ||
|
||
|
||
|
||
|
||
|
||
### Links | ||
|
||
|
||
- [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/RootDeviceStorage.html](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/RootDeviceStorage.html){:target="_blank" rel="nofollow noreferrer noopener"} | ||
|
||
|
||
|
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
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
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,57 @@ | ||
--- | ||
title: A MSK cluster allows unencrypted data at rest. | ||
--- | ||
|
||
# A MSK cluster allows unencrypted data at rest. | ||
|
||
### Default Severity: <span class="severity high">high</span> | ||
|
||
### Explanation | ||
|
||
Encryption should be forced for Kafka clusters, including at rest. This ensures sensitive data is kept private. | ||
|
||
### Possible Impact | ||
Intercepted data can be read at rest | ||
|
||
### Suggested Resolution | ||
Enable at rest encryption | ||
|
||
|
||
### Insecure Example | ||
|
||
The following example will fail the aws-msk-enable-at-rest-encryption check. | ||
```terraform | ||
resource "aws_msk_cluster" "bad_example" { | ||
encryption_info { | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
### Secure Example | ||
|
||
The following example will pass the aws-msk-enable-at-rest-encryption check. | ||
```terraform | ||
resource "aws_msk_cluster" "good_example" { | ||
encryption_info { | ||
encryption_at_rest_kms_key_arn = "foo-bar-key" | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
### Links | ||
|
||
|
||
- [https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_cluster#encryption_info-argument-reference](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_cluster#encryption_info-argument-reference){:target="_blank" rel="nofollow noreferrer noopener"} | ||
|
||
- [https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html){:target="_blank" rel="nofollow noreferrer noopener"} | ||
|
||
|
||
|
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
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
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
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
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
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.