# ##################################### ## Gherkin ## ##################################### # Rule Identifier: # RDS_STORAGE_ENCRYPTED # # Description: # Checks whether storage encryption is enabled for your RDS DB instances. # # # Reports on: # AWS::RDS::DBInstance # # Evaluates: # AWS CloudFormation # # Rule Parameters: # NA # # Scenarios: # a) SKIP: when there are no RDS instances present # b) PASS: when all RDS instances have StorageEncrypted set to true # c) FAIL: when all RDS instances have StorageEncrypted set to false # d) FAIL: when there are RDS instances with StorageEncrypted property is not present # e) SKIP: when metadata includes the suppression for rule RDS_STORAGE_ENCRYPTED # # Select all RDS instance resources from incoming template (payload) # let aws_rds_instances_storage_encrypted = Resources.*[ Type == 'AWS::RDS::DBInstance' Metadata.guard.SuppressedRules not exists or Metadata.guard.SuppressedRules.* != "RDS_STORAGE_ENCRYPTED" ] rule RDS_STORAGE_ENCRYPTED when %aws_rds_instances_storage_encrypted !empty { %aws_rds_instances_storage_encrypted.Properties.StorageEncrypted EXISTS %aws_rds_instances_storage_encrypted.Properties.StorageEncrypted == true << Violation: All RDS instances must have encrypted storage. Fix: Set the StorageEncrypted parameter to true. >> }