Use Pipeline Variables in Stage level OPA policies
pending feedback
L
Lavender Armadillo
I'm using the code coverage policy mentioned in https://developer.harness.io/docs/security-testing-orchestration/policies/create-opa-policies#block-the-pipeline-based-on-the-code-coverage-results, in one of my pipelines.
But instead of the hardcoded threshold value for comparison, I would like to use a pipeline variable.
I understand that this feature is currently not available in harness.
Can you please help.
Regards,
Janish
Log In
Pritesh Chandaliya
Lavender Armadillo pls check if this is useful. Thanks!
L
Lavender Armadillo
Hi Pritesh,
I'm trying to make the 'threshold value' eg: 'CODE_COVERAGE' value as dynamic value, based on the pipeline variables/stage variables. Or the alternative is pick to a OPA dynamically based on the pipeline variables/stage variables.
Can you please help.
Pritesh Chandaliya
pending feedback
Hello Janish,
Yes, you can use a pipeline variable instead of hard hard-coded value for comparison anyway.
Please refer docs on how to use the pipeline O/P variables in the OPA policy definition - https://developer.harness.io/docs/security-testing-orchestration/policies/create-opa-policies/#exclude-vulnerabilities-using-sto-output-variables
Please let me know, if you still face any issue or have more questions. Thanks!