vigilo 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vigilo-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
- vigilo-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
- vigilo-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +19 -0
- vigilo-0.1.0/.github/workflows/ci.yml +43 -0
- vigilo-0.1.0/.github/workflows/release.yml +149 -0
- vigilo-0.1.0/.gitignore +43 -0
- vigilo-0.1.0/CHANGELOG.md +32 -0
- vigilo-0.1.0/CODE_OF_CONDUCT.md +62 -0
- vigilo-0.1.0/CONTRIBUTING.md +75 -0
- vigilo-0.1.0/LICENSE +21 -0
- vigilo-0.1.0/PKG-INFO +170 -0
- vigilo-0.1.0/README.md +145 -0
- vigilo-0.1.0/SECURITY.md +22 -0
- vigilo-0.1.0/docs/architecture.md +63 -0
- vigilo-0.1.0/pyproject.toml +64 -0
- vigilo-0.1.0/src/vigilo/__init__.py +50 -0
- vigilo-0.1.0/src/vigilo/__main__.py +6 -0
- vigilo-0.1.0/src/vigilo/cli.py +130 -0
- vigilo-0.1.0/src/vigilo/detectors/__init__.py +28 -0
- vigilo-0.1.0/src/vigilo/detectors/base.py +89 -0
- vigilo-0.1.0/src/vigilo/detectors/code_injection.py +63 -0
- vigilo-0.1.0/src/vigilo/detectors/command_injection.py +107 -0
- vigilo-0.1.0/src/vigilo/detectors/path_traversal.py +103 -0
- vigilo-0.1.0/src/vigilo/detectors/sql_injection.py +123 -0
- vigilo-0.1.0/src/vigilo/detectors/unsafe_deserialization.py +110 -0
- vigilo-0.1.0/src/vigilo/discovery.py +96 -0
- vigilo-0.1.0/src/vigilo/flow.py +193 -0
- vigilo-0.1.0/src/vigilo/models.py +95 -0
- vigilo-0.1.0/src/vigilo/reporter.py +122 -0
- vigilo-0.1.0/src/vigilo/scanner.py +113 -0
- vigilo-0.1.0/tests/__init__.py +1 -0
- vigilo-0.1.0/tests/detectors/__init__.py +1 -0
- vigilo-0.1.0/tests/detectors/test_code_injection.py +56 -0
- vigilo-0.1.0/tests/detectors/test_command_injection.py +75 -0
- vigilo-0.1.0/tests/detectors/test_path_traversal.py +53 -0
- vigilo-0.1.0/tests/detectors/test_sql_injection.py +66 -0
- vigilo-0.1.0/tests/detectors/test_unsafe_deserialization.py +66 -0
- vigilo-0.1.0/tests/test_cli.py +113 -0
- vigilo-0.1.0/tests/test_discovery.py +54 -0
- vigilo-0.1.0/tests/test_edge_cases.py +115 -0
- vigilo-0.1.0/tests/test_flow.py +76 -0
- vigilo-0.1.0/tests/test_init.py +13 -0
- vigilo-0.1.0/tests/test_models.py +74 -0
- vigilo-0.1.0/tests/test_reporter.py +62 -0
- vigilo-0.1.0/tests/test_scanner.py +104 -0
- vigilo-0.1.0/tests/test_validation.py +133 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve Vigilo
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: 'bug'
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**Sample Code to Reproduce**
|
|
13
|
+
Code snippet where the false positive, false negative, or crash occurred:
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# Paste snippet here
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Expected behavior**
|
|
20
|
+
A clear and concise description of what you expected to happen.
|
|
21
|
+
|
|
22
|
+
**Vigilo Version & Environment**
|
|
23
|
+
- Vigilo version (`vigilo --version`):
|
|
24
|
+
- Python version (`python --version`):
|
|
25
|
+
- Operating System:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature / Detector request
|
|
3
|
+
about: Suggest an idea, detector, or rule for Vigilo
|
|
4
|
+
title: '[FEAT] '
|
|
5
|
+
labels: 'enhancement'
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Is your feature request related to a problem or new CWE? Please describe.**
|
|
10
|
+
A clear and concise description of the security pattern or feature.
|
|
11
|
+
|
|
12
|
+
**Target CWE (if applicable)**
|
|
13
|
+
- CWE-ID: (e.g. CWE-79, CWE-918)
|
|
14
|
+
- Vulnerable APIs:
|
|
15
|
+
|
|
16
|
+
**Example Vulnerable Code**
|
|
17
|
+
```python
|
|
18
|
+
# Code that should be detected
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Example Safe Code (to prevent False Positives)**
|
|
22
|
+
```python
|
|
23
|
+
# Code that should NOT be detected
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Describe the solution you'd like**
|
|
27
|
+
A clear and concise description of what you want to happen.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Provide a brief summary of the changes introduced in this PR.
|
|
4
|
+
|
|
5
|
+
## Type of Change
|
|
6
|
+
|
|
7
|
+
- [ ] New vulnerability detector (CWE)
|
|
8
|
+
- [ ] Bug fix / False positive reduction
|
|
9
|
+
- [ ] Documentation update
|
|
10
|
+
- [ ] Performance improvement
|
|
11
|
+
- [ ] Infrastructure / CI update
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
- [ ] My code follows the code style and formatting (`ruff check .`, `ruff format .`).
|
|
16
|
+
- [ ] Static type checking passes (`mypy src`).
|
|
17
|
+
- [ ] I have added tests that prove my fix or detector works (`python -m unittest discover -s tests`).
|
|
18
|
+
- [ ] All new and existing tests pass.
|
|
19
|
+
- [ ] Updated relevant documentation or `CHANGELOG.md` if applicable.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test on ${{ matrix.os }} (Python ${{ matrix.python-version }})
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
17
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install -e .[dev]
|
|
31
|
+
|
|
32
|
+
- name: Lint and format check with ruff
|
|
33
|
+
run: |
|
|
34
|
+
ruff check .
|
|
35
|
+
ruff format --check .
|
|
36
|
+
|
|
37
|
+
- name: Type check with mypy
|
|
38
|
+
run: |
|
|
39
|
+
mypy src
|
|
40
|
+
|
|
41
|
+
- name: Run test suite
|
|
42
|
+
run: |
|
|
43
|
+
python -m unittest discover -s tests
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
name: Release & Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-pypi:
|
|
14
|
+
name: Build sdist & wheel
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.11"
|
|
23
|
+
|
|
24
|
+
- name: Install build and twine
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install build twine
|
|
28
|
+
|
|
29
|
+
- name: Build distribution packages
|
|
30
|
+
run: python -m build
|
|
31
|
+
|
|
32
|
+
- name: Verify packages with twine
|
|
33
|
+
run: twine check --strict dist/*
|
|
34
|
+
|
|
35
|
+
- name: Upload dist artifacts
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: pypi-dist
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
publish-pypi:
|
|
42
|
+
name: Publish to PyPI
|
|
43
|
+
needs: [build-pypi]
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
environment:
|
|
46
|
+
name: pypi
|
|
47
|
+
url: https://pypi.org/p/vigilo
|
|
48
|
+
permissions:
|
|
49
|
+
id-token: write
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Download dist artifacts
|
|
53
|
+
uses: actions/download-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: pypi-dist
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
- name: Publish package to PyPI
|
|
59
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
60
|
+
with:
|
|
61
|
+
packages-dir: dist/
|
|
62
|
+
|
|
63
|
+
build-executables:
|
|
64
|
+
name: Build Standalone Binary (${{ matrix.os }})
|
|
65
|
+
runs-on: ${{ matrix.os }}
|
|
66
|
+
strategy:
|
|
67
|
+
fail-fast: false
|
|
68
|
+
matrix:
|
|
69
|
+
include:
|
|
70
|
+
- os: ubuntu-latest
|
|
71
|
+
bin_name: vigilo-linux-x86_64
|
|
72
|
+
ext: ""
|
|
73
|
+
- os: macos-latest
|
|
74
|
+
bin_name: vigilo-macos
|
|
75
|
+
ext: ""
|
|
76
|
+
- os: windows-latest
|
|
77
|
+
bin_name: vigilo-windows-x86_64
|
|
78
|
+
ext: ".exe"
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
|
|
83
|
+
- name: Set up Python
|
|
84
|
+
uses: actions/setup-python@v5
|
|
85
|
+
with:
|
|
86
|
+
python-version: "3.11"
|
|
87
|
+
|
|
88
|
+
- name: Install dependencies & PyInstaller
|
|
89
|
+
run: |
|
|
90
|
+
python -m pip install --upgrade pip
|
|
91
|
+
pip install pyinstaller .
|
|
92
|
+
|
|
93
|
+
- name: Build binary with PyInstaller
|
|
94
|
+
run: |
|
|
95
|
+
pyinstaller --onefile --clean --name vigilo src/vigilo/cli.py
|
|
96
|
+
|
|
97
|
+
- name: Rename and move binary (Unix)
|
|
98
|
+
if: runner.os != 'Windows'
|
|
99
|
+
run: |
|
|
100
|
+
mkdir -p bin_dist
|
|
101
|
+
mv dist/vigilo bin_dist/${{ matrix.bin_name }}${{ matrix.ext }}
|
|
102
|
+
chmod +x bin_dist/${{ matrix.bin_name }}${{ matrix.ext }}
|
|
103
|
+
|
|
104
|
+
- name: Rename and move binary (Windows)
|
|
105
|
+
if: runner.os == 'Windows'
|
|
106
|
+
shell: bash
|
|
107
|
+
run: |
|
|
108
|
+
mkdir -p bin_dist
|
|
109
|
+
mv dist/vigilo.exe bin_dist/${{ matrix.bin_name }}${{ matrix.ext }}
|
|
110
|
+
|
|
111
|
+
- name: Upload binary artifact
|
|
112
|
+
uses: actions/upload-artifact@v4
|
|
113
|
+
with:
|
|
114
|
+
name: binary-${{ matrix.os }}
|
|
115
|
+
path: bin_dist/
|
|
116
|
+
|
|
117
|
+
create-github-release:
|
|
118
|
+
name: Create GitHub Release
|
|
119
|
+
needs: [build-pypi, build-executables]
|
|
120
|
+
runs-on: ubuntu-latest
|
|
121
|
+
steps:
|
|
122
|
+
- uses: actions/checkout@v4
|
|
123
|
+
|
|
124
|
+
- name: Download PyPI dist artifacts
|
|
125
|
+
uses: actions/download-artifact@v4
|
|
126
|
+
with:
|
|
127
|
+
name: pypi-dist
|
|
128
|
+
path: release-assets/
|
|
129
|
+
|
|
130
|
+
- name: Download all binary artifacts
|
|
131
|
+
uses: actions/download-artifact@v4
|
|
132
|
+
with:
|
|
133
|
+
pattern: binary-*
|
|
134
|
+
path: release-binaries/
|
|
135
|
+
merge-multiple: true
|
|
136
|
+
|
|
137
|
+
- name: Assemble release assets & compute checksums
|
|
138
|
+
run: |
|
|
139
|
+
mkdir -p release-assets/
|
|
140
|
+
cp release-binaries/* release-assets/ || true
|
|
141
|
+
cd release-assets
|
|
142
|
+
sha256sum * > SHA256SUMS.txt
|
|
143
|
+
cat SHA256SUMS.txt
|
|
144
|
+
|
|
145
|
+
- name: Publish GitHub Release
|
|
146
|
+
uses: softprops/action-gh-release@v2
|
|
147
|
+
with:
|
|
148
|
+
files: release-assets/*
|
|
149
|
+
generate_release_notes: true
|
vigilo-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
env/
|
|
16
|
+
|
|
17
|
+
# Type checker / linter caches
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
|
|
22
|
+
# Coverage
|
|
23
|
+
htmlcov/
|
|
24
|
+
.coverage
|
|
25
|
+
.coverage.*
|
|
26
|
+
coverage.xml
|
|
27
|
+
|
|
28
|
+
# IDE
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
|
|
35
|
+
# OS
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
|
|
39
|
+
# Internal dev tracking docs (kept locally, not public)
|
|
40
|
+
DECISIONS.md
|
|
41
|
+
WORKFLOW.md
|
|
42
|
+
TIMELINE.md
|
|
43
|
+
TECH_STACK.md
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-09-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Core Engine:**
|
|
14
|
+
- Fast AST parsing and safe file discovery with default exclude rules.
|
|
15
|
+
- `FlowAnalyzer` providing local scope tracking, constant evaluation, and parameter taint discrimination.
|
|
16
|
+
- Extensible `BaseDetector` architecture.
|
|
17
|
+
- **Vulnerability Detectors:**
|
|
18
|
+
- `VIGILO-001` (CWE-89): SQL Injection detector for raw, formatted, and unparameterized SQL queries.
|
|
19
|
+
- `VIGILO-002` (CWE-78): OS Command Injection detector for `subprocess.*(shell=True)` and `os.system`/`os.popen`.
|
|
20
|
+
- `VIGILO-003` (CWE-94): Code Injection detector for `eval()`, `exec()`, and `compile()`.
|
|
21
|
+
- `VIGILO-004` (CWE-502): Unsafe Deserialization detector for `pickle`, `marshal`, and unsafe `yaml.load()`.
|
|
22
|
+
- `VIGILO-005` (CWE-22): Path Traversal detector for dynamic file opening and filesystem access.
|
|
23
|
+
- **Command-Line Interface:**
|
|
24
|
+
- `vigilo scan <path>` and `vigilo <path>` alias commands.
|
|
25
|
+
- ANSI colored text output report with line markers, confidence tags, and fix guidance.
|
|
26
|
+
- Structured `--format json` output option for CI/CD integrations.
|
|
27
|
+
- Severity threshold filtering (`--min-severity`).
|
|
28
|
+
- Glob exclusion flags (`--exclude`).
|
|
29
|
+
- Standard exit codes (0 = clean, 1 = vulnerabilities found, 2 = error).
|
|
30
|
+
- **Public Python API:**
|
|
31
|
+
- `vigilo.scan(path, min_severity, exclude_patterns)` convenience function.
|
|
32
|
+
- Re-exported data models: `Scanner`, `ScanConfig`, `Finding`, `Severity`, `Location`, `DetectorMeta`.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment include:
|
|
18
|
+
|
|
19
|
+
* Demonstrating empathy and kindness toward other people
|
|
20
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
* Giving and gracefully accepting constructive feedback
|
|
22
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
23
|
+
and learning from the experience
|
|
24
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
25
|
+
overall community
|
|
26
|
+
|
|
27
|
+
Examples of unacceptable behavior include:
|
|
28
|
+
|
|
29
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
30
|
+
advances of any kind
|
|
31
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
32
|
+
* Public or private harassment
|
|
33
|
+
* Publishing others' private information, such as a physical or email
|
|
34
|
+
address, without their explicit permission
|
|
35
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
36
|
+
professional setting
|
|
37
|
+
|
|
38
|
+
## Enforcement Responsibilities
|
|
39
|
+
|
|
40
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
41
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
42
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
43
|
+
or harmful.
|
|
44
|
+
|
|
45
|
+
## Scope
|
|
46
|
+
|
|
47
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
48
|
+
an individual is officially representing the community in public spaces.
|
|
49
|
+
|
|
50
|
+
## Enforcement
|
|
51
|
+
|
|
52
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
53
|
+
reported to the project team at sanjiv215@users.noreply.github.com. All
|
|
54
|
+
complaints will be reviewed and investigated promptly and fairly.
|
|
55
|
+
|
|
56
|
+
## Attribution
|
|
57
|
+
|
|
58
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
59
|
+
version 2.1, available at
|
|
60
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
61
|
+
|
|
62
|
+
[homepage]: https://www.contributor-covenant.org
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Contributing to Vigilo
|
|
2
|
+
|
|
3
|
+
Thank you for contributing to Vigilo! This document outlines our development workflows and guidelines.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Development Setup
|
|
8
|
+
|
|
9
|
+
1. **Clone the repository:**
|
|
10
|
+
```bash
|
|
11
|
+
git clone https://github.com/Sanjiv215/VIGILO-Python-Package.git
|
|
12
|
+
cd VIGILO-Python-Package
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. **Create a virtual environment (Python 3.10+):**
|
|
16
|
+
```bash
|
|
17
|
+
python3 -m venv .venv
|
|
18
|
+
source .venv/bin/activate
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. **Install in editable mode with development dependencies:**
|
|
22
|
+
```bash
|
|
23
|
+
pip install -e .[dev]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Running Tests & Quality Checks
|
|
29
|
+
|
|
30
|
+
Ensure all tests, linters, and type checkers pass before submitting a Pull Request:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Run unit tests
|
|
34
|
+
python -m unittest discover -s tests
|
|
35
|
+
|
|
36
|
+
# Run linter and check formatting
|
|
37
|
+
ruff check .
|
|
38
|
+
ruff format --check .
|
|
39
|
+
|
|
40
|
+
# Run static type checker
|
|
41
|
+
mypy src
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Adding a New Vulnerability Detector
|
|
47
|
+
|
|
48
|
+
To add a new vulnerability detector:
|
|
49
|
+
|
|
50
|
+
1. **Create a new detector file** in `src/vigilo/detectors/<detector_name>.py`:
|
|
51
|
+
- Subclass `BaseDetector` from `vigilo.detectors.base`.
|
|
52
|
+
- Define class attribute `meta = DetectorMeta(id="VIGILO-XXX", name="...", cwe=..., description="...", severity=Severity.HIGH)`.
|
|
53
|
+
- Implement `run(tree, file_path, source) -> list[Finding]`.
|
|
54
|
+
- Use `FlowAnalyzer.is_dynamic()` or `FlowAnalyzer.is_constant()` to eliminate false positives.
|
|
55
|
+
|
|
56
|
+
2. **Register the detector** in `src/vigilo/detectors/__init__.py`:
|
|
57
|
+
- Add the detector class to `ALL_DETECTORS`.
|
|
58
|
+
|
|
59
|
+
3. **Add comprehensive unit tests** in `tests/detectors/test_<detector_name>.py`:
|
|
60
|
+
- Include test cases for **True Positives** (flawed code that must trigger).
|
|
61
|
+
- Include test cases for **True Negatives** (safe idioms that must NOT trigger).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Commit Message Convention
|
|
66
|
+
|
|
67
|
+
We follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
68
|
+
|
|
69
|
+
- `feat:` New features or detectors
|
|
70
|
+
- `fix:` Bug fixes
|
|
71
|
+
- `docs:` Documentation updates
|
|
72
|
+
- `test:` Adding or updating tests
|
|
73
|
+
- `chore:` Maintenance, dependency updates, packaging
|
|
74
|
+
- `ci:` CI/CD workflow updates
|
|
75
|
+
- `refactor:` Code improvements without feature changes
|
vigilo-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanjiv - Vigilo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
vigilo-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: vigilo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fast, zero-configuration static security scanner that detects known vulnerability patterns in Python codebases.
|
|
5
|
+
Author: Sanjiv
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: cwe,sast,security,security-tools,static-analysis,vigilo,vulnerability-scanner
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Vigilo
|
|
27
|
+
|
|
28
|
+
[](https://github.com/Sanjiv215/VIGILO-Python-Package/actions)
|
|
29
|
+
[](https://www.python.org/downloads/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
[](https://pypi.org/project/vigilo/)
|
|
32
|
+
|
|
33
|
+
**Vigilo** is a fast, zero-configuration static security scanner for Python. It detects exploitable vulnerability patterns (CWEs) in first-party code using AST traversal combined with local data-flow analysis to minimize false positives.
|
|
34
|
+
|
|
35
|
+
Runs across **Linux**, **macOS**, and **Windows** — either via `pip` or as a standalone binary with **no Python installation required**.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Why Vigilo?
|
|
40
|
+
|
|
41
|
+
- **High-Signal over High-Noise:** Traditional linters (like Bandit) flag safe string constants and standard library calls indiscriminately. Vigilo uses local data-flow analysis to distinguish harmless constants from untrusted dynamic inputs.
|
|
42
|
+
- **Zero Configuration:** Drop it directly into your workflow or CI pipeline with `vigilo scan .` or `vigilo .`. No YAML rule authoring or database setup required.
|
|
43
|
+
- **Zero Runtime Dependencies:** Built strictly on Python's standard library. Lightweight and instantaneous.
|
|
44
|
+
- **First-Party Code Focus:** While tools like `pip-audit` scan third-party dependencies for CVEs, Vigilo scans *your* code for logic and injection flaws.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Installation & Quickstart
|
|
49
|
+
|
|
50
|
+
### Option A: Install via PyPI (Python 3.10+)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install vigilo
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Option B: Standalone Executable (No Python Required)
|
|
57
|
+
|
|
58
|
+
Pre-built standalone single-file executables are available for Linux, macOS, and Windows on the [Releases Page](https://github.com/Sanjiv215/VIGILO-Python-Package/releases):
|
|
59
|
+
|
|
60
|
+
- **Linux (x86_64):** `vigilo-linux-x86_64`
|
|
61
|
+
- **macOS:** `vigilo-macos`
|
|
62
|
+
- **Windows (x86_64):** `vigilo-windows-x86_64.exe`
|
|
63
|
+
|
|
64
|
+
#### Verifying Checksums
|
|
65
|
+
|
|
66
|
+
Every release includes a `SHA256SUMS.txt` file to verify binary integrity:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Verify checksum on Linux/macOS
|
|
70
|
+
sha256sum -c SHA256SUMS.txt
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Note on Antivirus Alerts:** Standalone executables are bundled with PyInstaller. Some heuristic antivirus engines or Windows SmartScreen may occasionally flag newly published PyInstaller binaries as unfamiliar. This is a known false positive with packed binaries. You can verify the integrity using the SHA256 checksum or install via `pip install vigilo` to run from source.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
Scan the current directory:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
vigilo scan .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or use the shortcut alias:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
vigilo .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Generate structured JSON output for CI/CD pipelines:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
vigilo scan . --format json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Filter by minimum severity:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
vigilo scan . --min-severity high
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Exclude specific directories or glob patterns:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
vigilo scan . --exclude "tests/*" --exclude "migrations/*"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Python API
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from vigilo import scan
|
|
113
|
+
|
|
114
|
+
findings = scan("src/")
|
|
115
|
+
|
|
116
|
+
for finding in findings:
|
|
117
|
+
print(f"[{finding.severity.upper()}] {finding.detector.id} {finding.detector.name}")
|
|
118
|
+
print(f" Location: {finding.location}")
|
|
119
|
+
print(f" Fix: {finding.fix_hint}")
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Supported Detectors
|
|
125
|
+
|
|
126
|
+
| ID | CWE | Vulnerability | Severity | Target APIs |
|
|
127
|
+
|---|---|---|---|---|
|
|
128
|
+
| **`VIGILO-001`** | CWE-89 | SQL Injection | `HIGH` | `db.execute()`, `cursor.execute()`, `text()`, `raw()` |
|
|
129
|
+
| **`VIGILO-002`** | CWE-78 | OS Command Injection | `HIGH` | `subprocess.*(shell=True)`, `os.system()`, `os.popen()` |
|
|
130
|
+
| **`VIGILO-003`** | CWE-94 | Code Injection | `HIGH` | `eval()`, `exec()`, `compile()` |
|
|
131
|
+
| **`VIGILO-004`** | CWE-502 | Unsafe Deserialization | `HIGH` | `pickle.loads()`, `yaml.load()`, `marshal.loads()` |
|
|
132
|
+
| **`VIGILO-005`** | CWE-22 | Path Traversal | `HIGH` | `open()`, `os.open()`, `io.open()` |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## CLI Reference
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
usage: vigilo [-h] [--version] {scan} ... [target] [--format {text,json}]
|
|
140
|
+
[--min-severity {low,medium,high}] [--exclude EXCLUDE] [--no-color]
|
|
141
|
+
|
|
142
|
+
Options:
|
|
143
|
+
target Directory or file to scan (default: '.')
|
|
144
|
+
--format, -f Output report format: 'text' or 'json' (default: 'text')
|
|
145
|
+
--min-severity, -s Minimum severity threshold: 'low', 'medium', 'high' (default: 'low')
|
|
146
|
+
--exclude, -e Exclude path matching glob pattern (repeatable)
|
|
147
|
+
--no-color Disable ANSI terminal coloring
|
|
148
|
+
--version, -V Show version and exit
|
|
149
|
+
--help, -h Show help and exit
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Exit Codes
|
|
153
|
+
|
|
154
|
+
| Code | Meaning |
|
|
155
|
+
|---|---|
|
|
156
|
+
| `0` | Clean — no vulnerabilities found at or above `--min-severity` |
|
|
157
|
+
| `1` | Vulnerabilities detected |
|
|
158
|
+
| `2` | Execution or path error |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Contributing
|
|
163
|
+
|
|
164
|
+
We welcome contributions! Please review our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
Distributed under the [MIT License](LICENSE). Copyright (c) 2026 Sanjiv - Vigilo.
|