Skip to content

Add Grafana security advisory importer#2200

Open
NucleiAv wants to merge 6 commits intoaboutcode-org:mainfrom
NucleiAv:fix/grafana-importer-1462
Open

Add Grafana security advisory importer#2200
NucleiAv wants to merge 6 commits intoaboutcode-org:mainfrom
NucleiAv:fix/grafana-importer-1462

Conversation

@NucleiAv
Copy link

@NucleiAv NucleiAv commented Mar 8, 2026

Closes #1462

It collects published security advisories for grafana/grafana, grafana/loki, credativ/plutono, and credativ/vali via the GitHub Security Advisory REST API.

The GHSA ID is the advisory_id; any associated CVE goes into aliases. Version ranges from the API come in as space-separated constraints like >=9.2.0 <9.2.10, which get normalized to comma-separated before passing to build_range_from_github_advisory_constraint. Advisories with no parseable range just produce empty affected_packages rather than erroring out. CVSS v3.1 vector and score go into severities, CWE IDs into weaknesses.

New files are grafana_importer.py, test_grafana_importer.py, fixtures under test_data/grafana/, and registration in IMPORTERS_REGISTRY.

@NucleiAv NucleiAv force-pushed the fix/grafana-importer-1462 branch from 765808c to 918f85b Compare March 8, 2026 05:24
NucleiAv and others added 2 commits March 8, 2026 03:09
Adds GrafanaImporterPipeline using the GitHub Security Advisory REST API.
Covers grafana/grafana, grafana/loki, credativ/plutono and credativ/vali.

- Parses GHSA IDs, CVE aliases, CVSS v3.1 scores, CWE weaknesses and
  version ranges from the API response
- Normalizes space-separated version constraints to comma-separated format
  before passing to build_range_from_github_advisory_constraint
- Skips advisories without a parseable version range rather than raising
- Registers GrafanaImporterPipeline in IMPORTERS_REGISTRY
- Includes JSON test fixtures and unit tests for parse_advisory_data

Closes aboutcode-org#1462

Signed-off-by: newklei <magmacicada@proton.me>
Signed-off-by: newklei <magmacicada@proton.me>
@NucleiAv NucleiAv force-pushed the fix/grafana-importer-1462 branch from 4d0aae7 to 481fb5b Compare March 8, 2026 07:09
NucleiAv added 2 commits March 8, 2026 12:04
Signed-off-by: newklei <magmacicada@proton.me>
Signed-off-by: newklei <magmacicada@proton.me>
@NucleiAv NucleiAv force-pushed the fix/grafana-importer-1462 branch from c803224 to 60e258f Compare March 9, 2026 16:43
…importer

- Removed repo_url class attribute (not part of the base class contract)
- Replaced datetime.strptime + timezone.utc with dateparser.parse() for
  consistency with the ZDI importer and flexibility with date formats
- Removed unused datetime and timezone stdlib imports

Signed-off-by: newklei <magmacicada@proton.me>
@NucleiAv NucleiAv force-pushed the fix/grafana-importer-1462 branch from 60e258f to 4c8780c Compare March 9, 2026 16:45
Signed-off-by: newklei <magmacicada@proton.me>
@NucleiAv NucleiAv force-pushed the fix/grafana-importer-1462 branch from 3976236 to af8756a Compare March 11, 2026 15:24
@NucleiAv NucleiAv closed this Mar 16, 2026
@NucleiAv NucleiAv deleted the fix/grafana-importer-1462 branch March 16, 2026 13:35
@NucleiAv NucleiAv restored the fix/grafana-importer-1462 branch March 16, 2026 13:38
@NucleiAv NucleiAv reopened this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collect Grafana vulnerabilities

1 participant