A Python automation tool that fetches and triages security alerts from GitHub Advanced Security (GHAS) using the GitHub REST API.
- Fetches CodeQL code scanning alerts from a GitHub repository
- Fetches secret scanning alerts
- Triages alerts by severity: Critical / High / Medium / Low
- Filters dismissed/skipped alerts separately
- Saves a structured JSON report automatically
- Python 3
- GitHub REST API
- GitHub Advanced Security (GHAS) — CodeQL, Secret Scanning
-
Clone the repo git clone https://github.com/sunilkumardo/security-scanner-demo.git
-
Install dependency pip install requests
-
Set your GitHub token as environment variable Windows: set GITHUB_TOKEN=your_token_here
-
Run the scanner python scanner.py
GITHUB SECURITY ALERT TRIAGE REPORT Repo : sunilkumardo/security-scanner-demo Date : 2026-05-18 03:27
[SUMMARY] Total Active Alerts: 2 | Skipped/Dismissed: 0
[HIGH] — 2 alert(s) > Rule : py/clear-text-logging-sensitive-data Details : Clear-text logging of sensitive information File : scanner.py (Line 108)
[SECRET SCANNING] — 1 secret(s) found! > Type : GitHub Personal Access Token State : resolved
Built as hands-on practice during my cybersecurity learning at IISc Bangalore (CySeck Program). This mirrors real GHAS automation workflows used by Application Security Engineering teams.