This tool performs automated security scans on public GitHub repositories.
The script clones a repository locally, installs its dependencies, and runs multiple security checks to identify potential vulnerabilities or security risks. After the scan completes, the cloned repository is removed to keep the workspace clean.
Security findings are saved as structured JSON reports for later review.
The scanner performs three types of security analysis.
Checks Python dependencies for known vulnerabilities using public CVE databases.
Detects issues such as:
- vulnerable packages
- outdated libraries
- supply-chain risks
Analyzes Python source code for insecure patterns such as:
- command injection
- unsafe subprocess usage
- weak cryptography
- insecure deserialization
- hardcoded credentials
Scans repositories for exposed secrets including:
- API keys
- access tokens
- passwords
- private credentials
When the script runs, it performs the following steps:
- Clone the target GitHub repository
- Create an isolated Python virtual environment
- Install security scanning tools
- Install project dependencies (if available)
- Run vulnerability and security scans
- Generate JSON security reports
- Remove the cloned repository
Run the script and provide a GitHub repository URL.
Example:
.\scan_repo.ps1 https://github.com/pallets/flaskThe scanner will:
- clone the repository
- install dependencies
- run security scans
- generate reports
Reports are saved in the reports directory.
reports/
└ scan_2026-03-15_14-20-31
├ pip-audit-report.json
├ bandit-report.json
└ gitleaks-report.json
These JSON reports contain detailed security findings.
The following tools must be installed:
- PowerShell
- Python
- Git
- Gitleaks
Python packages used by the script:
- pip-audit
- bandit
This project demonstrates how automated security scanning can be used to evaluate third-party repositories before integrating them into development workflows or CI/CD pipelines.
It is intended as a simple example of security automation used in DevSecOps practices.
Alin GitHub: https://github.com/alexpedient-cloud