Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds: in-file instrumentation for resource prioritizing #802

Conversation

Rchanger
Copy link
Contributor

@Rchanger Rchanger commented May 21, 2021

Adds: support for in-file instrumentation for prioritizing and deprioritizing resources for terraform and k8s IaC type.
#755

Min Severity
terraform - #ts:minseverity = "High"
 k8s - runterrascan.io/minseverity: High

Allowed values - High, Medium, Low

If High 
 then  Low  -> High && Medium -> High
If Medium 
  then Low -> Medium
If Low 
   then nothing
Max Severity
terraform - #ts:maxseverity = "None"
k8s - runterrascan.io/maxseverity: Low

Allowed values - None, High, Medium, Low

If None
 then skip all
If High
  then nothing
If Medium 
  then High -> Medium
If Low
  then High -> Low && Medium -> Low

@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #802 (20a0070) into master (a4d7af9) will increase coverage by 0.14%.
The diff coverage is 88.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
+ Coverage   74.85%   75.00%   +0.14%     
==========================================
  Files         111      111              
  Lines        3345     3404      +59     
==========================================
+ Hits         2504     2553      +49     
- Misses        656      663       +7     
- Partials      185      188       +3     
Impacted Files Coverage Δ
pkg/iac-providers/output/types.go 100.00% <ø> (ø)
pkg/policy/opa/engine.go 64.40% <37.50%> (-1.18%) ⬇️
pkg/utils/severity.go 94.11% <92.00%> (-5.89%) ⬇️
pkg/iac-providers/kubernetes/v1/normalize.go 90.47% <100.00%> (+2.41%) ⬆️
pkg/iac-providers/terraform/commons/resource.go 70.83% <100.00%> (+4.16%) ⬆️
pkg/config/config-reader.go 80.64% <0.00%> (-6.32%) ⬇️
pkg/iac-providers/helm/v3/load-dir.go 82.89% <0.00%> (ø)
pkg/iac-providers/kustomize/v3/types.go 100.00% <0.00%> (ø)
pkg/iac-providers/kubernetes/v1/types.go 100.00% <0.00%> (ø)
pkg/iac-providers/kustomize/v3/load-dir.go 71.69% <0.00%> (ø)
... and 1 more

@Rchanger Rchanger linked an issue May 21, 2021 that may be closed by this pull request
@Rchanger Rchanger force-pushed the sr_in_file_resource_prioritizing_deprioritizing branch from 2653799 to 59aa95d Compare May 26, 2021 14:27
@sonarcloud
Copy link

sonarcloud bot commented May 28, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@patilpankaj212 patilpankaj212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
We should also modify the existing image of resource skipping and add new images for prioritising resources.
Also, please create a separate PR fixing the pending tests.

@patilpankaj212 patilpankaj212 merged commit 5057073 into tenable:master May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In-file Instrumentation
2 participants