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
ghCLI installed and authenticated (gh auth login)uvfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3ca40af9d1a54d6987002ded7b4feb0559bde70245ae09be3bb8b43d2bab8bb
|
|
| MD5 |
b01f98a4c1ebe08f0af77254cbb335b4
|
|
| BLAKE2b-256 |
f50df37864ae29e4953f7538141c1a40e5e9357885bf5ef97886cb04a4220dcd
|
Provenance
The following attestation bundles were made for ghsec-0.1.1.tar.gz:
Publisher:
publish.yml on garland3/github-security-issues
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghsec-0.1.1.tar.gz -
Subject digest:
d3ca40af9d1a54d6987002ded7b4feb0559bde70245ae09be3bb8b43d2bab8bb - Sigstore transparency entry: 991014735
- Sigstore integration time:
-
Permalink:
garland3/github-security-issues@0e7138a01970575e6f6949d142edecbeb40bab7a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/garland3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e7138a01970575e6f6949d142edecbeb40bab7a -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7fc0aa267a8170785ad62194bf86fe844c4cafcf960b8abb6db33ce32eb7983
|
|
| MD5 |
3b8d794f4cdca775f36389e25223125c
|
|
| BLAKE2b-256 |
e6aa989f6447fbc0f67f14932986e3ac30fc7a3064833ed6f118200c0da9189f
|
Provenance
The following attestation bundles were made for ghsec-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on garland3/github-security-issues
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghsec-0.1.1-py3-none-any.whl -
Subject digest:
c7fc0aa267a8170785ad62194bf86fe844c4cafcf960b8abb6db33ce32eb7983 - Sigstore transparency entry: 991014740
- Sigstore integration time:
-
Permalink:
garland3/github-security-issues@0e7138a01970575e6f6949d142edecbeb40bab7a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/garland3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e7138a01970575e6f6949d142edecbeb40bab7a -
Trigger Event:
push
-
Statement type: