kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
191 stars 33 forks source link

audit-scanner: AdmissionPolicies annotation changes #461

Closed viccuad closed 1 year ago

viccuad commented 1 year ago

Acceptance criteria:

These changes should be done against the feat-audit branch.

flavio commented 1 year ago

I think we have to add also:

See https://github.com/kubewarden/audit-scanner/pull/47/files#r1221739092

viccuad commented 1 year ago

I can implement a GetTitle that returns metadata.annotation io.artifacthub.displayName if present. I can also implement GetDescription that returns metadata annotation io.kubewarden.policy.description if present.

I still don't see the need for a GetSubject. The UI shows the type of the ObjectReference that the policy evaluated. If we want to show all GVK the policy could evaluate, we could compute this from the rules, and indeed provide a GetSubject of sorts. But this is not shown by policy-reporter, and the Subject in policy-reporter is hardcoded to the GVK of the ObjectReference passed in the result.

flavio commented 1 year ago

I still don't see the need for a GetSubject. The UI shows the type of the ObjectReference that the policy evaluated. If we want to show all GVK the policy could evaluate, we could compute this from the rules, and indeed provide a GetSubject of sorts. But this is not shown by policy-reporter, and the Subject in policy-reporter is hardcoded to the GVK of the ObjectReference passed in the result.

Yes, that's the right approach. Scratch what I've said about the need to have a GetSubject