Skip to content

feat: Improve conversion of SARIF tags to OWASP secondary identifiers

Lucas Charles requested to merge more-flexible-owasp-metadata-handling into main

What does this MR do?

Previously the secondary identifiers derived from SARIF tags were generic by splitting their Type from Value, but OWASP identifiers may use a year-designation as well. To better support two separate OWASP categories we should introduce some be dedicated handling for generating these identifiers.

Why is this needed?

The goal, as outlined in semgrep!196 (closed) is to update our OWASP secondary identifiers to better reflect the specificity of Top10 categories, which are scoped to the issuing year. The basic format is A{number}:{year} - {Title}.

As described in this comment, we currently split the SARIF Tags on colons to generate the identifier Type and Value.

Instead we can use a standard format with minimal manipulation and be backwards compatible with the existing regex.

Additionally, this MR includes a change to the Name to include both the ID and description since the description is often not enough in isolation to be helpful. For example, in the UI it currently looks like this:

Screenshot_2023-02-28_at_15.45.53

Does this MR meet the acceptance criteria?

Edited by Vishwa Bhat

Merge request reports