Open
Conversation
| DBInstanceClass: db.t3.micro | ||
| AllocatedStorage: 20 | ||
| MasterUsername: admin | ||
| MasterUsername: admin1 |
There was a problem hiding this comment.
Ensure no hard-coded secrets exist in EC2 user data
Resource: AWS::EC2::Instance.EC2Instance | ID: BC_AWS_SECRETS_1
How to Fix
resource "aws_instance" "web" {
ami = data.aws_ami.ubuntu.id
instance_type = "t3.micro"
- user_data = "access_key=123456ABCDEFGHIJZTLA and secret_key=AAAaa+Aa4AAaAA6aAkA0Ad+Aa8aA1aaaAAAaAaA"
tags = {
Name = "MyLovelyHorse"
}
}Description
**User Data** is a metadata field of an EC2 instance that allows custom code to run after the instance is launched. It contains code exposed to any entity which has the most basic access to EC2, even read-only configurations. This code is not encrypted.Removing secrets from easily-accessed unencrypted places reduces the risk of passwords, private keys and more from being exposed to third parties.
| DBInstanceClass: db.t3.micro | ||
| AllocatedStorage: 20 | ||
| MasterUsername: admin | ||
| MasterUsername: admin1 |
There was a problem hiding this comment.
Ensure all data stored in the RDS is securely encrypted at rest
Resource: AWS::RDS::DBInstance.DefaultDB | ID: BC_AWS_GENERAL_4
How to Fix
resource "aws_db_instance" "default" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
name = "mydb"
+ storage_encrypted = true
}
Description
AWS RDS is a managed DB service enabling quick deployment and management of MySQL, MariaDB, PostgreSQL, Oracle, and Microsoft SQL Server DB engines. Native RDS encryption helps protect your cloud applications and fulfils compliance requirements for data-at-rest encryption.Benchmarks
- PCI-DSS V3.2 3
- PCI-DSS V3.2.1 3.4
- FEDRAMP (MODERATE) SC-28
| DBInstanceClass: db.t3.micro | ||
| AllocatedStorage: 20 | ||
| MasterUsername: admin | ||
| MasterUsername: admin1 |
There was a problem hiding this comment.
Ensure that RDS instances have Multi-AZ enabled
Resource: AWS::RDS::DBInstance.DefaultDB | ID: BC_AWS_GENERAL_73
How to Fix
resource "aws_db_instance" "default" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
name = "mydb"
+ multi_az = true
}Description
Amazon RDS Multi-AZ deployments provide enhanced availability for databases within a single region. In the event of a planned or unplanned outage of your DB instance, Amazon RDS automatically switches to a standby replica in another Availability Zone if you have enabled Multi-AZ.RDS Multi-AZ deployments offer the following benefits:
- Enhanced durability.
- Increased availability.
- Protection of your database performance.
- Automatic failover.
| DBInstanceClass: db.t3.micro | ||
| AllocatedStorage: 20 | ||
| MasterUsername: admin | ||
| MasterUsername: admin1 |
There was a problem hiding this comment.
Ensure all data stored in the RDS bucket is not public accessible
Resource: AWS::RDS::DBInstance.DefaultDB | ID: BC_AWS_PUBLIC_2
How to Fix
resource "aws_rds_cluster" "default" {
cluster_identifier = var.cluster["cluster_identifier"]
engine_version = var.engine_version
engine = var.engine
database_name = var.cluster["database_name"]
master_username = var.cluster["master_username"]
master_password = var.master_password
+ storage_encrypted = true
kms_key_id = var.kms_key_id
tags = var.common_tags
}Description
AWS RDS is a managed DB service enabling quick deployment and management of MySQL, MariaDB, PostgreSQL, Oracle, and Microsoft SQL Server DB engines. RDS native encryption helps protect your applications deployed in the cloud and easily fulfills compliance requirements for data-at-rest encryption.We recommend encrypting RDS functions as an additional layer of data to prevent unauthorized access to its storage.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.