question: Where is the code for OPA data.lib.result package
I am looking at writing custom policies using Rego. However I am trying to test my policies with the opa cli
opa test . -v --explain=full
However, this library mentioned in the example is not included in my policy folder the opa complains about not knowing where to find it.
I was wondering where that file was so I could import it for test purposes.
Hi @xNok - you can find it here: https://github.com/aquasecurity/defsec/blob/master/internal/rules/defsec/lib/defsec.rego
It may be worth cloning the defsec repo and pulling in the rego contents of internal/rules
Thanks for the quick answer
I am not sure why you suggest cloning the entire repository. I was thinking of duplicating the result function and using tfsec --rego-policy-dir.
While I am here do you know if there is a way to include custom police in the vscode extension? It doesn't seem to be an option, maybe I should open a feature request?
To be honest I couldn't remember off the top of my head if there were other required library files.
You shouldn't need the result function to run it with tfsec, as tfsec has the result (and other rego files) baked into it.
As for the vscode extension, I don't think there is atm - @owenrumney can possibly confirm?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.