Skip to content

Enrich compliance findings: support additional levels, custom fields, and custom messages (esp. for OPA) #341

Open

Description

@haritzsaiz

Currently, the compliance findings returned to the frontend are constrained by hardcoded logic in CBOMKit’s Java layer. External policy engines such as OPA can influence only a predefined set of inputs, while the resulting compliance level and message are determined entirely by the Java implementation. This significantly limits the flexibility and expressiveness of custom policies.

I propose extending the findings model to support:

  1. Additional compliance levels

    Allow compliance levels beyond the currently defined IDs 1–4. For example, policies could introduce levels such as 5: Not Relevant or 5: Acceptable.

    CBOMKit could continue to define and support levels 1–4 by default while allowing additional levels to be introduced by external policies.

  2. Custom fields

    Allow policies executed by OPA to attach arbitrary key-value metadata to a finding. These fields should be preserved and returned through the API so that the frontend or other consumers can use them.

  3. Custom messages

    Allow policies to provide their own finding messages, either replacing or supplementing the message generated by CBOMKit.

    This capability may partially overlap with the proposed custom key-value fields, but it is worth considering because it would provide policies with direct control over the human-readable explanation presented to users.

Would you be open to a proposal like this? Would you need any support from my side?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions