diff --git a/config/components/activity-policies/billingaccountbinding-policy.yaml b/config/components/activity-policies/billingaccountbinding-policy.yaml index 5dde449..330e370 100644 --- a/config/components/activity-policies/billingaccountbinding-policy.yaml +++ b/config/components/activity-policies/billingaccountbinding-policy.yaml @@ -18,12 +18,12 @@ spec: auditRules: - name: create-with-refs - match: "!audit.user.username.startsWith('system:') && audit.verb == 'create' && has(audit.requestObject.spec) && has(audit.requestObject.spec.projectRef) && has(audit.requestObject.spec.billingAccountRef)" + match: "!audit.user.username.startsWith('system:') && audit.verb == 'create' && has(audit.requestObject.spec) && has(audit.requestObject.spec.projectRef) && has(audit.requestObject.spec.projectRef.name) && has(audit.requestObject.spec.billingAccountRef) && has(audit.requestObject.spec.billingAccountRef.name)" summary: "{{ actor }} bound project {{ audit.requestObject.spec.projectRef.name }} to billing account {{ audit.requestObject.spec.billingAccountRef.name }}" - name: create-fallback match: "!audit.user.username.startsWith('system:') && audit.verb == 'create'" - summary: "{{ actor }} created billing account binding {{ link(audit.responseObject.metadata.name, audit.objectRef) }}" + summary: "{{ actor }} created billing account binding {{ has(audit.responseObject.metadata.name) ? link(audit.responseObject.metadata.name, audit.objectRef) : has(audit.objectRef.name) ? link(audit.objectRef.name, audit.objectRef) : (has(audit.responseObject.details) && has(audit.responseObject.details.name)) ? link(audit.responseObject.details.name, audit.objectRef) : link('a billing account binding', audit.objectRef) }}" - name: delete match: "!audit.user.username.startsWith('system:') && audit.verb == 'delete'"