Adjust security report models and ingestion for schema 15-0-0
Why are we doing this work
In #363134 (closed) we'll release version 15-0-0 of the security report schemas.
The following changes were flagged as requiring an update on the Rails side:
- Remove
vulnerabilities[].confidence. Confidence is marked as a required field on both the application layer and the database layer. - Remove
vulnerabilities[].scanner. We are currently using this property insecurity/common.rbwhile parsing the report and genarating the plain old ruby objects. The current logic fails if this property does not exist.
While the properties above are no longer present in 15-0-0, they are still allowed in 14-x-x schemas. For each property, we need to either:
- Completely remove it in %15.4; OR
- Make it optional in %15.4 and remove them in %16.0 (create separate issue for removal if this path is chosen)
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
- MR 1: Make
confidenceoptional-
Model -
Add DB migration to make column optional/nullable
-
- MR 2: mark
confidencefield as deprecated-
VulnerabilityCreatemutationee/app/graphql/mutations/vulnerabilities/create.rb -
VulnerabilityConfidenceEnumee/app/graphql/types/vulnerability_confidence_enum.rb -
PipelineSecurityReportFindingtypeee/app/graphql/types/pipeline_security_report_finding_type.rb -
VulnerabilityREST APIee/lib/ee/api/entities/vulnerability.rb -
VulnerabilityFindingsREST APIee/lib/api/vulnerability_findings.rb
-
- MR 3: make
confidenceoptional for security report parsing-
create_findinginlib/gitlab/ci/parsers/security/common.rb
-
The scanner property will be handled in a separate issue: #371570 (closed).
Verification steps
Edited by Thiago Figueiró