canop 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.
- canop-0.1.0/LICENSE +21 -0
- canop-0.1.0/MANIFEST.in +4 -0
- canop-0.1.0/PKG-INFO +161 -0
- canop-0.1.0/README.md +133 -0
- canop-0.1.0/canop/__init__.py +2 -0
- canop-0.1.0/canop/cli.py +377 -0
- canop-0.1.0/canop/config.py +1 -0
- canop-0.1.0/canop/rules/js-advanced.yml +96 -0
- canop-0.1.0/canop/rules/js-ai.yml +135 -0
- canop-0.1.0/canop/rules/js-auth-advanced.yml +220 -0
- canop-0.1.0/canop/rules/js-auth.yml +114 -0
- canop-0.1.0/canop/rules/js-cloud.yml +165 -0
- canop-0.1.0/canop/rules/js-config.yml +96 -0
- canop-0.1.0/canop/rules/js-crypto.yml +85 -0
- canop-0.1.0/canop/rules/js-deserialization.yml +198 -0
- canop-0.1.0/canop/rules/js-dom.yml +245 -0
- canop-0.1.0/canop/rules/js-dos.yml +163 -0
- canop-0.1.0/canop/rules/js-express.yml +347 -0
- canop-0.1.0/canop/rules/js-injection.yml +102 -0
- canop-0.1.0/canop/rules/js-network.yml +212 -0
- canop-0.1.0/canop/rules/js-nextjs.yml +200 -0
- canop-0.1.0/canop/rules/js-node.yml +361 -0
- canop-0.1.0/canop/rules/js-nosql.yml +199 -0
- canop-0.1.0/canop/rules/js-orm.yml +271 -0
- canop-0.1.0/canop/rules/js-path-traversal.yml +211 -0
- canop-0.1.0/canop/rules/js-react.yml +263 -0
- canop-0.1.0/canop/rules/js-secrets.yml +249 -0
- canop-0.1.0/canop/rules/js-sql-injection.yml +89 -0
- canop-0.1.0/canop/rules/js-xss.yml +108 -0
- canop-0.1.0/canop/rules/python-ai-patterns.yml +288 -0
- canop-0.1.0/canop/rules/python-async.yml +105 -0
- canop-0.1.0/canop/rules/python-auth.yml +274 -0
- canop-0.1.0/canop/rules/python-cloud-misc.yml +320 -0
- canop-0.1.0/canop/rules/python-config.yml +289 -0
- canop-0.1.0/canop/rules/python-crypto.yml +313 -0
- canop-0.1.0/canop/rules/python-database.yml +243 -0
- canop-0.1.0/canop/rules/python-deserialization.yml +304 -0
- canop-0.1.0/canop/rules/python-django.yml +352 -0
- canop-0.1.0/canop/rules/python-dos.yml +112 -0
- canop-0.1.0/canop/rules/python-fastapi.yml +181 -0
- canop-0.1.0/canop/rules/python-file-ops.yml +113 -0
- canop-0.1.0/canop/rules/python-flask.yml +223 -0
- canop-0.1.0/canop/rules/python-injection.yml +313 -0
- canop-0.1.0/canop/rules/python-logging.yml +84 -0
- canop-0.1.0/canop/rules/python-network.yml +141 -0
- canop-0.1.0/canop/rules/python-password.yml +155 -0
- canop-0.1.0/canop/rules/python-path-ssrf.yml +275 -0
- canop-0.1.0/canop/rules/python-safety.yml +187 -0
- canop-0.1.0/canop/rules/python-secrets.yml +96 -0
- canop-0.1.0/canop/rules/python-sql-injection.yml +336 -0
- canop-0.1.0/canop/rules/python-subprocess.yml +111 -0
- canop-0.1.0/canop/rules/python-xml.yml +162 -0
- canop-0.1.0/canop/rules/python-xss.yml +133 -0
- canop-0.1.0/canop/scanner.py +2235 -0
- canop-0.1.0/canop/semgrep_engine.py +223 -0
- canop-0.1.0/canop.egg-info/PKG-INFO +161 -0
- canop-0.1.0/canop.egg-info/SOURCES.txt +62 -0
- canop-0.1.0/canop.egg-info/dependency_links.txt +1 -0
- canop-0.1.0/canop.egg-info/entry_points.txt +2 -0
- canop-0.1.0/canop.egg-info/requires.txt +4 -0
- canop-0.1.0/canop.egg-info/top_level.txt +1 -0
- canop-0.1.0/requirements.txt +4 -0
- canop-0.1.0/setup.cfg +4 -0
- canop-0.1.0/setup.py +32 -0
canop-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CanoP Team
|
|
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.
|
canop-0.1.0/MANIFEST.in
ADDED
canop-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: canop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fast, standalone security scanner designed to catch vulnerabilities written by AI.
|
|
5
|
+
Home-page: https://github.com/openbreach/canop
|
|
6
|
+
Author: CanoP Security
|
|
7
|
+
Author-email: canop.security@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: click>=8.1.0
|
|
15
|
+
Requires-Dist: requests>=2.31.0
|
|
16
|
+
Requires-Dist: rich>=13.0.0
|
|
17
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
18
|
+
Dynamic: author
|
|
19
|
+
Dynamic: author-email
|
|
20
|
+
Dynamic: classifier
|
|
21
|
+
Dynamic: description
|
|
22
|
+
Dynamic: description-content-type
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: requires-python
|
|
27
|
+
Dynamic: summary
|
|
28
|
+
|
|
29
|
+
# CanoP CLI
|
|
30
|
+
|
|
31
|
+
[](https://badge.fury.io/py/canop-cli)
|
|
32
|
+
[](https://opensource.org/licenses/MIT)
|
|
33
|
+
[](https://www.python.org/downloads/)
|
|
34
|
+
[](https://github.com/psf/black)
|
|
35
|
+
|
|
36
|
+
A fast, standalone static analysis tool designed specifically to detect vulnerabilities introduced by AI coding assistants. CanoP analyzes your codebase locally to ensure that the code generated by AI is not just functionally correct, but demonstrably secure.
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
* **High Signal-to-Noise Ratio**: Traditional scanners produce overwhelming alerts. CanoP is tuned specifically for modern AI failure modes (such as SQL injection, unsafe reflection, and hardcoded secrets), ensuring that the alerts you see are actionable and high-priority.
|
|
41
|
+
* **Multi-Language Support**: Offers out-of-the-box analysis for Python, JavaScript, TypeScript, Java, Go, Ruby, and PHP, allowing you to secure full-stack applications with a single tool.
|
|
42
|
+
* **CI/CD Ready**: Designed to integrate directly into deployment pipelines. You can enforce security standards by configuring failure thresholds based on severity levels (e.g., failing builds on CRITICAL findings) and overall security scoring.
|
|
43
|
+
* **AI Prescriptions**: Rather than just pointing out flaws, CanoP automatically generates structured `fixes.json` payloads. These contain specific prompts designed to be fed back into Large Language Models (LLMs) for immediate, context-aware remediation.
|
|
44
|
+
* **Standardized Reporting**: Exports findings to standard JSON or SARIF (Static Analysis Results Interchange Format) for seamless integration with GitHub Advanced Security and enterprise vulnerability management platforms.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
CanoP is distributed as a standard Python package via PyPI. Install it globally in your environment using `pip`:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install canop
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Verify the installation to ensure the CLI is available in your system path:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
canop --version
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
Initialize the configuration files in your repository. This command creates a `.canop.yml` policy file and a `.canopignore` file to exclude noisy directories like `node_modules` or `venv` from the scan:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
canop init
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run a comprehensive security scan against your current directory. The scanner evaluates your code against the internal rule engine and outputs a detailed table with a final security score:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
canop scan .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Scan only files that have been modified in git. This dramatically reduces scan time and is ideal for pre-commit hooks, ensuring new code is secure before it is committed:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
canop scan . --changed
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Advanced Usage
|
|
81
|
+
|
|
82
|
+
### Continuous Integration / Continuous Deployment (CI/CD)
|
|
83
|
+
|
|
84
|
+
CanoP is built to act as a security gatekeeper in automated deployment pipelines (such as GitHub Actions or GitLab CI). You can configure the scanner to return a non-zero exit code—which automatically fails the build—if specific security criteria are not met.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Fail the deployment pipeline if any CRITICAL or HIGH vulnerabilities are found
|
|
88
|
+
canop scan . --fail-on HIGH
|
|
89
|
+
|
|
90
|
+
# Fail the deployment pipeline if the aggregate security score falls below 85
|
|
91
|
+
canop scan . --min-score 85
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Exporting Results
|
|
95
|
+
|
|
96
|
+
For teams that require historical tracking, auditing, or integration with external systems, CanoP supports multiple output formats.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Export the raw native Python dictionary data to a standard JSON file for custom parsing
|
|
100
|
+
canop scan . --json-out results.json
|
|
101
|
+
|
|
102
|
+
# Export to SARIF (Static Analysis Results Interchange Format).
|
|
103
|
+
# Uploading this file to GitHub allows GitHub to display the vulnerabilities inline in Pull Requests.
|
|
104
|
+
canop scan . --sarif results.sarif
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Automated Remediation
|
|
108
|
+
|
|
109
|
+
CanoP extracts the remediation metadata from its rules engine to generate prompts that instruct AI coding assistants on exactly how to fix the detected vulnerabilities.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Generate a fixes.json file containing actionable prompts for your LLM
|
|
113
|
+
canop scan . --prescriptions fixes.json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
CanoP behavior can be codified using a `.canop.yml` file placed in the root of your project. This file acts as a centralized security policy, ensuring all developers and CI/CD pipelines adhere to the same thresholds.
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
# .canop.yml
|
|
122
|
+
# Require a minimum security grade to pass the pipeline
|
|
123
|
+
min_grade: B
|
|
124
|
+
|
|
125
|
+
# Treat these specific severity levels as pipeline failures
|
|
126
|
+
fail_on:
|
|
127
|
+
- CRITICAL
|
|
128
|
+
- HIGH
|
|
129
|
+
|
|
130
|
+
# Ignore specific paths from being scanned
|
|
131
|
+
ignore:
|
|
132
|
+
- "tests/**"
|
|
133
|
+
- "docs/**"
|
|
134
|
+
|
|
135
|
+
# Allow a certain number of findings before returning a non-zero exit code (0 = strictly unlimited)
|
|
136
|
+
max_findings: 0
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
You can also rely on `.canopignore` to define specific files or directories that the scanner should skip. It utilizes standard glob patterns, functioning identically to `.gitignore`.
|
|
140
|
+
|
|
141
|
+
## Local Development
|
|
142
|
+
|
|
143
|
+
If you wish to contribute to the CLI or test changes locally, clone the repository and install it in editable mode. Editable mode maps the `canop` terminal command directly to your live source code.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git clone https://github.com/your-org/canop-cli.git
|
|
147
|
+
cd canop-cli
|
|
148
|
+
pip install -e .
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Rule Development
|
|
152
|
+
|
|
153
|
+
Security rules are defined in the standard Semgrep YAML format and are located within `canop/rules/*.yml`. Please see `CONTRIBUTING.md` for comprehensive guidelines on how to structure, test, and submit new rules to expand the scanner's detection capabilities.
|
|
154
|
+
|
|
155
|
+
## Support
|
|
156
|
+
|
|
157
|
+
If you find any bugs, have feature requests, or need general help, please open an issue on GitHub or contact us directly at canop.security@gmail.com.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
canop-0.1.0/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# CanoP CLI
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/canop-cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](https://github.com/psf/black)
|
|
7
|
+
|
|
8
|
+
A fast, standalone static analysis tool designed specifically to detect vulnerabilities introduced by AI coding assistants. CanoP analyzes your codebase locally to ensure that the code generated by AI is not just functionally correct, but demonstrably secure.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
* **High Signal-to-Noise Ratio**: Traditional scanners produce overwhelming alerts. CanoP is tuned specifically for modern AI failure modes (such as SQL injection, unsafe reflection, and hardcoded secrets), ensuring that the alerts you see are actionable and high-priority.
|
|
13
|
+
* **Multi-Language Support**: Offers out-of-the-box analysis for Python, JavaScript, TypeScript, Java, Go, Ruby, and PHP, allowing you to secure full-stack applications with a single tool.
|
|
14
|
+
* **CI/CD Ready**: Designed to integrate directly into deployment pipelines. You can enforce security standards by configuring failure thresholds based on severity levels (e.g., failing builds on CRITICAL findings) and overall security scoring.
|
|
15
|
+
* **AI Prescriptions**: Rather than just pointing out flaws, CanoP automatically generates structured `fixes.json` payloads. These contain specific prompts designed to be fed back into Large Language Models (LLMs) for immediate, context-aware remediation.
|
|
16
|
+
* **Standardized Reporting**: Exports findings to standard JSON or SARIF (Static Analysis Results Interchange Format) for seamless integration with GitHub Advanced Security and enterprise vulnerability management platforms.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
CanoP is distributed as a standard Python package via PyPI. Install it globally in your environment using `pip`:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install canop
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Verify the installation to ensure the CLI is available in your system path:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
canop --version
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
Initialize the configuration files in your repository. This command creates a `.canop.yml` policy file and a `.canopignore` file to exclude noisy directories like `node_modules` or `venv` from the scan:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
canop init
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run a comprehensive security scan against your current directory. The scanner evaluates your code against the internal rule engine and outputs a detailed table with a final security score:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
canop scan .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Scan only files that have been modified in git. This dramatically reduces scan time and is ideal for pre-commit hooks, ensuring new code is secure before it is committed:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
canop scan . --changed
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Advanced Usage
|
|
53
|
+
|
|
54
|
+
### Continuous Integration / Continuous Deployment (CI/CD)
|
|
55
|
+
|
|
56
|
+
CanoP is built to act as a security gatekeeper in automated deployment pipelines (such as GitHub Actions or GitLab CI). You can configure the scanner to return a non-zero exit code—which automatically fails the build—if specific security criteria are not met.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Fail the deployment pipeline if any CRITICAL or HIGH vulnerabilities are found
|
|
60
|
+
canop scan . --fail-on HIGH
|
|
61
|
+
|
|
62
|
+
# Fail the deployment pipeline if the aggregate security score falls below 85
|
|
63
|
+
canop scan . --min-score 85
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Exporting Results
|
|
67
|
+
|
|
68
|
+
For teams that require historical tracking, auditing, or integration with external systems, CanoP supports multiple output formats.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Export the raw native Python dictionary data to a standard JSON file for custom parsing
|
|
72
|
+
canop scan . --json-out results.json
|
|
73
|
+
|
|
74
|
+
# Export to SARIF (Static Analysis Results Interchange Format).
|
|
75
|
+
# Uploading this file to GitHub allows GitHub to display the vulnerabilities inline in Pull Requests.
|
|
76
|
+
canop scan . --sarif results.sarif
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Automated Remediation
|
|
80
|
+
|
|
81
|
+
CanoP extracts the remediation metadata from its rules engine to generate prompts that instruct AI coding assistants on exactly how to fix the detected vulnerabilities.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Generate a fixes.json file containing actionable prompts for your LLM
|
|
85
|
+
canop scan . --prescriptions fixes.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Configuration
|
|
89
|
+
|
|
90
|
+
CanoP behavior can be codified using a `.canop.yml` file placed in the root of your project. This file acts as a centralized security policy, ensuring all developers and CI/CD pipelines adhere to the same thresholds.
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
# .canop.yml
|
|
94
|
+
# Require a minimum security grade to pass the pipeline
|
|
95
|
+
min_grade: B
|
|
96
|
+
|
|
97
|
+
# Treat these specific severity levels as pipeline failures
|
|
98
|
+
fail_on:
|
|
99
|
+
- CRITICAL
|
|
100
|
+
- HIGH
|
|
101
|
+
|
|
102
|
+
# Ignore specific paths from being scanned
|
|
103
|
+
ignore:
|
|
104
|
+
- "tests/**"
|
|
105
|
+
- "docs/**"
|
|
106
|
+
|
|
107
|
+
# Allow a certain number of findings before returning a non-zero exit code (0 = strictly unlimited)
|
|
108
|
+
max_findings: 0
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
You can also rely on `.canopignore` to define specific files or directories that the scanner should skip. It utilizes standard glob patterns, functioning identically to `.gitignore`.
|
|
112
|
+
|
|
113
|
+
## Local Development
|
|
114
|
+
|
|
115
|
+
If you wish to contribute to the CLI or test changes locally, clone the repository and install it in editable mode. Editable mode maps the `canop` terminal command directly to your live source code.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git clone https://github.com/your-org/canop-cli.git
|
|
119
|
+
cd canop-cli
|
|
120
|
+
pip install -e .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Rule Development
|
|
124
|
+
|
|
125
|
+
Security rules are defined in the standard Semgrep YAML format and are located within `canop/rules/*.yml`. Please see `CONTRIBUTING.md` for comprehensive guidelines on how to structure, test, and submit new rules to expand the scanner's detection capabilities.
|
|
126
|
+
|
|
127
|
+
## Support
|
|
128
|
+
|
|
129
|
+
If you find any bugs, have feature requests, or need general help, please open an issue on GitHub or contact us directly at canop.security@gmail.com.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|