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 policy with Cloud Custodian.
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 {
292
+
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 {
293
+
is_non_compliant
294
+
}
295
+
296
+
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 {
297
+
is_execution_failed
298
+
}
299
+
300
+
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 {
301
+
not supported_input
302
+
}
303
+
304
+
violation[{"id": violation_id, "remarks": non_compliant_remark}] if {
305
+
is_non_compliant
306
+
}
307
+
308
+
violation[{"id": execution_violation_id, "remarks": execution_error_remark}] if {
309
+
is_execution_failed
310
+
}
311
+
312
+
violation[{"id": unsupported_input_violation_id, "remarks": unsupported_input_remark}] if {
313
+
not supported_input
314
+
}
315
+
316
+
remarks :=sprintf("%s %s", [non_compliant_remark, execution_error_remark]) if {
317
+
is_non_compliant
318
+
is_execution_failed
319
+
}
320
+
321
+
remarks := non_compliant_remark if {
322
+
is_non_compliant
323
+
not is_execution_failed
324
+
}
325
+
326
+
remarks := execution_error_remark if {
327
+
not is_non_compliant
328
+
is_execution_failed
329
+
}
330
+
331
+
remarks := unsupported_input_remark if {
256
332
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
333
}
259
334
260
335
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 {
347
+
description_base :=sprintf("Cloud Custodian check %q failed for resource %q.", [check_name, resource_ref]) if {
348
+
supported_input
349
+
is_non_compliant
350
+
}
351
+
352
+
description_base :=sprintf("Cloud Custodian check %q could not evaluate resource %q.", [check_name, resource_ref]) if {
353
+
supported_input
354
+
not is_non_compliant
355
+
execution_status =="error"
356
+
}
357
+
358
+
description_base :=sprintf("Cloud Custodian check %q passed for resource %q.", [check_name, resource_ref]) if {
0 commit comments