Skip to main content

CLI tool to fetch, display, and manage GitHub security alerts

Project description

ghsec — GitHub Security Alerts CLI

A command-line tool that wraps the gh CLI to fetch, display, and manage GitHub security alerts (CodeQL/code scanning, Dependabot, secret scanning).

Prerequisites

  • Python >= 3.10
  • gh CLI installed and authenticated (gh auth login)
  • uv for package management (recommended)

Installation

uv pip install .

Or for development:

uv sync

Usage

Run ghsec from inside a cloned GitHub repo (it auto-detects the repo from git remote), or specify --repo OWNER/REPO.

ghsec <subcommand> [options]

Global options:
  --repo OWNER/REPO    Override repo (default: auto-detect from git remote)
  --json               Output raw JSON instead of formatted tables

List alerts

# All security alert types
ghsec list

# Specific types
ghsec list-code          # Code scanning (CodeQL) only
ghsec list-deps          # Dependabot only
ghsec list-secrets       # Secret scanning only

# Filter by state or severity
ghsec list-code --state open --severity high

Show alert details

ghsec show code 1        # Code scanning alert #1
ghsec show dep 5         # Dependabot alert #5
ghsec show secret 3      # Secret scanning alert #3

Dismiss an alert

# Code scanning reasons: false_positive, wont_fix, used_in_tests
ghsec dismiss code 1 --reason wont_fix

# Dependabot reasons: fix_started, inaccurate, no_bandwidth, not_used, tolerable_risk
ghsec dismiss dep 5 --reason tolerable_risk --comment "low priority"

# Secret scanning reasons: false_positive, wont_fix, revoked, used_in_tests
ghsec dismiss secret 3 --reason revoked

Reopen a dismissed alert

ghsec reopen dep 5

JSON output

ghsec --json list-deps
ghsec --json show code 1

Running tests

bash test/run_tests.sh

Project structure

├── pyproject.toml          # Package metadata, dependencies, entry point
├── src/
│   └── ghsec/
│       ├── __init__.py     # Version string
│       ├── cli.py          # argparse setup, main entry point
│       ├── api.py          # gh api wrapper functions
│       └── display.py      # Rich table/detail formatting
└── test/
    ├── run_tests.sh        # Test runner script
    ├── fixtures.py         # Canned API responses
    ├── test_api.py         # API module tests
    ├── test_display.py     # Display formatting tests
    └── test_cli.py         # CLI argument & command handler tests

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghsec-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghsec-0.1.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file ghsec-0.1.1.tar.gz.

File metadata

  • Download URL: ghsec-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghsec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3ca40af9d1a54d6987002ded7b4feb0559bde70245ae09be3bb8b43d2bab8bb
MD5 b01f98a4c1ebe08f0af77254cbb335b4
BLAKE2b-256 f50df37864ae29e4953f7538141c1a40e5e9357885bf5ef97886cb04a4220dcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghsec-0.1.1.tar.gz:

Publisher: publish.yml on garland3/github-security-issues

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghsec-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ghsec-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghsec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7fc0aa267a8170785ad62194bf86fe844c4cafcf960b8abb6db33ce32eb7983
MD5 3b8d794f4cdca775f36389e25223125c
BLAKE2b-256 e6aa989f6447fbc0f67f14932986e3ac30fc7a3064833ed6f118200c0da9189f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghsec-0.1.1-py3-none-any.whl:

Publisher: publish.yml on garland3/github-security-issues

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page