devguard-scanner 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.
Files changed (81) hide show
  1. devguard_scanner-0.1.0/.gitignore +18 -0
  2. devguard_scanner-0.1.0/CHANGELOG.md +23 -0
  3. devguard_scanner-0.1.0/LICENSE +201 -0
  4. devguard_scanner-0.1.0/PKG-INFO +84 -0
  5. devguard_scanner-0.1.0/README.md +51 -0
  6. devguard_scanner-0.1.0/docs/README.md +15 -0
  7. devguard_scanner-0.1.0/pyproject.toml +89 -0
  8. devguard_scanner-0.1.0/src/devguard/__init__.py +5 -0
  9. devguard_scanner-0.1.0/src/devguard/ai/__init__.py +0 -0
  10. devguard_scanner-0.1.0/src/devguard/ai/investigator.py +380 -0
  11. devguard_scanner-0.1.0/src/devguard/ai/prompts.py +113 -0
  12. devguard_scanner-0.1.0/src/devguard/ai/providers/__init__.py +0 -0
  13. devguard_scanner-0.1.0/src/devguard/ai/providers/anthropic.py +163 -0
  14. devguard_scanner-0.1.0/src/devguard/ai/providers/openai_compat.py +157 -0
  15. devguard_scanner-0.1.0/src/devguard/ai/registry.py +160 -0
  16. devguard_scanner-0.1.0/src/devguard/ai/run.py +119 -0
  17. devguard_scanner-0.1.0/src/devguard/ai/sdk.py +102 -0
  18. devguard_scanner-0.1.0/src/devguard/ai/testing.py +126 -0
  19. devguard_scanner-0.1.0/src/devguard/ai/tools.py +389 -0
  20. devguard_scanner-0.1.0/src/devguard/analyzers/__init__.py +0 -0
  21. devguard_scanner-0.1.0/src/devguard/analyzers/base.py +135 -0
  22. devguard_scanner-0.1.0/src/devguard/analyzers/carriers.py +345 -0
  23. devguard_scanner-0.1.0/src/devguard/analyzers/command.py +343 -0
  24. devguard_scanner-0.1.0/src/devguard/analyzers/content.py +240 -0
  25. devguard_scanner-0.1.0/src/devguard/analyzers/filesystem.py +142 -0
  26. devguard_scanner-0.1.0/src/devguard/analyzers/hidden.py +273 -0
  27. devguard_scanner-0.1.0/src/devguard/analyzers/imports.py +102 -0
  28. devguard_scanner-0.1.0/src/devguard/analyzers/jsonc.py +221 -0
  29. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/__init__.py +0 -0
  30. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/ai_assistants.py +318 -0
  31. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/autoload.py +142 -0
  32. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/common.py +242 -0
  33. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/deps.py +159 -0
  34. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/devcontainer.py +195 -0
  35. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/env.py +53 -0
  36. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/git.py +236 -0
  37. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/npm.py +304 -0
  38. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/python_pkg.py +138 -0
  39. devguard_scanner-0.1.0/src/devguard/analyzers/surfaces/vscode.py +515 -0
  40. devguard_scanner-0.1.0/src/devguard/cli.py +302 -0
  41. devguard_scanner-0.1.0/src/devguard/core/__init__.py +0 -0
  42. devguard_scanner-0.1.0/src/devguard/core/config.py +147 -0
  43. devguard_scanner-0.1.0/src/devguard/core/filetype.py +313 -0
  44. devguard_scanner-0.1.0/src/devguard/core/models.py +195 -0
  45. devguard_scanner-0.1.0/src/devguard/core/redact.py +72 -0
  46. devguard_scanner-0.1.0/src/devguard/core/safefs.py +280 -0
  47. devguard_scanner-0.1.0/src/devguard/core/scoring.py +60 -0
  48. devguard_scanner-0.1.0/src/devguard/core/service.py +211 -0
  49. devguard_scanner-0.1.0/src/devguard/correlate/__init__.py +0 -0
  50. devguard_scanner-0.1.0/src/devguard/correlate/chains.py +160 -0
  51. devguard_scanner-0.1.0/src/devguard/mcp/__init__.py +0 -0
  52. devguard_scanner-0.1.0/src/devguard/mcp/server.py +442 -0
  53. devguard_scanner-0.1.0/src/devguard/report/__init__.py +0 -0
  54. devguard_scanner-0.1.0/src/devguard/report/escape.py +31 -0
  55. devguard_scanner-0.1.0/src/devguard/report/markdown.py +242 -0
  56. devguard_scanner-0.1.0/src/devguard/report/sarif.py +96 -0
  57. devguard_scanner-0.1.0/src/devguard/report/terminal.py +47 -0
  58. devguard_scanner-0.1.0/src/devguard/report/writer.py +52 -0
  59. devguard_scanner-0.1.0/src/devguard/rules/__init__.py +0 -0
  60. devguard_scanner-0.1.0/src/devguard/rules/catalog.py +96 -0
  61. devguard_scanner-0.1.0/src/devguard/rules/content/ai_instructions.yaml +111 -0
  62. devguard_scanner-0.1.0/src/devguard/rules/content/cross_language.yaml +228 -0
  63. devguard_scanner-0.1.0/src/devguard/rules/content/docs.yaml +63 -0
  64. devguard_scanner-0.1.0/src/devguard/rules/content/javascript.yaml +171 -0
  65. devguard_scanner-0.1.0/src/devguard/rules/content/obfuscation.yaml +138 -0
  66. devguard_scanner-0.1.0/src/devguard/rules/content/python.yaml +144 -0
  67. devguard_scanner-0.1.0/src/devguard/rules/content/shell.yaml +109 -0
  68. devguard_scanner-0.1.0/src/devguard/rules/content/windows.yaml +95 -0
  69. devguard_scanner-0.1.0/src/devguard/rules/data/vscode_settings.yaml +81 -0
  70. devguard_scanner-0.1.0/tests/__init__.py +0 -0
  71. devguard_scanner-0.1.0/tests/conftest.py +36 -0
  72. devguard_scanner-0.1.0/tests/corpus/__init__.py +0 -0
  73. devguard_scanner-0.1.0/tests/corpus/samples.py +605 -0
  74. devguard_scanner-0.1.0/tests/test_ai.py +390 -0
  75. devguard_scanner-0.1.0/tests/test_corpus.py +41 -0
  76. devguard_scanner-0.1.0/tests/test_mcp.py +91 -0
  77. devguard_scanner-0.1.0/tests/test_parsers.py +81 -0
  78. devguard_scanner-0.1.0/tests/test_report_cli.py +118 -0
  79. devguard_scanner-0.1.0/tests/test_rules.py +53 -0
  80. devguard_scanner-0.1.0/tests/test_safefs.py +102 -0
  81. devguard_scanner-0.1.0/tests/test_safety.py +103 -0
@@ -0,0 +1,18 @@
1
+ # Private planning material (kept out of the repository)
2
+ docs/plan/
3
+ docs/previous/
4
+
5
+ # Python
6
+ .venv/
7
+ __pycache__/
8
+ *.py[cod]
9
+ .mypy_cache/
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .coverage
13
+ htmlcov/
14
+
15
+ # Build
16
+ dist/
17
+ build/
18
+ *.egg-info/
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/) and
4
+ the project uses [semantic versioning](https://semver.org).
5
+
6
+ ## Unreleased
7
+
8
+ ## 0.1.0
9
+
10
+ First release.
11
+
12
+ - Read-only scanner: no execution, no writes to the target, no symlink following, bounded reads and budgets.
13
+ - Surface analyzers for VS Code (tasks, launch, settings, workspaces, MCP), Claude Code hooks and permissions, MCP
14
+ configs (Cursor, Gemini, Windsurf, …), dev containers, npm/yarn/pnpm/bun, Python packaging, git config/hooks/
15
+ submodules, direnv and `.env` files, auto-loaded tool configs, and README instructions.
16
+ - 119 rules: content rules (YAML) for JavaScript/TypeScript, Python, shell, PowerShell/batch, AI instruction
17
+ files, and docs; hidden-content checks (bidi, invisible Unicode, off-screen code, encoded blobs); carriers
18
+ (executables, disguised files, archives, pickles); dependency sources and lockfiles.
19
+ - Attack-chain correlation from automatic triggers to dangerous code, up to three hops.
20
+ - Deterministic verdicts (`block` / `review` / `indicators` / `no-indicators`), Markdown, JSON, and SARIF reports.
21
+ - Optional AI investigation with pluggable providers (Claude, OpenAI, OpenAI-compatible, Python plugins), consent,
22
+ budgets, read-only tools, citation verification, and caching.
23
+ - MCP server with `scan_workspace`, `check_command`, findings, and rule tools.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.5
2
+ Name: devguard-scanner
3
+ Version: 0.1.0
4
+ Summary: Scan untrusted code repositories for malware before you open, install, or run them. Files are analyzed as data and never executed.
5
+ Project-URL: Homepage, https://github.com/yilmazhasan/dev-guard
6
+ Project-URL: Documentation, https://github.com/yilmazhasan/dev-guard/tree/main/docs
7
+ Project-URL: Issues, https://github.com/yilmazhasan/dev-guard/issues
8
+ Project-URL: Changelog, https://github.com/yilmazhasan/dev-guard/blob/main/CHANGELOG.md
9
+ Author: yilmazhasan
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: devsecops,malware,mcp,scanner,security,supply-chain,vscode
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Security
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.12
24
+ Requires-Dist: pydantic<3,>=2.7
25
+ Requires-Dist: pyyaml<7,>=6.0.1
26
+ Provides-Extra: anthropic
27
+ Requires-Dist: anthropic<2,>=1.0; extra == 'anthropic'
28
+ Provides-Extra: mcp
29
+ Requires-Dist: mcp<3,>=2.3; extra == 'mcp'
30
+ Provides-Extra: openai
31
+ Requires-Dist: openai<4,>=1.50; extra == 'openai'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # DevGuard
35
+
36
+ Scan a repository for malware **before** you open it in your IDE, install its dependencies, or run it.
37
+
38
+ Malicious repositories (fake job-interview tasks, poisoned forks, hijacked packages) rarely wait for you to run
39
+ `main.py`. They run automatically: a VS Code task on folder open, an npm `postinstall` script, a git hook, an AI
40
+ assistant hook, a loader hidden in `tailwind.config.js`. DevGuard finds those triggers, follows them to the code
41
+ they run, and tells you whether it is safe to proceed. It reads files as data and **never executes anything**.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ pipx install devguard-scanner # or: uv tool install devguard-scanner
47
+ ```
48
+
49
+ ## Use
50
+
51
+ ```bash
52
+ devguard scan path/to/repo
53
+ ```
54
+
55
+ ```text
56
+ DevGuard scan complete
57
+ Target: interview-task
58
+ Verdict: BLOCK | Do not open, install, or run this project. Strong indicators of malicious behavior were found.
59
+ Findings: 5 (1 critical, 2 high, 1 medium, 1 low)
60
+ - [critical] Automatic trigger reaches dangerous code (package.json:5)
61
+ - [high] Browser profile data targeted (lib/collect.js:7)
62
+ - [high] Cryptocurrency wallet data targeted (lib/collect.js:10)
63
+ Report (md): ~/.local/share/devguard/reports/interview-task-1a2b3c4d/latest/report.md
64
+ ```
65
+
66
+ | Verdict | Meaning |
67
+ |---|---|
68
+ | `block` | Do not open, install, or run it. |
69
+ | `review` | Read the report first. |
70
+ | `indicators` | Weak signals only, often benign. |
71
+ | `no-indicators` | Nothing found by the enabled checks (not a guarantee). |
72
+
73
+ Exit code `1` means findings at or above `--fail-on` (default `high`), so it works as a CI gate.
74
+
75
+ ## More
76
+
77
+ - [Getting started](docs/getting-started.md): options, reports, exit codes
78
+ - [AI investigation](docs/ai.md): optional explanations from Claude, OpenAI, Gemini, or a local model
79
+ - [Provider plugins](docs/plugins.md): connect any LLM with a small Python file
80
+ - [MCP server](docs/mcp.md): let Claude Code, Cursor, or Copilot check a repo before acting on it
81
+ - [CI and pre-commit](docs/ci.md) · [Configuration](docs/configuration.md) · [How it works](docs/how-it-works.md)
82
+ - [Contributing](CONTRIBUTING.md) · [Security policy](SECURITY.md)
83
+
84
+ Licensed under [Apache-2.0](LICENSE).
@@ -0,0 +1,51 @@
1
+ # DevGuard
2
+
3
+ Scan a repository for malware **before** you open it in your IDE, install its dependencies, or run it.
4
+
5
+ Malicious repositories (fake job-interview tasks, poisoned forks, hijacked packages) rarely wait for you to run
6
+ `main.py`. They run automatically: a VS Code task on folder open, an npm `postinstall` script, a git hook, an AI
7
+ assistant hook, a loader hidden in `tailwind.config.js`. DevGuard finds those triggers, follows them to the code
8
+ they run, and tells you whether it is safe to proceed. It reads files as data and **never executes anything**.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pipx install devguard-scanner # or: uv tool install devguard-scanner
14
+ ```
15
+
16
+ ## Use
17
+
18
+ ```bash
19
+ devguard scan path/to/repo
20
+ ```
21
+
22
+ ```text
23
+ DevGuard scan complete
24
+ Target: interview-task
25
+ Verdict: BLOCK | Do not open, install, or run this project. Strong indicators of malicious behavior were found.
26
+ Findings: 5 (1 critical, 2 high, 1 medium, 1 low)
27
+ - [critical] Automatic trigger reaches dangerous code (package.json:5)
28
+ - [high] Browser profile data targeted (lib/collect.js:7)
29
+ - [high] Cryptocurrency wallet data targeted (lib/collect.js:10)
30
+ Report (md): ~/.local/share/devguard/reports/interview-task-1a2b3c4d/latest/report.md
31
+ ```
32
+
33
+ | Verdict | Meaning |
34
+ |---|---|
35
+ | `block` | Do not open, install, or run it. |
36
+ | `review` | Read the report first. |
37
+ | `indicators` | Weak signals only, often benign. |
38
+ | `no-indicators` | Nothing found by the enabled checks (not a guarantee). |
39
+
40
+ Exit code `1` means findings at or above `--fail-on` (default `high`), so it works as a CI gate.
41
+
42
+ ## More
43
+
44
+ - [Getting started](docs/getting-started.md): options, reports, exit codes
45
+ - [AI investigation](docs/ai.md): optional explanations from Claude, OpenAI, Gemini, or a local model
46
+ - [Provider plugins](docs/plugins.md): connect any LLM with a small Python file
47
+ - [MCP server](docs/mcp.md): let Claude Code, Cursor, or Copilot check a repo before acting on it
48
+ - [CI and pre-commit](docs/ci.md) · [Configuration](docs/configuration.md) · [How it works](docs/how-it-works.md)
49
+ - [Contributing](CONTRIBUTING.md) · [Security policy](SECURITY.md)
50
+
51
+ Licensed under [Apache-2.0](LICENSE).
@@ -0,0 +1,15 @@
1
+ # DevGuard documentation
2
+
3
+ | Guide | What it covers |
4
+ |---|---|
5
+ | [Getting started](getting-started.md) | Installing, scanning, verdicts, reports, exit codes, a safe workflow for untrusted repos |
6
+ | [Configuration](configuration.md) | The user config file, every option, limits, exclusions |
7
+ | [AI investigation](ai.md) | Enabling the optional AI layer, provider profiles (Claude, OpenAI, Gemini, local), consent, costs |
8
+ | [Provider plugins](plugins.md) | Writing your own LLM provider in Python, testing it, sharing it |
9
+ | [MCP server](mcp.md) | Using DevGuard from Claude Code, Cursor, VS Code Copilot, Gemini CLI |
10
+ | [CI and pre-commit](ci.md) | GitHub Actions, SARIF upload, pre-commit hook |
11
+ | [How it works](how-it-works.md) | Pipeline, triggers and attack chains, what is and is not detected |
12
+ | [Rules](rules.md) | Rule catalogue, writing a detection rule |
13
+ | [Threat reference](threats.md) | The `TC-xx` threat identifiers that rules reference |
14
+ | [Dependencies](dependencies.md) | Why each runtime dependency exists |
15
+ | [Releasing](releasing.md) | Publishing to PyPI (maintainers) |
@@ -0,0 +1,89 @@
1
+ [project]
2
+ # PyPI distribution name ("devguard" is taken on PyPI). The import package and the CLI are both `devguard`.
3
+ name = "devguard-scanner"
4
+ dynamic = ["version"]
5
+ description = "Scan untrusted code repositories for malware before you open, install, or run them. Files are analyzed as data and never executed."
6
+ readme = "README.md"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ requires-python = ">=3.12"
10
+ authors = [{ name = "yilmazhasan" }]
11
+ keywords = ["security", "malware", "supply-chain", "scanner", "vscode", "mcp", "devsecops"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Security",
22
+ "Topic :: Software Development :: Quality Assurance",
23
+ ]
24
+ # Keep the base install small. Every dependency is justified in docs/dependencies.md.
25
+ dependencies = [
26
+ "pydantic>=2.7,<3",
27
+ "pyyaml>=6.0.1,<7",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ anthropic = ["anthropic>=1.0,<2"]
32
+ openai = ["openai>=1.50,<4"]
33
+ mcp = ["mcp>=2.3,<3"]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/yilmazhasan/dev-guard"
37
+ Documentation = "https://github.com/yilmazhasan/dev-guard/tree/main/docs"
38
+ Issues = "https://github.com/yilmazhasan/dev-guard/issues"
39
+ Changelog = "https://github.com/yilmazhasan/dev-guard/blob/main/CHANGELOG.md"
40
+
41
+ [project.scripts]
42
+ devguard = "devguard.cli:main"
43
+
44
+ [project.entry-points."devguard.ai_providers"]
45
+ anthropic = "devguard.ai.providers.anthropic:make_provider"
46
+ openai = "devguard.ai.providers.openai_compat:make_openai_provider"
47
+ openai-compatible = "devguard.ai.providers.openai_compat:make_provider"
48
+
49
+ [dependency-groups]
50
+ dev = [
51
+ "pytest>=8",
52
+ "ruff>=0.6",
53
+ "mypy>=1.11",
54
+ "types-PyYAML",
55
+ ]
56
+
57
+ [build-system]
58
+ requires = ["hatchling>=1.25"]
59
+ build-backend = "hatchling.build"
60
+
61
+ [tool.hatch.version]
62
+ path = "src/devguard/__init__.py"
63
+
64
+ [tool.hatch.build.targets.sdist]
65
+ include = ["src/devguard", "tests", "README.md", "LICENSE", "CHANGELOG.md"]
66
+
67
+ [tool.hatch.build.targets.wheel]
68
+ packages = ["src/devguard"]
69
+
70
+ [tool.pytest.ini_options]
71
+ testpaths = ["tests"]
72
+ addopts = "-q"
73
+
74
+ [tool.ruff]
75
+ line-length = 120
76
+ target-version = "py312"
77
+
78
+ [tool.ruff.lint]
79
+ select = ["E", "F", "W", "I", "B", "UP", "S", "RUF"]
80
+ ignore = ["S101", "RUF001", "RUF002", "RUF003"]
81
+
82
+ [tool.ruff.lint.per-file-ignores]
83
+ "tests/**" = ["S", "E501"]
84
+
85
+ [tool.mypy]
86
+ python_version = "3.12"
87
+ packages = ["devguard"]
88
+ mypy_path = "src"
89
+ ignore_missing_imports = true
@@ -0,0 +1,5 @@
1
+ """DevGuard: pre-open security scanner for untrusted code workspaces."""
2
+
3
+ __version__ = "0.1.0"
4
+ RULESET_VERSION = "2026.10.0"
5
+ SCHEMA_VERSION = "1"
File without changes