You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,6 @@ Policies are written in [Rego](https://www.openpolicyagent.org/docs/latest/polic
22
22
23
23
Use the standardized per-resource payload generated by the Cloud Custodian plugin as policy input. The plugin evaluates one resource/check pair at a time with `schema_version: v2`; matched resources are marked `assessment.status: non_compliant`, and baseline resources that did not match the Cloud Custodian check are marked `assessment.status: compliant`.
24
24
25
+
Cloud Custodian policies may include a plugin-only `non_compliance_message` string. When a resource is marked `non_compliant`, that message is appended to the evidence description. The plugin removes this field before executing the Cloud Custodian policy.
26
+
25
27
Risk templates should dedupe by individual cloud resource using the payload labels `resource_type` and `resource_id`.
violation[{"id": unsupported_input_violation_id, "remarks": msg}] if {
309
+
non_compliant_remark :=sprintf("Resource %q failed Cloud Custodian policy %q (resource=%q); the resource was found by this policy run (matched=%v, inventory_status=%q, matched_resource_count=%v).", [resource_ref, raw_policy_name, raw_policy_resource, assessment_matched, inventory_status, matched_resource_count]) if {
310
+
is_non_compliant
311
+
}
312
+
313
+
execution_error_remark :=sprintf("Cloud Custodian policy %q ran with errors while evaluating resource %q (execution_status=%q, exit_code=%v). Errors: %s.", [raw_policy_name, resource_ref, execution_status, execution_exit_code, execution_error_details]) if {
314
+
is_execution_failed
315
+
}
316
+
317
+
unsupported_input_remark :=sprintf("Unsupported Cloud Custodian policy input: expected source=%q schema_version=%q but received source=%q schema_version=%q.", ["cloud-custodian", "v2", input_source, input_schema_version]) if {
318
+
not supported_input
319
+
}
320
+
321
+
violation[{"id": violation_id, "remarks": non_compliant_remark}] if {
322
+
is_non_compliant
323
+
}
324
+
325
+
violation[{"id": execution_violation_id, "remarks": execution_error_remark}] if {
326
+
is_execution_failed
327
+
}
328
+
329
+
violation[{"id": unsupported_input_violation_id, "remarks": unsupported_input_remark}] if {
330
+
not supported_input
331
+
}
332
+
333
+
remarks :=sprintf("%s %s", [non_compliant_remark, execution_error_remark]) if {
334
+
is_non_compliant
335
+
is_execution_failed
336
+
}
337
+
338
+
remarks := non_compliant_remark if {
339
+
is_non_compliant
340
+
not is_execution_failed
341
+
}
342
+
343
+
remarks := execution_error_remark if {
344
+
not is_non_compliant
345
+
is_execution_failed
346
+
}
347
+
348
+
remarks := unsupported_input_remark if {
256
349
not supported_input
257
-
msg :=sprintf("Unsupported Cloud Custodian policy input: expected source=%q schema_version=%q but received source=%q schema_version=%q.", ["cloud-custodian", "v2", input_source, input_schema_version])
258
350
}
259
351
260
352
title :="Cloud Custodian policy received unsupported input" if {
description :=sprintf("Cloud Custodian check %q evaluated resource %q with assessment status %q and execution status %q.", [check_name, resource_ref, assessment_status, execution_status]) if {
364
+
description_base :=sprintf("Cloud Custodian check %q failed for resource %q.", [check_name, resource_ref]) if {
365
+
supported_input
366
+
is_non_compliant
367
+
}
368
+
369
+
description_base :=sprintf("Cloud Custodian check %q could not evaluate resource %q.", [check_name, resource_ref]) if {
370
+
supported_input
371
+
not is_non_compliant
372
+
is_execution_failed
373
+
}
374
+
375
+
description_base :=sprintf("Cloud Custodian check %q passed for resource %q.", [check_name, resource_ref]) if {
0 commit comments