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

Added "id" field support & policy validation tests #843

Conversation

nasir-rabbani
Copy link
Contributor

  1. Updated RuleId identifying regex to accept new id pattern (AC_PROVIDER_XXXX, where X denotes a digit).
  2. Changed to Rule ID value in detailed report to id of metadata instead of reference_id
  3. Added Policy validation test to perform below checks:
    • Required fields are not empty
    • reference_id and id follows the accepted pattern
    • Referenced rego files are present

@nasir-rabbani nasir-rabbani linked an issue Jun 7, 2021 that may be closed by this pull request
@nasir-rabbani nasir-rabbani force-pushed the enhancement/policy_id_field_inclusion branch 6 times, most recently from b936d61 to fae195d Compare June 17, 2021 16:24
@nasir-rabbani nasir-rabbani force-pushed the enhancement/policy_id_field_inclusion branch from fae195d to 180b857 Compare June 18, 2021 06:58
@sonarcloud
Copy link

sonarcloud bot commented Jun 18, 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

@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #843 (180b857) into master (32a4c15) will decrease coverage by 0.07%.
The diff coverage is 45.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #843      +/-   ##
==========================================
- Coverage   78.29%   78.22%   -0.08%     
==========================================
  Files         164      165       +1     
  Lines        4359     4376      +17     
==========================================
+ Hits         3413     3423      +10     
- Misses        730      735       +5     
- Partials      216      218       +2     
Impacted Files Coverage Δ
pkg/policy/types.go 100.00% <ø> (ø)
pkg/utils/skip_rules.go 93.33% <ø> (ø)
pkg/policy/opa/engine.go 58.03% <28.57%> (-1.33%) ⬇️
pkg/policies/opa/rego/policy-test-util.go 42.85% <42.85%> (ø)
pkg/filters/filter-specs.go 87.09% <66.66%> (-5.22%) ⬇️
pkg/mapper/iac-providers/cft/mapper.go 93.89% <0.00%> (+3.05%) ⬆️

@nasir-rabbani nasir-rabbani marked this pull request as ready for review June 18, 2021 07:10
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!!

@kanchwala-yusuf kanchwala-yusuf merged commit 95b02c4 into tenable:master Jun 21, 2021
@nasir-rabbani nasir-rabbani deleted the enhancement/policy_id_field_inclusion branch August 13, 2021 16:23
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.

Add Support for new reference id field
3 participants