AWS RDS instance with copy tags to snapshots disabled misconfiguration detected in code
Rule Details
Cortex AppSec Rule ID
APPSEC2_AWS_60
Category - Subcategory
Monitoring - Tags and metadata
Provider
AWS
Severity
LOW
Framework
Terraform, Terraform Plan
Mapped CSPM/KSPM Rule
56b18fc7-71e4-4932-aba6-71b9d0c6cf5d
Impact
This rule ensures that tags are copied when creating snapshots of an Amazon RDS database instance. Tags are metadata that you can assign to AWS resources. They enable you to categorize resources in different ways, for example, by purpose, owner, or environment. When tags are copied to snapshots, it provides continuity and orderliness in managing resources, especially when using cost allocation reports.
How to Fix
Resource: aws_db_instance
Arguments: copy_tags_to_snapshot
The issue can be fixed by setting the copy_tags_to_snapshot attribute to true in the database instance resource block of the Terraform file.
Secure code example:
With copy_tags_to_snapshot set as true, all the tags assigned to the database instance will be copied onto any automated or manual snapshots of the database when the snapshots are created. This enables easy resource management and efficient cost allocation tracking. [source,go]
resource "aws_db_instance" "mysql" { name = "mydb" engine = "mysql" instance_class = "db.t3.micro" allocated_storage = "20" tags = {Name = "mydb"}
copy_tags_to_snapshot = true }
Last updated
Was this helpful?
