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 'Network ACL With Unrestricted Access …
…To SSH' query Checkmarx#4289 Signed-off-by: Felipe Avelar <[email protected]>
- Loading branch information
1 parent
d69239b
commit 9f1b3e4
Showing
5 changed files
with
116 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
assets/queries/terraform/aws/network_acl_with_unrestricted_access_to_ssh/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,19 @@ | ||
module "vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "3.7.0" | ||
|
||
name = "my-vpc" | ||
cidr = "10.0.0.0/16" | ||
|
||
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] | ||
|
||
enable_nat_gateway = true | ||
enable_vpn_gateway = true | ||
|
||
tags = { | ||
Terraform = "true" | ||
Environment = "dev" | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
assets/queries/terraform/aws/network_acl_with_unrestricted_access_to_ssh/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,38 @@ | ||
module "vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "3.7.0" | ||
|
||
name = "my-vpc" | ||
cidr = "10.0.0.0/16" | ||
|
||
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] | ||
|
||
default_network_acl_ingress = [ | ||
{ | ||
"action" : "allow", | ||
"cidr_block" : "0.0.0.0/0", | ||
"from_port" : 0, | ||
"protocol" : "-1", | ||
"rule_no" : 100, | ||
"to_port" : 0 | ||
}, | ||
{ | ||
"action" : "allow", | ||
"cidr_block" : "10.3.0.0/18", | ||
"from_port" : 0, | ||
"protocol" : "-1", | ||
"rule_no" : 22, | ||
"to_port" : 0 | ||
} | ||
] | ||
|
||
enable_nat_gateway = true | ||
enable_vpn_gateway = true | ||
|
||
tags = { | ||
Terraform = "true" | ||
Environment = "dev" | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
assets/queries/terraform/aws/network_acl_with_unrestricted_access_to_ssh/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,30 @@ | ||
module "vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "3.7.0" | ||
|
||
name = "my-vpc" | ||
cidr = "10.0.0.0/16" | ||
|
||
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] | ||
|
||
default_network_acl_ingress = [ | ||
{ | ||
"action" : "allow", | ||
"cidr_block" : "0.0.0.0/0", | ||
"from_port" : 0, | ||
"protocol" : "tcp", | ||
"rule_no" : 22, | ||
"to_port" : 0 | ||
} | ||
] | ||
|
||
enable_nat_gateway = true | ||
enable_vpn_gateway = true | ||
|
||
tags = { | ||
Terraform = "true" | ||
Environment = "dev" | ||
} | ||
} |
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