-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6683 from Checkmarx/fix_6680
fix(query): ca certificate identifier is outdated tf aws
- Loading branch information
Showing
5 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
13 changes: 13 additions & 0 deletions
13
assets/queries/terraform/aws/ca_certificate_identifier_is_outdated/test/negative3.tf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
resource "aws_db_instance" "negative1" { | ||
allocated_storage = 20 | ||
storage_type = "gp2" | ||
engine = "mysql" | ||
engine_version = "5.7" | ||
instance_class = "db.t2.micro" | ||
name = "mydb" | ||
username = "foo" | ||
password = "foobarbaz" | ||
iam_database_authentication_enabled = true | ||
storage_encrypted = true | ||
ca_cert_identifier = "rds-ca-rsa2048-g1" | ||
} |
75 changes: 75 additions & 0 deletions
75
assets/queries/terraform/aws/ca_certificate_identifier_is_outdated/test/negative4.tf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
module "db" { | ||
source = "terraform-aws-modules/rds/aws" | ||
version = "~> 3.0" | ||
|
||
identifier = "demodb" | ||
|
||
engine = "mysql" | ||
engine_version = "5.7.19" | ||
instance_class = "db.t2.large" | ||
allocated_storage = 5 | ||
ca_cert_identifier = "rds-ca-rsa4096-g1" | ||
|
||
name = "demodb" | ||
username = "user" | ||
password = "YourPwdShouldBeLongAndSecure!" | ||
port = "3306" | ||
|
||
iam_database_authentication_enabled = true | ||
|
||
vpc_security_group_ids = ["sg-12345678"] | ||
|
||
maintenance_window = "Mon:00:00-Mon:03:00" | ||
backup_window = "03:00-06:00" | ||
|
||
# Enhanced Monitoring - see example for details on how to create the role | ||
# by yourself, in case you don't want to create it automatically | ||
monitoring_interval = "30" | ||
monitoring_role_name = "MyRDSMonitoringRole" | ||
create_monitoring_role = true | ||
|
||
tags = { | ||
Owner = "user" | ||
Environment = "dev" | ||
} | ||
|
||
# DB subnet group | ||
subnet_ids = ["subnet-12345678", "subnet-87654321"] | ||
|
||
# DB parameter group | ||
family = "mysql5.7" | ||
|
||
# DB option group | ||
major_engine_version = "5.7" | ||
|
||
# Database Deletion Protection | ||
deletion_protection = true | ||
|
||
parameters = [ | ||
{ | ||
name = "character_set_client" | ||
value = "utf8mb4" | ||
}, | ||
{ | ||
name = "character_set_server" | ||
value = "utf8mb4" | ||
} | ||
] | ||
|
||
options = [ | ||
{ | ||
option_name = "MARIADB_AUDIT_PLUGIN" | ||
|
||
option_settings = [ | ||
{ | ||
name = "SERVER_AUDIT_EVENTS" | ||
value = "CONNECT" | ||
}, | ||
{ | ||
name = "SERVER_AUDIT_FILE_ROTATIONS" | ||
value = "37" | ||
}, | ||
] | ||
}, | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
assets/queries/terraform/aws/ca_certificate_identifier_is_outdated/test/negative5.tf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
resource "aws_db_instance" "negative1" { | ||
allocated_storage = 20 | ||
storage_type = "gp2" | ||
engine = "mysql" | ||
engine_version = "5.7" | ||
instance_class = "db.t2.micro" | ||
name = "mydb" | ||
username = "foo" | ||
password = "foobarbaz" | ||
iam_database_authentication_enabled = true | ||
storage_encrypted = true | ||
ca_cert_identifier = "rds-ca-ecc384-g1" | ||
} |