Skip to main content

Prometheus GitHub vulnerability alert exporter

This package exports the Security Vulnerability Alerts from GitHub for all repositories of an organization as Prometheus metrics.

Usage

Configure API token

You’ll need to provide an access token with scope repo to access the GitHub API. See the GitHub documentation for details.

Start HTTP service

Start the HTTP server like this:

$ GITHUB_AUTHTOKEN=MYTOKEN GITHUB_OWNER=MyGitHubOrgOrUser github_vulnerability_exporter --host=127.0.0.1 --port=9597

Pass --ttl=SECONDS to cache GitHub API results for the given time or -1 to disable (default is 600). Prometheus considers metrics stale after 300s, so that’s the highest scrape_interval one should use. However it’s usually unnecessary to hit the API that often, since the vulnerability alert information does not change that rapidly.

Pass --forked if you want to include forked repositories (not sure if they actually receive vulnerability alerts, though).

Configure Prometheus

scrape_configs:
  - job_name: 'vulnerabilities'
    scrape_interval: 300s
    static_configs:
      - targets: ['localhost:9597']

We export one metric, a gauge called github_vulnerability_alerts, with labels {repository="MyGitHubOrgOrUser/my-repository-name, status="active|dismissed"}.

Additionally, a ghvuln_scrape_duration_seconds gauge is exported.

CHANGES

1.5.2 (2023-04-11)

  • Brown-bag release

1.5.1 (2023-04-11)

  • Interpret “dismissedAt: unknown” as dismissed, not active

1.5.0 (2019-06-07)

  • Add in-memory caching so we don’t have to hit the API on each scrape

1.4.0 (2019-06-07)

  • Support collecting data for repositories of either an organization or a user

1.3.0 (2019-06-07)

  • Make listen host configurable

1.2.0 (2019-06-07)

  • Add status label to differentiate between active and dismissed alerts

1.1.0 (2019-06-07)

  • Allow configuring via environment variables as well as command line parameters

1.0.1 (2019-06-07)

  • Increase repository query batch size.

1.0.0 (2019-06-06)

  • First release.

Metadata

Release files for github-vulnerability-exporter 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for github-vulnerability-exporter 1.5.2
File Size Uploaded Provenance Actions
github_vulnerability_exporter-1.5.2.tar.gz 6.1 kB Without provenance Details for github_vulnerability_exporter-1.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for github-vulnerability-exporter 1.5.2
File Interpreter ABI Platform Actions
github_vulnerability_exporter-1.5.2-py3-none-any.whl Python 3 none any Details for github_vulnerability_exporter-1.5.2-py3-none-any.whl

Total release size: 12.6 kB

Release files / github_vulnerability_exporter-1.5.2.tar.gz

Download URL github_vulnerability_exporter-1.5.2.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
17f6458b7832288c76c77fa900360b2fa00fb053ff9792d3325cc020787a6dfe
BLAKE2b-256 checksum
How to use checksums
efd5ab20f5453d9f4557d7426531b0c60a4a9787a7eddd8bc9895e5b80aadabe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / github_vulnerability_exporter-1.5.2-py3-none-any.whl

Download URL github_vulnerability_exporter-1.5.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db62cbc473ee0d387a2b9312edc72b2a41d2064bd55ad8c95cabce0daf26eeae
BLAKE2b-256 checksum
How to use checksums
9f0afbceec9cfe52ab3d01f42b2ec6944e2cbffb8bb774d5d9fe790df527ea18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for github-vulnerability-exporter 1.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page