Add new security report builders

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds two new security report builder classes that allow us to build security reports of different types. The first class SecurityReportBuilder is the parent class from which the DependencyScanningReportBuilder and the ContainerScanningReportBuilder are meant to inherit from. They're scoped within the Gitlab::VulnerabilityScanning modules since they were design within the context of continuous vulnerability scanning, and as such only these classes were considered when evaluating what methods could be defined in the parent class. See the method analysis conducted for more information.

Additionally, the Gitlab::Ci::Reports::Sbom::Source class has been updated to include access methods for the fields in the GitLab Taxonomy. This makes it easier to access the data required to create the security report findings in the context of dependency scanning. Similarly, the parse_confidence and parse_severity methods have been moved to Enums::Vulnerability to allow them to be called as static methods, and to avoid duplicating the methods across the existing Gitlab::Ci::Reports::Security::Common class and the new builder classes.

In a separate MR, the rest of the functionality needed for a scanner class will be implemented e.g. the finder that's used to fetch the related advisories.

Relates to #408257 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Oscar Tovar

Merge request reports

Loading