-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. rule filtering 2. resource skipping 3. remote types
- Loading branch information
1 parent
7c3e008
commit f06d219
Showing
22 changed files
with
1,247 additions
and
85 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
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,2 @@ | ||
[severity] | ||
level = "test" |
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 @@ | ||
[rules] | ||
scan-rules = [ | ||
"AWS.RDS.DS.High.1041", | ||
"AWS.AWS RDS.NS.High.0101", | ||
"AWS.RDS.DataSecurity.High.0577" | ||
] | ||
skip-rules = [ | ||
"AWS.RDS.DataSecurity.High.0577" | ||
] |
29 changes: 29 additions & 0 deletions
29
test/e2e/scan/golden/resource_skipping/kubernetes_file_resource_skipping.txt
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,29 @@ | ||
{ | ||
"results": { | ||
"violations": null, | ||
"skipped_violations": [ | ||
{ | ||
"rule_name": "noOwnerLabel", | ||
"description": "No owner for namespace affects the operations", | ||
"rule_id": "AC-K8-OE-NS-L-0128", | ||
"severity": "LOW", | ||
"category": "Operational Efficiency", | ||
"skip_comment": "reason to skip the rule", | ||
"resource_name": "production", | ||
"resource_type": "kubernetes_namespace", | ||
"file": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/resource_skipping/kubernetes/config.yaml", | ||
"line": 1 | ||
} | ||
], | ||
"scan_summary": { | ||
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/resource_skipping/kubernetes", | ||
"iac_type": "k8s", | ||
"scanned_at": "2021-02-26 17:22:16.050445 +0000 UTC", | ||
"policies_validated": 53, | ||
"violated_policies": 0, | ||
"low": 0, | ||
"medium": 0, | ||
"high": 0 | ||
} | ||
} | ||
} |
142 changes: 142 additions & 0 deletions
142
test/e2e/scan/golden/resource_skipping/terraform_file_resource_skipping.txt
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,142 @@ | ||
{ | ||
"results": { | ||
"violations": [ | ||
{ | ||
"rule_name": "ec2UsingIMDSv1", | ||
"description": "EC2 instances should disable IMDS or require IMDSv2 as this can be related to the weaponization phase of kill chain", | ||
"rule_id": "AC-AWS-NS-IN-M-1172", | ||
"severity": "MEDIUM", | ||
"category": "Network Security", | ||
"resource_name": "instanceWithIMDv1_emptyblock", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 70 | ||
}, | ||
{ | ||
"rule_name": "ec2UsingIMDSv1", | ||
"description": "EC2 instances should disable IMDS or require IMDSv2 as this can be related to the weaponization phase of kill chain", | ||
"rule_id": "AC-AWS-NS-IN-M-1172", | ||
"severity": "MEDIUM", | ||
"category": "Network Security", | ||
"resource_name": "instanceWithIMDv1_fullblock", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 77 | ||
}, | ||
{ | ||
"rule_name": "ec2UsingIMDSv1", | ||
"description": "EC2 instances should disable IMDS or require IMDSv2 as this can be related to the weaponization phase of kill chain", | ||
"rule_id": "AC-AWS-NS-IN-M-1172", | ||
"severity": "MEDIUM", | ||
"category": "Network Security", | ||
"resource_name": "instanceWithIMDv1_endpoint_not_present", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 98 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"resource_name": "instanceWithNoVpc", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 51 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"resource_name": "instanceWithIMDv1_emptyblock", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 70 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"resource_name": "instanceWithIMDv1_fullblock", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 77 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"resource_name": "instanceWithIMDv1_endpoint_not_present", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 98 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"resource_name": "instanceWithPublicIp", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 61 | ||
} | ||
], | ||
"skipped_violations": [ | ||
{ | ||
"rule_name": "ec2UsingIMDSv1", | ||
"description": "EC2 instances should disable IMDS or require IMDSv2 as this can be related to the weaponization phase of kill chain", | ||
"rule_id": "AC-AWS-NS-IN-M-1172", | ||
"severity": "MEDIUM", | ||
"category": "Network Security", | ||
"skip_comment": "should skip this rule", | ||
"resource_name": "instanceWithPublicIp", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 61 | ||
}, | ||
{ | ||
"rule_name": "ec2UsingIMDSv1", | ||
"description": "EC2 instances should disable IMDS or require IMDSv2 as this can be related to the weaponization phase of kill chain", | ||
"rule_id": "AC-AWS-NS-IN-M-1172", | ||
"severity": "MEDIUM", | ||
"category": "Network Security", | ||
"skip_comment": "need to skip this rule", | ||
"resource_name": "instanceWithIMDv1_token_not_present", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 87 | ||
}, | ||
{ | ||
"rule_name": "instanceWithNoVpc", | ||
"description": "Ensure that your AWS application is not deployed within the default Virtual Private Cloud in order to follow security best practices", | ||
"rule_id": "AC-AW-IS-IN-M-0144", | ||
"severity": "MEDIUM", | ||
"category": "Infrastructure Security", | ||
"skip_comment": "can skip this rule", | ||
"resource_name": "instanceWithIMDv1_token_not_present", | ||
"resource_type": "aws_instance", | ||
"file": "main.tf", | ||
"line": 87 | ||
} | ||
], | ||
"scan_summary": { | ||
"file/folder": "/Users/apple/go/src/github.com/patilpankaj212/terrascan/test/e2e/test_data/iac/resource_skipping/terraform", | ||
"iac_type": "terraform", | ||
"scanned_at": "2021-02-26 17:05:56.671863 +0000 UTC", | ||
"policies_validated": 53, | ||
"violated_policies": 8, | ||
"low": 0, | ||
"medium": 8, | ||
"high": 0 | ||
} | ||
} | ||
} |
Oops, something went wrong.