-
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 #7098 from Checkmarx/tf_bug_security_groups
fix(query): security groups not used query with false positive in aws_elasticache_instance resources
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
assets/queries/terraform/aws/security_groups_not_used/test/negative6.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,23 @@ | ||
resource "aws_security_group" "example" { | ||
name = "example" | ||
description = "Allow Redis traffic" | ||
vpc_id = data.aws_vpc.selected.id | ||
|
||
ingress { | ||
|
||
from_port = 6379 | ||
to_port = 6379 | ||
protocol = "tcp" | ||
cidr_blocks = [data.aws_vpc.selected.cidr_block] | ||
} | ||
} | ||
|
||
resource "aws_elasticache_replication_group" "redis" { | ||
replication_group_id = "Example" | ||
parameter_group_name = "default.redis6.x" | ||
engine = "redis" | ||
engine_version = "6.x" | ||
automatic_failover_enabled = false | ||
|
||
security_group_ids = [aws_security_group.example.id] | ||
} |
22 changes: 22 additions & 0 deletions
22
assets/queries/terraform/aws/security_groups_not_used/test/positive5.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,22 @@ | ||
resource "aws_security_group" "example" { | ||
name = "example" | ||
description = "Allow Redis traffic" | ||
vpc_id = data.aws_vpc.selected.id | ||
|
||
ingress { | ||
|
||
from_port = 6379 | ||
to_port = 6379 | ||
protocol = "tcp" | ||
cidr_blocks = [data.aws_vpc.selected.cidr_block] | ||
} | ||
} | ||
|
||
resource "aws_elasticache_replication_group" "redis" { | ||
replication_group_id = "Example" | ||
parameter_group_name = "default.redis6.x" | ||
engine = "redis" | ||
engine_version = "6.x" | ||
automatic_failover_enabled = false | ||
|
||
} |
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