kubewarden / kwctl

Go-to CLI tool for Kubewarden users
https://kubewarden.io
Apache License 2.0
73 stars 15 forks source link

Make kwctl aware of new severity and category annotations #529

Closed viccuad closed 1 year ago

viccuad commented 1 year ago

With the audit feature, we added support for new Policy Resource annotations (not to confuse with Policy metadata.yaml annotations), for policy severity and policy category. These are:

metadata:
  annotations:
    # one of critical, high, medium, low, info. Info is used when policy is in monitor mode
    # Empty by default, set by admin
    io.kubewarden.policy.severity: "high" 
    # freefrom string. Example: "PSP", "Sample", "Signing", "Other", "Compliance"
    # Empty by default, set by admin
    io.kubewarden.policy.category: "PSP"

Acceptance criteria

viccuad commented 1 year ago

kwctl annotate already gobbles the annotations, and annotates the policy correctly. The annotations appear also in kwctl inspect.

The missing part then is kwctl scaffold, so they are added to the object metadata.annotations, if they are present.