A developer-centric security toolkit that unifies multiple scanning engines (including a custom, AST-based Python scanner and Semgrep) to find OWASP Top 10 vulnerabilities. Designed for seamless integration into development workflows and CI/CD pipelines.
Project description
Vulnerability Scanner
A developer-centric, multi-engine security toolkit for Python applications.
This tool was developed as part of a Master's thesis project by Javier Ocampo at CCT College Dublin.
The Problem
In the modern software development lifecycle, developers are increasingly responsible for writing secure code. However, the landscape of security tools is often fragmented, complex, and difficult to integrate into a seamless workflow. This friction creates a significant barrier to the adoption of secure coding practices from the outset of a project, leading to vulnerabilities that are often discovered too late.
This project aims to solve that problem by providing a unified, intuitive, and powerful toolkit that embeds security scanning directly into the development process.
Features
- Unified Workflow: Integrates multiple scanning engines into a single, cohesive CLI interface.
- Dual-Engine Philosophy:
- Custom Engine: A high-fidelity, Python-specific scanner built from the ground up to detect OWASP Top 10 vulnerabilities with low false positives. Uses AST parsing for deep code analysis and integrates
pip-auditfor dependency checking. - Semgrep Engine: An integrated wrapper around the industry-standard Semgrep tool, providing broad, fast, multi-language scanning capabilities based on a vast community-driven ruleset.
- Custom Engine: A high-fidelity, Python-specific scanner built from the ground up to detect OWASP Top 10 vulnerabilities with low false positives. Uses AST parsing for deep code analysis and integrates
- Developer-Centric: Designed for ease of use by developers, providing clear, actionable feedback.
- Educational: Each finding from the Custom Engine includes an explanation of the vulnerability, potential attack scenarios, and remediation guidance, making it a valuable learning tool.
- Flexible Output: Provides results in both a human-readable table for quick assessment and a machine-readable JSON format for CI/CD integration.
- CI/CD Ready: Easily integrates into pipelines like GitHub Actions to automate security testing.
- VS Code Integration: Features a companion Visual Studio Code extension, OWASP Guardian, for real-time security feedback in the editor.
Installation
Install the tool from PyPI using pip or uv:
# With pip
pip install vulnerability-scanner
# With uv
uv pip install vulnerability-scanner
Usage
The primary command is scan. You must choose to run either the Custom Engine (--scanners) or the Semgrep Engine (--semgrep).
Running the Custom Engine
To run the Custom Engine, use the --scanners (-s) flag. You can specify a comma-separated list of scanners or use all to run every available custom scanner.
# Run all custom scanners on the current directory
vuln-scan --scanners all
# Run specific scanners on a given path
vuln-scan --scanners injection,cryptographic_failures --path ./my_project/
# Save results to a JSON file
vuln-scan --scanners all --path . --output results.json
Running the Semgrep Engine
To run the integrated Semgrep engine, use the --semgrep flag.
# Run Semgrep on the current directory
vuln-scan --semgrep
# Run Semgrep on a specific path
vuln-scan --semgrep --path ./my_project/
CI/CD Integration
The tool is designed to be used in CI/CD pipelines. You can make the scan fail if vulnerabilities of a certain severity are found, blocking insecure code from being merged.
# Fail the build if any "critical" severity issues are found
vuln-scan --scanners all --fail-on-severity critical --path .
Full Options
Usage: vuln-scan [OPTIONS]
| Option | Alias | Description |
|---|---|---|
--scanners |
-s |
Comma-separated list of custom scanners to run (e.g., injection,crypto) or all. |
--semgrep |
Activates the Semgrep engine. Cannot be used with --scanners. |
|
--path |
-p |
File or directory to scan (defaults to current directory). |
--output |
-o |
Optional path to save results to a JSON file. |
--fail-on-severity |
Fail the process if vulnerabilities of this level or higher are found (low, medium, high, critical). |
|
--verbose |
-v |
Enable verbose output with detailed information about the scan. |
Available Custom Scanners
The Custom Engine provides a suite of scanners, each targeting a specific category of the OWASP Top 10:
broken_access_controlcryptographic_failuresinjectioninsecure_designsecurity_misconfigurationvulnerable_and_outdated_components
How It Works
The tool is architected around a core orchestrator that manages two distinct, mutually exclusive scanning engines:
-
The Custom Engine (
--scanners): This engine is designed for deep, context-aware analysis of Python code. It uses Python's own Abstract Syntax Tree (AST) module to parse the code and identify complex vulnerability patterns with high accuracy. It also integrates specialized tools likepip-auditto handle dependency scanning (vulnerable_and_outdated_components). -
The Semgrep Engine (
--semgrep): This engine acts as a wrapper for the powerful Semgrep tool. It leverages Semgrep's extensive, community-curated rulesets to perform fast, broad, pattern-based analysis. This engine is excellent for catching a wide range of security "smells" and common misconfigurations.
This dual-engine approach allows you to choose the best tool for the job: deep analysis with the Custom Engine or broad coverage with Semgrep.
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 vulnerability_scanner-0.1.2.tar.gz.
File metadata
- Download URL: vulnerability_scanner-0.1.2.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ec606dbaa4bb55932fa915f5513b64a08c514b730628358eb84492de6998a1
|
|
| MD5 |
925653bc1623c6e65500b57f384b616b
|
|
| BLAKE2b-256 |
86859e9551d8648ab77da59cbc7e3630107a77233621d0f1d1029e174f6654ad
|
File details
Details for the file vulnerability_scanner-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vulnerability_scanner-0.1.2-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ef9ceab8e8feb248d493dd712f7952903b4731720054fcf9adada8b769913d
|
|
| MD5 |
04f308dca4cdf458d154590422bc6b49
|
|
| BLAKE2b-256 |
3d9e55df34a4e0ad7f5df0595fc77f6d5dadbed3f596f421ebcd9867af467968
|