forked from Checkmarx/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(query): Added modules to query 'Unrestricted Security Group Ingr…
…ess' (Checkmarx#4253) Signed-off-by: Felipe Avelar <[email protected]>
- Loading branch information
1 parent
0d27f73
commit be18968
Showing
13 changed files
with
138 additions
and
75 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
34 changes: 0 additions & 34 deletions
34
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/negative.tf
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/negative1.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,9 @@ | ||
resource "aws_security_group_rule" "negative1" { | ||
type = "ingress" | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.2.0/0"] | ||
security_group_id = aws_security_group.default.id | ||
} | ||
|
9 changes: 9 additions & 0 deletions
9
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/negative2.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,9 @@ | ||
resource "aws_security_group" "negative2" { | ||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.2.0/0"] | ||
security_group_id = aws_security_group.default.id | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
assets/queries/terraform/aws/unrestricted_security_group_ingress/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,15 @@ | ||
resource "aws_security_group" "negative3" { | ||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["1.0.0.0/0"] | ||
} | ||
|
||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.1.0/0"] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
assets/queries/terraform/aws/unrestricted_security_group_ingress/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,10 @@ | ||
module "web_server_sg" { | ||
source = "terraform-aws-modules/security-group/aws" | ||
version = "4.3.0" | ||
|
||
name = "web-server" | ||
description = "Security group for web-server with HTTP ports open within VPC" | ||
vpc_id = "vpc-12345678" | ||
|
||
ingress_cidr_blocks = ["10.10.0.0/16"] | ||
} |
34 changes: 0 additions & 34 deletions
34
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/positive.tf
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/positive1.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,8 @@ | ||
resource "aws_security_group_rule" "positive1" { | ||
type = "ingress" | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
security_group_id = aws_security_group.default.id | ||
} |
9 changes: 9 additions & 0 deletions
9
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/positive2.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,9 @@ | ||
resource "aws_security_group" "positive2" { | ||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
security_group_id = aws_security_group.default.id | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/positive3.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,15 @@ | ||
resource "aws_security_group" "positive3" { | ||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["1.0.0.0/0"] | ||
} | ||
|
||
ingress { | ||
from_port = 3306 | ||
to_port = 3306 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
assets/queries/terraform/aws/unrestricted_security_group_ingress/test/positive4.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,10 @@ | ||
module "web_server_sg" { | ||
source = "terraform-aws-modules/security-group/aws" | ||
version = "4.3.0" | ||
|
||
name = "web-server" | ||
description = "Security group for web-server with HTTP ports open within VPC" | ||
vpc_id = "vpc-12345678" | ||
|
||
ingress_cidr_blocks = ["0.0.0.0/0"] | ||
} |
10 changes: 10 additions & 0 deletions
10
assets/queries/terraform/aws/unrestricted_security_group_ingress/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,10 @@ | ||
module "web_server_sg" { | ||
source = "terraform-aws-modules/security-group/aws" | ||
version = "4.3.0" | ||
|
||
name = "web-server" | ||
description = "Security group for web-server with HTTP ports open within VPC" | ||
vpc_id = "vpc-12345678" | ||
|
||
ingress_cidr_blocks = ["10.10.0.0/16", "0.0.0.0/0"] | ||
} |
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