-
Notifications
You must be signed in to change notification settings - Fork 2
Update ecs.tf #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prisma Cloud has found errors in this PR ⬇️
| name = "example" | ||
| } | ||
|
|
||
| resource "aws_ecs_cluster" "test" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS ECS cluster with container insights feature disabled
Resource: aws_ecs_cluster.test | ID: BC_AWS_LOGGING_11
How to Fix
resource "aws_ecs_cluster" "foo" {
...
name = "white-hart"
+ setting {
+ name = "containerInsights"
+ value = "enabled"
+ }
}Description
Container Insights can be used to collect, aggregate, and summarize metrics and logs from containerized applications and microservices. They can also be extended to collect metrics at the cluster, task, and service levels. Using Container Insights allows you to monitor, troubleshoot, and set alarms for all your Amazon ECS resources. It provides a simple to use native and fully managed service for managing ECS issues.We recommend that for existing clusters you use the AWS CLI; and for new clusters, you use either the Amazon ECS console, or the AWS CLI.
| deletion_window_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "example" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS resources that support tags do not have Tags
Resource: aws_cloudwatch_log_group.example | ID: BC_AWS_GENERAL_26
How to Fix
resource "aws_security_group" "sg" {
name = "my-sg"
...
+ tags = {
+ Environment = "dev"
+ Owner = "apps-team"
+ }
}Description
Many different types of AWS resources support tags. Tags allow you to add metadata to a resource to help identify ownership, perform cost / billing analysis, and to enrich a resource with other valuable information, such as descriptions and environment names. While there are many ways that tags can be used, we recommend you follow a tagging practice.View AWS's recommended tagging best practices here.
| deletion_window_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "example" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS CloudWatch Log groups not configured with definite retention days
Resource: aws_cloudwatch_log_group.example | ID: BC_AWS_LOGGING_13
How to Fix
resource "aws_cloudwatch_log_group" "example" {
...
name = "example"
+ retention_in_days = 90
}Description
Enabling CloudWatch retention establishes how long log events are kept in AWS CloudWatch Logs. Retention settings are assigned to CloudWatch log groups and the retention period assigned to a log group is applied to their log streams. Any data older than the current retention setting is deleted automatically. You can change the log retention for each log group at any time.Log data is stored in CloudWatch Logs indefinitely by default, l. This may incur high unexpected costs, especially when combined with other forms of logging. We recommend you configure how long to store log data for in a log group to balance cost with compliance retention requirements.
Benchmarks
- FEDRAMP (MODERATE) AU-11, SI-12
| } | ||
| } | ||
|
|
||
| resource "aws_ecs_task_definition" "service" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS resources that support tags do not have Tags
Resource: aws_ecs_task_definition.service | ID: BC_AWS_GENERAL_26
How to Fix
resource "aws_security_group" "sg" {
name = "my-sg"
...
+ tags = {
+ Environment = "dev"
+ Owner = "apps-team"
+ }
}Description
Many different types of AWS resources support tags. Tags allow you to add metadata to a resource to help identify ownership, perform cost / billing analysis, and to enrich a resource with other valuable information, such as descriptions and environment names. While there are many ways that tags can be used, we recommend you follow a tagging practice.View AWS's recommended tagging best practices here.
| deletion_window_in_days = 7 | ||
| } | ||
|
|
||
| resource "aws_cloudwatch_log_group" "example" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS CloudWatch Log groups encrypted using default encryption key instead of KMS CMK
Resource: aws_cloudwatch_log_group.example | ID: BC_AWS_GENERAL_85
Description
Log group data requires mandatory encryption settings in CloudWatch Logs. Developers can optionally use AWS Key Management Service for this encryption. This approach has several limitations: - If you revoke CloudWatch Logs access to an associated CMK or delete an associated CMK, your encrypted data in CloudWatch Logs can no longer be retrieved. - You cannot associate a CMK with a log group using the CloudWatch console.| @@ -1,9 +1,47 @@ | |||
| resource "aws_kms_key" "example" { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS resources that support tags do not have Tags
Resource: aws_kms_key.example | ID: BC_AWS_GENERAL_26
How to Fix
resource "aws_security_group" "sg" {
name = "my-sg"
...
+ tags = {
+ Environment = "dev"
+ Owner = "apps-team"
+ }
}Description
Many different types of AWS resources support tags. Tags allow you to add metadata to a resource to help identify ownership, perform cost / billing analysis, and to enrich a resource with other valuable information, such as descriptions and environment names. While there are many ways that tags can be used, we recommend you follow a tagging practice.View AWS's recommended tagging best practices here.
| resource "aws_kms_key" "example" { | ||
| description = "example" | ||
| deletion_window_in_days = 7 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| enable_key_rotation = true | |
| } |
AWS Customer Master Key (CMK) rotation is not enabled
Resource: aws_kms_key.example | ID: BC_AWS_LOGGING_8
Description
AWS Key Management Service (KMS) allows customers to rotate the backing key. This is where key material is stored within the KMS, and tied to the key ID of the Customer Created customer master key (CMK). The backing key is used to perform cryptographic operations such as encryption and decryption. Automated key rotation currently retains all prior backing keys, allowing decryption of encrypted data to take place transparently.We recommend you enable CMK key rotation to help reduce the potential impact of a compromised key. Data encrypted with a new key cannot be accessed with a previous key, that may have been exposed.
Benchmarks
- PCI-DSS V3.2 3
- ISO27001 A.10.1.2
- CIS AWS V1.2 2.8
- PCI-DSS V3.2.1 3.6.4
- FEDRAMP (MODERATE) SC-12
- CIS AWS V1.3 3.8
| name = "example" | ||
| } | ||
|
|
||
| resource "aws_ecs_cluster" "test" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS resources that support tags do not have Tags
Resource: aws_ecs_cluster.test | ID: BC_AWS_GENERAL_26
How to Fix
resource "aws_security_group" "sg" {
name = "my-sg"
...
+ tags = {
+ Environment = "dev"
+ Owner = "apps-team"
+ }
}Description
Many different types of AWS resources support tags. Tags allow you to add metadata to a resource to help identify ownership, perform cost / billing analysis, and to enrich a resource with other valuable information, such as descriptions and environment names. While there are many ways that tags can be used, we recommend you follow a tagging practice.View AWS's recommended tagging best practices here.
No description provided.