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

feat(rego): add result package #62

Closed
wants to merge 3 commits into from

Conversation

nikpivkin
Copy link
Contributor

@nikpivkin nikpivkin commented Jan 22, 2024

The purpose of this change is to improve testing of REGO policies by removing the dependency on trivy-iac and adding a new result package to the library.

Currently, it is not possible to test REGO policies because the result.new function that is used in all policies is declared in trivy-iac using the OPA sdk. This PR adds a new result package to the library, thus removing the dependency on trivy-iac.

Two functions have been moved:

  • is_managed - checks that the metadata is managed
  • new - returns structured result, which is needed for further analysis by the REGO policy scanner.

The new function signature remains the same, which ensures backward compatibility. The isManaged function has been renamed to is_managed.

@nikpivkin nikpivkin changed the title feat(rego): migrate result function from Go feat(rego): add result package Jan 22, 2024
@nikpivkin
Copy link
Contributor Author

This change will cause a backwards compatibility break for users who do not upgrade Trivy to a version that contains this change. Therefore, this PR will be in draft until a solution for this problem is found.

@nikpivkin nikpivkin closed this Oct 25, 2024
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.

1 participant