Skip to content

storage_encrypted = false#36

Open
tomerBZ wants to merge 1 commit intomasterfrom
tomerBZ-patch-23
Open

storage_encrypted = false#36
tomerBZ wants to merge 1 commit intomasterfrom
tomerBZ-patch-23

Conversation

@tomerBZ
Copy link
Owner

@tomerBZ tomerBZ commented Mar 14, 2024

No description provided.

Copy link

@bridgecrew-dev bridgecrew-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bridgecrew has found errors in this PR ⬇️

git_repo = "terragoat"
yor_trace = "d33c9292-952b-4c1f-9973-b6dbad519461"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure RDS clusters have an AWS Backup backup plan
    Resource: aws_rds_cluster.app2-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_49 | Checkov ID: CKV2_AWS_8

How to Fix

resource "aws_rds_cluster" "rds_cluster_good" {
  cluster_identifier      = "aurora-cluster-demo"
  engine                  = "aurora-mysql"
  engine_version          = "5.7.mysql_aurora.2.03.2"
  availability_zones      = ["us-west-2a", "us-west-2b", "us-west-2c"]
  database_name           = "mydb"
  master_username         = "foo"
  master_password         = "bar"
}


resource "aws_backup_plan" "example" {
  name = "tf_example_backup_plan"

  rule {
    rule_name         = "tf_example_backup_rule"
    target_vault_name = "vault-name"
    schedule          = "cron(0 12 * * ? *)"
  }
}

resource "aws_backup_selection" "backup_good" {
  iam_role_arn = "arn:partition:service:region:account-id:resource-id"
  name         = "tf_example_backup_selection"
  plan_id      = aws_backup_plan.example.id

  resources = [
    aws_rds_cluster.rds_cluster_good.arn
  ]
}

Description

Ensure that RDS clusters are included in your backup plans for the AWS Backup. AWS Backup is a fully managed backup service that helps you protect your data in the cloud by automatically backing up your data to a secure, durable storage location. By creating a backup plan, you can ensure that your data is regularly backed up and can be recovered in the event of data loss or corruption.

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure RDS clusters have an AWS Backup backup plan
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_49 | Checkov ID: CKV2_AWS_8

How to Fix

resource "aws_rds_cluster" "rds_cluster_good" {
  cluster_identifier      = "aurora-cluster-demo"
  engine                  = "aurora-mysql"
  engine_version          = "5.7.mysql_aurora.2.03.2"
  availability_zones      = ["us-west-2a", "us-west-2b", "us-west-2c"]
  database_name           = "mydb"
  master_username         = "foo"
  master_password         = "bar"
}


resource "aws_backup_plan" "example" {
  name = "tf_example_backup_plan"

  rule {
    rule_name         = "tf_example_backup_rule"
    target_vault_name = "vault-name"
    schedule          = "cron(0 12 * * ? *)"
  }
}

resource "aws_backup_selection" "backup_good" {
  iam_role_arn = "arn:partition:service:region:account-id:resource-id"
  name         = "tf_example_backup_selection"
  plan_id      = aws_backup_plan.example.id

  resources = [
    aws_rds_cluster.rds_cluster_good.arn
  ]
}

Description

Ensure that RDS clusters are included in your backup plans for the AWS Backup. AWS Backup is a fully managed backup service that helps you protect your data in the cloud by automatically backing up your data to a secure, durable storage location. By creating a backup plan, you can ensure that your data is regularly backed up and can be recovered in the event of data loss or corruption.

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure RDS instances have backup policy
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_46 | Checkov ID: CKV_AWS_133

How to Fix

resource "aws_rds_cluster" "test" {
  ...
+ backup_retention_period = 35
}

Description

This check examines the attribute **backup_retention_period** this should have a value 1-35, and checks if its set to 0 which would disable the backup.

This check is currently under review and maybe suppressed in future releases.

git_repo = "terragoat"
yor_trace = "d33c9292-952b-4c1f-9973-b6dbad519461"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure that RDS Cluster audit logging is enabled for MySQL engine
    Resource: aws_rds_cluster.app2-rds-cluster | Bridgecrew ID: BC_AWS_LOGGING_44 | Checkov ID: CKV_AWS_325

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure that RDS Cluster audit logging is enabled for MySQL engine
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_LOGGING_44 | Checkov ID: CKV_AWS_325

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM  Ensure that RDS Cluster log capture is enabled
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_LOGGING_43 | Checkov ID: CKV_AWS_324

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM  Ensure that RDS Aurora Clusters have backtracking enabled
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_233 | Checkov ID: CKV_AWS_326

git_repo = "terragoat"
yor_trace = "d33c9292-952b-4c1f-9973-b6dbad519461"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM  Ensure that RDS Aurora Clusters have backtracking enabled
    Resource: aws_rds_cluster.app2-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_233 | Checkov ID: CKV_AWS_326

git_repo = "terragoat"
yor_trace = "d33c9292-952b-4c1f-9973-b6dbad519461"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW  Ensure RDS cluster configured to copy tags to snapshots
    Resource: aws_rds_cluster.app2-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_225 | Checkov ID: CKV_AWS_313

git_repo = "terragoat"
yor_trace = "b6f2c2ec-0715-46a0-83d4-502e588826d1"
}
storage_encrypted = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
storage_encrypted = false
storage_encrypted = true
HIGH  Ensure all data stored in Aurora is securely encrypted at rest
    Resource: aws_rds_cluster.app1-rds-cluster | Bridgecrew ID: BC_AWS_GENERAL_38 | Checkov ID: CKV_AWS_96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant