Skip to content

Commit 8c043cb

Browse files
authored
Automation Toolkit Release v12
1 parent 801e0b8 commit 8c043cb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cd3_automation_toolkit/documentation/user_guide/learn_more/OPAForCompliance.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ Our carefully crafted policies act as gatekeepers, preventing any IAC deployment
2222
terraform plan -out tfplan.binary
2323
terraform show -json tfplan.binary > tfplan.json
2424

25-
4. Run the following command to evaluate the "deny_ingress_for_sl.rego" policy with a pretty output format:
25+
4. Run the terraform plan against all the available OPA rules. It should return an empty array which means the plan has no non-compliant action against CIS benchmarks.
2626

27-
opa eval -f pretty -d <OPA_POLICY_BUNDLE_DIR>/Networking/oci_deny_ingress_for_sl.rego -i <the_plan_json_file> data.terraform.deny
27+
opa eval -f pretty -b /cd3user/oci_tools/cd3_automation_toolkit/user-scripts/OPA -i tfplan.json data.terraform.deny --fail-defined
2828

29-
This command will analyze the "tfplan.json" input file against the policy and display the evaluation results with a user-friendly format.
29+
30+
Alternatively, run the following command to evaluate just a sinle OPA rule say "deny_ingress_for_sl.rego" policy with a pretty output format:
3031

32+
opa eval -f pretty -d /cd3user/oci_tools/cd3_automation_toolkit/user-scripts/OPA/Networking/oci_deny_ingress_for_sl.rego -i tfplan.json data.terraform.deny
3133

32-
5. Also, We can run only one cmd which will run the terraform plan against all the available OPA rules.It should return an empty array which means the plan has no non-compliant action against CIS benchmarks.
3334

34-
opa eval -f pretty -b <<OPA_POLICY_BUNDLE_DIR>> -i <the_plan_json_file> data.terraform.deny --fail-defined
35+
This command will analyze the "tfplan.json" input file against the policy and display the evaluation results with a user-friendly format.

0 commit comments

Comments
 (0)