feat(parsers): add Xygeni JSON parser (SAST, SCA, Secrets)#14769
feat(parsers): add Xygeni JSON parser (SAST, SCA, Secrets)#14769lmrb-1968 wants to merge 2 commits intoDefectDojo:devfrom
Conversation
Add a single first-party parser at dojo/tools/xygeni/ that handles three Xygeni JSON report kinds (SAST, SCA, Secrets) by dispatching on metadata.scanType. Mirrors the multi-scan-type pattern of rusty_hog, anchore_grype, checkmarx and sonarqube. Pre-approval: DefectDojo#14755
|
At first glance it looks good, but shouldn't |
Wire the three Xygeni scan types into DEDUPLICATION_ALGORITHM_PER_PARSER in settings.dist.py so re-imports dedup against the vendor-stable uniqueHash instead of the legacy heuristic: - Xygeni SAST Scan, Xygeni Secrets Scan: DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL. - Xygeni SCA Scan: DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL_OR_HASH_CODE with HASHCODE_FIELDS_PER_SCANNER set to (vulnerability_ids, component_name, component_version) and HASHCODE_ALLOWS_NULL_CWE: True, enabling cross-tool dedup with other SCA parsers when a CVE matches a package at the same version. Document the per-scan-type algorithm in the parser docs page. Refs: DefectDojo#14755
|
Good catch, thanks @valentijnscholten, we missed to register ourselves entirely !
Updated Ran the Xygeni test suite via the project's |
Description
This PR adds a single first-party parser for Xygeni JSON reports under
dojo/tools/xygeni/. It dispatches onmetadata.scanTypeand exposes threescan types:
Xygeni SAST Scan,Xygeni SCA Scan,Xygeni Secrets Scan. Thepattern mirrors
rusty_hog,anchore_grype,checkmarx,sonarqube, andmobsf.Xygeni is a Software Supply Chain Security platform that
emits a JSON report per scanner. The full pre-approval discussion (with
field-mapping tables and example JSON per kind) is at #14755.
Opened as a draft because pre-approval is still pending — happy to wait
for maintainer feedback before any further action. The implementation is
provided here so reviewers can evaluate the concrete shape if helpful.
Test results
unittests/tools/test_xygeni_parser.pycovers:(501 SAST + 50 SCA + 61 Secrets findings)
metadata.scanTypefor a synthetic minimal reportmetadata.scanType, unsupported scan typeRun via the project's docker-compose unit-tests setup against real Postgres:
Result:
Ran 10 tests in 0.084s — OK.ruff checkis clean againstdojo/tools/xygeni/andunittests/tools/test_xygeni_parser.py.Documentation
Added at
docs/content/supported_tools/parsers/file/xygeni.md— covers allthree scan types, the common
metadataenvelope, the per-kind payload shapes,and links to the sample fixtures.
Checklist
dev.dev(new parser).Import Scansrequested — cannot self-apply as a non-collaborator.Pre-approval: #14755