spellwarden 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.
- spellwarden-0.1.0/.gitignore +8 -0
- spellwarden-0.1.0/CHANGELOG.md +11 -0
- spellwarden-0.1.0/LICENSE +201 -0
- spellwarden-0.1.0/PKG-INFO +143 -0
- spellwarden-0.1.0/README.md +122 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-001-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-001-positive.json +45 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-002-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-002-positive.json +38 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-003-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-003-positive.json +54 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-004-negative.json +51 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-004-positive.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-005-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-005-positive.json +54 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-006-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-006-positive.json +54 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-007-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-007-positive.json +53 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-008-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-008-positive.json +56 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-009-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-009-positive.json +18 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-010-negative.json +47 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-010-positive.json +49 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-011-negative.json +55 -0
- spellwarden-0.1.0/fixtures/probes/rules/SW-MCP-011-positive.json +62 -0
- spellwarden-0.1.0/fixtures/probes/samples/billing-lookup.json +57 -0
- spellwarden-0.1.0/fixtures/probes/samples/ci-logs.json +51 -0
- spellwarden-0.1.0/fixtures/probes/samples/crm-search.json +49 -0
- spellwarden-0.1.0/fixtures/probes/samples/deploy-orchestrator.json +53 -0
- spellwarden-0.1.0/fixtures/probes/samples/future-ready.json +52 -0
- spellwarden-0.1.0/fixtures/probes/samples/grafana-query.json +58 -0
- spellwarden-0.1.0/fixtures/probes/samples/incident-notes.json +52 -0
- spellwarden-0.1.0/fixtures/probes/samples/jira-bridge.json +41 -0
- spellwarden-0.1.0/fixtures/probes/samples/k8s-readonly.json +52 -0
- spellwarden-0.1.0/fixtures/probes/samples/legacy-reports.json +42 -0
- spellwarden-0.1.0/fixtures/probes/samples/s3-docs.json +42 -0
- spellwarden-0.1.0/fixtures/probes/samples/terraform-runner.json +52 -0
- spellwarden-0.1.0/fixtures/probes/samples/ticket-triage.json +40 -0
- spellwarden-0.1.0/fixtures/probes/samples/vault-reader.json +41 -0
- spellwarden-0.1.0/fixtures/probes/samples/warehouse-sql.json +43 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-001/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-001/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-001/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-001/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-002/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-002/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-003/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-003/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-003/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-003/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/negative/scripts/run.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-004/positive/scripts/run.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-005/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-005/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-005/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-005/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/negative/scripts/clean.sh +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-006/positive/scripts/clean.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-007/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-007/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-007/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-007/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/negative/scripts/collect.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-008/positive/scripts/collect.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/negative/scripts/setup.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-009/positive/scripts/setup.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/negative/tools/helper.sh +2 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-010/positive/tools/helper.exe +1 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-011/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-011/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-011/negative/scripts/deploy.sh +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-011/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-012/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-012/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-012/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-012/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-013/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-013/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-013/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-013/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/negative/scripts/run.py +1 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/positive/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-014/positive/scripts/run.py +1 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-015/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-015/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-015/positive/SKILL.md +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-015/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-019/negative/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-019/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-019/positive/SKILL.md +11 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-019/positive/expected.json +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-031/negative/SKILL.md +10 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-031/negative/expected.json +3 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-031/positive/SKILL.md +6 -0
- spellwarden-0.1.0/fixtures/skills/SW-SKL-031/positive/expected.json +10 -0
- spellwarden-0.1.0/pyproject.toml +51 -0
- spellwarden-0.1.0/src/spellwarden_scan/__init__.py +28 -0
- spellwarden-0.1.0/src/spellwarden_scan/archive.py +209 -0
- spellwarden-0.1.0/src/spellwarden_scan/canonical.py +16 -0
- spellwarden-0.1.0/src/spellwarden_scan/checklist.py +51 -0
- spellwarden-0.1.0/src/spellwarden_scan/curation.py +48 -0
- spellwarden-0.1.0/src/spellwarden_scan/evidence.py +101 -0
- spellwarden-0.1.0/src/spellwarden_scan/frontmatter.py +102 -0
- spellwarden-0.1.0/src/spellwarden_scan/model.py +193 -0
- spellwarden-0.1.0/src/spellwarden_scan/package.py +173 -0
- spellwarden-0.1.0/src/spellwarden_scan/probe.py +187 -0
- spellwarden-0.1.0/src/spellwarden_scan/rules/__init__.py +107 -0
- spellwarden-0.1.0/src/spellwarden_scan/rules/mcp.py +251 -0
- spellwarden-0.1.0/src/spellwarden_scan/rules/patterns.py +149 -0
- spellwarden-0.1.0/src/spellwarden_scan/rules/skill.py +692 -0
- spellwarden-0.1.0/src/spellwarden_scan/scan.py +47 -0
- spellwarden-0.1.0/src/spellwarden_scan/version.py +3 -0
- spellwarden-0.1.0/tests/conftest.py +110 -0
- spellwarden-0.1.0/tests/test_archive.py +241 -0
- spellwarden-0.1.0/tests/test_canonical.py +23 -0
- spellwarden-0.1.0/tests/test_checklist.py +53 -0
- spellwarden-0.1.0/tests/test_curation.py +90 -0
- spellwarden-0.1.0/tests/test_evidence.py +87 -0
- spellwarden-0.1.0/tests/test_fixture_coverage.py +71 -0
- spellwarden-0.1.0/tests/test_frontmatter.py +69 -0
- spellwarden-0.1.0/tests/test_linear_time.py +61 -0
- spellwarden-0.1.0/tests/test_model.py +45 -0
- spellwarden-0.1.0/tests/test_probe.py +110 -0
- spellwarden-0.1.0/tests/test_pure.py +57 -0
- spellwarden-0.1.0/tests/test_rules_mcp.py +190 -0
- spellwarden-0.1.0/tests/test_rules_skill.py +326 -0
- spellwarden-0.1.0/tests/test_sample_servers.py +44 -0
- spellwarden-0.1.0/tests/test_scan.py +88 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-10-19)
|
|
4
|
+
|
|
5
|
+
The first release: the engine of the hosted Spellwarden product as a library.
|
|
6
|
+
|
|
7
|
+
- `scan_skill_package` with 17 skill rules (SW-SKL-001 to 015, 019, 031), the canonical package hash, frontmatter metadata, bounded findings (500 per scan, 100 per rule, worst severity first) and masked evidence.
|
|
8
|
+
- `evaluate_probe` with 11 MCP rules (SW-MCP-001 to 011), transport, authentication and spec-version classification, deprecated features, migration status and the twelve-item migration checklist.
|
|
9
|
+
- `curation_score`, `is_curated`, `is_quarantined`.
|
|
10
|
+
- `unpack_zip` with zip-slip, symlink, size and file-count protection; `canonical_sha256`; `parse_frontmatter`; `mask_credentials`.
|
|
11
|
+
- Rules version `2026.10.0`.
|
|
@@ -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,143 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: spellwarden
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The Spellwarden scan engine: baseline rules for agent skills and MCP servers, probe classification, migration checklist and curation score. Pure code, no I/O.
|
|
5
|
+
Project-URL: Homepage, https://spellwarden.ai
|
|
6
|
+
Project-URL: Source, https://github.com/spellwarden-ai/spellwarden
|
|
7
|
+
Author: Spellwarden
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agent-skills,mcp,scanner,security
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: pyyaml>=6.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# spellwarden
|
|
23
|
+
|
|
24
|
+
The Spellwarden scan engine: the baseline rules for agent skills and MCP servers, the probe classification against the 2026-07-28 MCP specification, the migration checklist and the curation score. It is the engine of the hosted product at [spellwarden.ai](https://spellwarden.ai) and is published so that the same rules run in your own tooling.
|
|
25
|
+
|
|
26
|
+
This package is pure code. It never opens a connection, reads a file or an environment variable: you hand it the bytes of a package or the recorded result of a probe, and it hands back findings. The command-line scanner, discovery in a repository and the CI wrappers arrive in a later release; this one is the library they are built on.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
pip install spellwarden
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Python 3.11 or newer. The only dependency is PyYAML.
|
|
33
|
+
|
|
34
|
+
## Scanning a skill package
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from spellwarden_scan import RuleSet, scan_skill_package, unpack_zip
|
|
38
|
+
|
|
39
|
+
files, executable = unpack_zip(open_bytes, with_modes=True) # or any {path: bytes} mapping you built yourself
|
|
40
|
+
result = scan_skill_package(files, RuleSet.baseline(), executable_paths=executable)
|
|
41
|
+
for finding in result.findings:
|
|
42
|
+
print(finding.rule_id, finding.severity, finding.location.path, finding.location.line, finding.evidence)
|
|
43
|
+
print(result.sha256, result.metadata.name, result.truncated)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `files` maps POSIX relative paths to bytes. `root` names the directory that holds `SKILL.md` when it is not the package root.
|
|
47
|
+
- `unpack_zip(data, limits=ArchiveLimits(), with_modes=False)` reads a zip held in memory and refuses unsafe archives with an `ArchiveError` whose `code` is one of `too_large`, `too_many_files`, `unsafe_path`, `symlink`, `bad_zip`, `empty`. The default limits are 20 MiB compressed, 50 MiB uncompressed, 2000 files, 10 MiB per file.
|
|
48
|
+
- `result.sha256` is the canonical hash of the package: SHA-256 over `path NUL content NUL` for every path in sorted order, stable across archive layout.
|
|
49
|
+
- `result.metadata` holds `name`, `description`, `version`, `license`, `publisher` from the frontmatter (nested `metadata:` keys and `author` are read too), which of them are present, and the problems that rule SW-SKL-015 reports.
|
|
50
|
+
- `max_findings` (500) and `max_per_rule` (100) bound what the scan keeps; rules run worst severity first and `result.truncated` counts the matches that were not kept.
|
|
51
|
+
- Evidence is at most 300 characters and credential-shaped text in it is masked. `fingerprint` is the SHA-256 of rule id, path and matched text, so a finding keeps its identity across scans.
|
|
52
|
+
|
|
53
|
+
## Evaluating an MCP server probe
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from spellwarden_scan import ProbeResult, RuleSet, evaluate_probe
|
|
57
|
+
|
|
58
|
+
probe = ProbeResult.from_dict(recorded) # what your prober recorded; every field has a default
|
|
59
|
+
result = evaluate_probe(probe, RuleSet.baseline())
|
|
60
|
+
print(result.transport, result.auth_mode, result.spec_version, result.migration_status)
|
|
61
|
+
for item in result.checklist:
|
|
62
|
+
print(item.order, item.text)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`ProbeResult` is the record of an unauthenticated probe: the `server/discover` or `initialize` result, the status and content type of the POST and GET, whether a session header was seen, the `tools/list` answer, the RFC 9728 protected resource metadata and the authorization server metadata. The classification follows one rule set:
|
|
66
|
+
|
|
67
|
+
- transport: `streamable-http`, `sse`, `stdio` (a repository without an endpoint) or `unknown`;
|
|
68
|
+
- authentication: `none`, `static-key`, `oauth-dcr`, `oauth-cimd`, `xaa` or `unknown`;
|
|
69
|
+
- spec version: the highest `supportedVersions` date of `server/discover`, else the negotiated `initialize` version;
|
|
70
|
+
- deprecated features, in a fixed order: `sse`, `initialize_only`, `sessions`, `roots`, `sampling`, `logging`, `dcr`;
|
|
71
|
+
- `migration_status`: `ready` when the spec version is 2026-07-28 or later, authentication is CIMD or XAA and nothing deprecated is in use; `to_migrate` otherwise; `not_probeable` for stdio servers.
|
|
72
|
+
|
|
73
|
+
The checklist has twelve items in a fixed order, each present only when it applies (move to streamable HTTP; add `server/discover`; remove sessions; carry the protocol version and capabilities in `_meta`; replace `sampling/createMessage` with an `input_required` result; replace Logging with a per-request `_meta` log level; move long jobs to the Tasks extension; register a Client ID Metadata Document and enable OAuth with RFC 9728 and RFC 8707; validate `iss`; set `ttlMs` and `cacheScope` on list results; propagate `traceparent`; re-run the scan, which is always last).
|
|
74
|
+
|
|
75
|
+
## Curation score
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from spellwarden_scan import CurationInputs, curation_score, is_curated, is_quarantined
|
|
79
|
+
|
|
80
|
+
inputs = CurationInputs(open_findings=open_ones, accepted_findings=accepted_ones, metadata_present=5, eval_component=0.5)
|
|
81
|
+
score = curation_score(inputs) # 0 to 12, one decimal
|
|
82
|
+
curated = is_curated(inputs, score) # score >= 8, no open critical or high finding, hash unchanged, not quarantined
|
|
83
|
+
quarantined = is_quarantined(open_ones) # any open finding from a malicious-indicator rule
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The score is `12 x (0.6 S + 0.2 M + 0.2 E)`: `S = max(0, 1 - (6 critical + 3 high + 1 medium + 0.25 low) / 12)` over open findings with accepted findings at half weight, `M` the share of the five metadata fields present, `E` an evaluation component that is 0.5 until evaluations exist.
|
|
87
|
+
|
|
88
|
+
## The rules
|
|
89
|
+
|
|
90
|
+
Ids are `SW-SKL-NNN` (skill packages) and `SW-MCP-NNN` (MCP servers). Mappings use the OWASP Agentic Top 10 (ASI) and OWASP MCP Top 10 (MCP) identifiers and NIST SP 800-53 base controls, labelled as a provisional mapping to SP 800-53 base controls. Two rules are malicious indicators: an open finding from one of them quarantines the package.
|
|
91
|
+
|
|
92
|
+
| Id | Title | Severity | OWASP | NIST |
|
|
93
|
+
|---|---|---|---|---|
|
|
94
|
+
| SW-SKL-001 | Prompt-injection phrases in skill instructions | high | ASI01 | SI-10 |
|
|
95
|
+
| SW-SKL-002 | Hidden text: zero-width or bidirectional control characters | high | ASI01 | SI-10 |
|
|
96
|
+
| SW-SKL-003 | Instructions to skip approvals or disable hooks | high | ASI10 | AC-6 |
|
|
97
|
+
| SW-SKL-004 | Encoded payload decoded and executed (malicious indicator) | critical | ASI04 | SR-3 |
|
|
98
|
+
| SW-SKL-005 | Writes to agent configuration | high | ASI10 | AC-6 |
|
|
99
|
+
| SW-SKL-006 | Destructive command without a confirmation step | medium | ASI10 | AC-6 |
|
|
100
|
+
| SW-SKL-007 | Remote script piped to a shell | high | ASI04 | SR-3 |
|
|
101
|
+
| SW-SKL-008 | Sends local file contents to an external host (malicious indicator) | critical | ASI10 | SC-7 |
|
|
102
|
+
| SW-SKL-009 | Unpinned dependency install | medium | ASI04 | SR-3 |
|
|
103
|
+
| SW-SKL-010 | Bundled binary or executable file | medium | ASI04 | SR-3 |
|
|
104
|
+
| SW-SKL-011 | Hard-coded credential in the package | critical | MCP01 | IA-5 |
|
|
105
|
+
| SW-SKL-012 | Reads a credential file path without stating purpose | medium | ASI04 | IA-5 |
|
|
106
|
+
| SW-SKL-013 | Network calls to raw IP addresses or URL shorteners | medium | ASI10 | SC-7 |
|
|
107
|
+
| SW-SKL-014 | Obfuscated script code | medium | ASI04 | SR-3 |
|
|
108
|
+
| SW-SKL-015 | Frontmatter missing or invalid (name, description) | low | ASI04 | SR-3 |
|
|
109
|
+
| SW-SKL-019 | Fetches external URL content into context without an allowlist | medium | ASI01, MCP10 | SI-10 |
|
|
110
|
+
| SW-SKL-031 | Missing license and version metadata | low | ASI04 | SR-3 |
|
|
111
|
+
| SW-MCP-001 | Server lists tools without authentication | high | MCP01 | AC-3 |
|
|
112
|
+
| SW-MCP-002 | Static key authentication instead of OAuth | medium | MCP01 | IA-5 |
|
|
113
|
+
| SW-MCP-003 | OAuth dynamic client registration (deprecated; use Client ID Metadata Documents) | medium | MCP01 | IA-5 |
|
|
114
|
+
| SW-MCP-004 | HTTP+SSE transport (deprecated) | medium | ASI04 | SR-3 |
|
|
115
|
+
| SW-MCP-005 | Spec version older than 2026-07-28 | low | ASI04 | SR-3 |
|
|
116
|
+
| SW-MCP-006 | Protocol sessions (Mcp-Session-Id) in use | medium | ASI04 | SR-3 |
|
|
117
|
+
| SW-MCP-007 | Requires the initialize handshake; no server/discover | medium | ASI04 | SR-3 |
|
|
118
|
+
| SW-MCP-008 | Uses deprecated Roots, Sampling or Logging | medium | ASI04 | SR-3 |
|
|
119
|
+
| SW-MCP-009 | Endpoint not served over HTTPS | high | MCP01 | SC-7 |
|
|
120
|
+
| SW-MCP-010 | No protected resource metadata, or issuer not validated | medium | MCP01 | IA-5 |
|
|
121
|
+
| SW-MCP-011 | Tool description contains instruction-like text | high | ASI01, MCP10 | SI-10 |
|
|
122
|
+
|
|
123
|
+
Ids 016 to 018 and 020 to 030 are reserved. `RuleSet.baseline()` returns these rules; `ruleset.with_rules(extra)` adds your own `Rule` objects built with `spellwarden_scan.rules.make_rule`.
|
|
124
|
+
|
|
125
|
+
## Versions
|
|
126
|
+
|
|
127
|
+
`spellwarden_scan.__version__` is the package version and `spellwarden_scan.RULES_VERSION` (`YYYY.MM.N`) the rule set's. A change to what any rule detects bumps both the rules version and the package minor version; a fix anywhere else bumps the patch. Every scan result carries both, so a stored finding always says which rules produced it.
|
|
128
|
+
|
|
129
|
+
## Releases
|
|
130
|
+
|
|
131
|
+
Releases are built and published by GitHub Actions through PyPI trusted publishing (OpenID Connect): a push of a tag `vX.Y.Z` whose version equals the one in `pyproject.toml` builds the sdist and the wheel and publishes them from the `pypi` environment. No API token exists anywhere. The sources are checked on Python 3.11, 3.12 and 3.13 on every push.
|
|
132
|
+
|
|
133
|
+
## Development
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
make check # ruff, pytest, uv build
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`tests/test_pure.py` fails the build if any module reaches for the network, the file system or the environment; `tests/test_fixture_coverage.py` fails it if a rule lacks a positive or a negative fixture.
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
Apache-2.0. See `LICENSE`.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# spellwarden
|
|
2
|
+
|
|
3
|
+
The Spellwarden scan engine: the baseline rules for agent skills and MCP servers, the probe classification against the 2026-07-28 MCP specification, the migration checklist and the curation score. It is the engine of the hosted product at [spellwarden.ai](https://spellwarden.ai) and is published so that the same rules run in your own tooling.
|
|
4
|
+
|
|
5
|
+
This package is pure code. It never opens a connection, reads a file or an environment variable: you hand it the bytes of a package or the recorded result of a probe, and it hands back findings. The command-line scanner, discovery in a repository and the CI wrappers arrive in a later release; this one is the library they are built on.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
pip install spellwarden
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Python 3.11 or newer. The only dependency is PyYAML.
|
|
12
|
+
|
|
13
|
+
## Scanning a skill package
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from spellwarden_scan import RuleSet, scan_skill_package, unpack_zip
|
|
17
|
+
|
|
18
|
+
files, executable = unpack_zip(open_bytes, with_modes=True) # or any {path: bytes} mapping you built yourself
|
|
19
|
+
result = scan_skill_package(files, RuleSet.baseline(), executable_paths=executable)
|
|
20
|
+
for finding in result.findings:
|
|
21
|
+
print(finding.rule_id, finding.severity, finding.location.path, finding.location.line, finding.evidence)
|
|
22
|
+
print(result.sha256, result.metadata.name, result.truncated)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `files` maps POSIX relative paths to bytes. `root` names the directory that holds `SKILL.md` when it is not the package root.
|
|
26
|
+
- `unpack_zip(data, limits=ArchiveLimits(), with_modes=False)` reads a zip held in memory and refuses unsafe archives with an `ArchiveError` whose `code` is one of `too_large`, `too_many_files`, `unsafe_path`, `symlink`, `bad_zip`, `empty`. The default limits are 20 MiB compressed, 50 MiB uncompressed, 2000 files, 10 MiB per file.
|
|
27
|
+
- `result.sha256` is the canonical hash of the package: SHA-256 over `path NUL content NUL` for every path in sorted order, stable across archive layout.
|
|
28
|
+
- `result.metadata` holds `name`, `description`, `version`, `license`, `publisher` from the frontmatter (nested `metadata:` keys and `author` are read too), which of them are present, and the problems that rule SW-SKL-015 reports.
|
|
29
|
+
- `max_findings` (500) and `max_per_rule` (100) bound what the scan keeps; rules run worst severity first and `result.truncated` counts the matches that were not kept.
|
|
30
|
+
- Evidence is at most 300 characters and credential-shaped text in it is masked. `fingerprint` is the SHA-256 of rule id, path and matched text, so a finding keeps its identity across scans.
|
|
31
|
+
|
|
32
|
+
## Evaluating an MCP server probe
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from spellwarden_scan import ProbeResult, RuleSet, evaluate_probe
|
|
36
|
+
|
|
37
|
+
probe = ProbeResult.from_dict(recorded) # what your prober recorded; every field has a default
|
|
38
|
+
result = evaluate_probe(probe, RuleSet.baseline())
|
|
39
|
+
print(result.transport, result.auth_mode, result.spec_version, result.migration_status)
|
|
40
|
+
for item in result.checklist:
|
|
41
|
+
print(item.order, item.text)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`ProbeResult` is the record of an unauthenticated probe: the `server/discover` or `initialize` result, the status and content type of the POST and GET, whether a session header was seen, the `tools/list` answer, the RFC 9728 protected resource metadata and the authorization server metadata. The classification follows one rule set:
|
|
45
|
+
|
|
46
|
+
- transport: `streamable-http`, `sse`, `stdio` (a repository without an endpoint) or `unknown`;
|
|
47
|
+
- authentication: `none`, `static-key`, `oauth-dcr`, `oauth-cimd`, `xaa` or `unknown`;
|
|
48
|
+
- spec version: the highest `supportedVersions` date of `server/discover`, else the negotiated `initialize` version;
|
|
49
|
+
- deprecated features, in a fixed order: `sse`, `initialize_only`, `sessions`, `roots`, `sampling`, `logging`, `dcr`;
|
|
50
|
+
- `migration_status`: `ready` when the spec version is 2026-07-28 or later, authentication is CIMD or XAA and nothing deprecated is in use; `to_migrate` otherwise; `not_probeable` for stdio servers.
|
|
51
|
+
|
|
52
|
+
The checklist has twelve items in a fixed order, each present only when it applies (move to streamable HTTP; add `server/discover`; remove sessions; carry the protocol version and capabilities in `_meta`; replace `sampling/createMessage` with an `input_required` result; replace Logging with a per-request `_meta` log level; move long jobs to the Tasks extension; register a Client ID Metadata Document and enable OAuth with RFC 9728 and RFC 8707; validate `iss`; set `ttlMs` and `cacheScope` on list results; propagate `traceparent`; re-run the scan, which is always last).
|
|
53
|
+
|
|
54
|
+
## Curation score
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from spellwarden_scan import CurationInputs, curation_score, is_curated, is_quarantined
|
|
58
|
+
|
|
59
|
+
inputs = CurationInputs(open_findings=open_ones, accepted_findings=accepted_ones, metadata_present=5, eval_component=0.5)
|
|
60
|
+
score = curation_score(inputs) # 0 to 12, one decimal
|
|
61
|
+
curated = is_curated(inputs, score) # score >= 8, no open critical or high finding, hash unchanged, not quarantined
|
|
62
|
+
quarantined = is_quarantined(open_ones) # any open finding from a malicious-indicator rule
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The score is `12 x (0.6 S + 0.2 M + 0.2 E)`: `S = max(0, 1 - (6 critical + 3 high + 1 medium + 0.25 low) / 12)` over open findings with accepted findings at half weight, `M` the share of the five metadata fields present, `E` an evaluation component that is 0.5 until evaluations exist.
|
|
66
|
+
|
|
67
|
+
## The rules
|
|
68
|
+
|
|
69
|
+
Ids are `SW-SKL-NNN` (skill packages) and `SW-MCP-NNN` (MCP servers). Mappings use the OWASP Agentic Top 10 (ASI) and OWASP MCP Top 10 (MCP) identifiers and NIST SP 800-53 base controls, labelled as a provisional mapping to SP 800-53 base controls. Two rules are malicious indicators: an open finding from one of them quarantines the package.
|
|
70
|
+
|
|
71
|
+
| Id | Title | Severity | OWASP | NIST |
|
|
72
|
+
|---|---|---|---|---|
|
|
73
|
+
| SW-SKL-001 | Prompt-injection phrases in skill instructions | high | ASI01 | SI-10 |
|
|
74
|
+
| SW-SKL-002 | Hidden text: zero-width or bidirectional control characters | high | ASI01 | SI-10 |
|
|
75
|
+
| SW-SKL-003 | Instructions to skip approvals or disable hooks | high | ASI10 | AC-6 |
|
|
76
|
+
| SW-SKL-004 | Encoded payload decoded and executed (malicious indicator) | critical | ASI04 | SR-3 |
|
|
77
|
+
| SW-SKL-005 | Writes to agent configuration | high | ASI10 | AC-6 |
|
|
78
|
+
| SW-SKL-006 | Destructive command without a confirmation step | medium | ASI10 | AC-6 |
|
|
79
|
+
| SW-SKL-007 | Remote script piped to a shell | high | ASI04 | SR-3 |
|
|
80
|
+
| SW-SKL-008 | Sends local file contents to an external host (malicious indicator) | critical | ASI10 | SC-7 |
|
|
81
|
+
| SW-SKL-009 | Unpinned dependency install | medium | ASI04 | SR-3 |
|
|
82
|
+
| SW-SKL-010 | Bundled binary or executable file | medium | ASI04 | SR-3 |
|
|
83
|
+
| SW-SKL-011 | Hard-coded credential in the package | critical | MCP01 | IA-5 |
|
|
84
|
+
| SW-SKL-012 | Reads a credential file path without stating purpose | medium | ASI04 | IA-5 |
|
|
85
|
+
| SW-SKL-013 | Network calls to raw IP addresses or URL shorteners | medium | ASI10 | SC-7 |
|
|
86
|
+
| SW-SKL-014 | Obfuscated script code | medium | ASI04 | SR-3 |
|
|
87
|
+
| SW-SKL-015 | Frontmatter missing or invalid (name, description) | low | ASI04 | SR-3 |
|
|
88
|
+
| SW-SKL-019 | Fetches external URL content into context without an allowlist | medium | ASI01, MCP10 | SI-10 |
|
|
89
|
+
| SW-SKL-031 | Missing license and version metadata | low | ASI04 | SR-3 |
|
|
90
|
+
| SW-MCP-001 | Server lists tools without authentication | high | MCP01 | AC-3 |
|
|
91
|
+
| SW-MCP-002 | Static key authentication instead of OAuth | medium | MCP01 | IA-5 |
|
|
92
|
+
| SW-MCP-003 | OAuth dynamic client registration (deprecated; use Client ID Metadata Documents) | medium | MCP01 | IA-5 |
|
|
93
|
+
| SW-MCP-004 | HTTP+SSE transport (deprecated) | medium | ASI04 | SR-3 |
|
|
94
|
+
| SW-MCP-005 | Spec version older than 2026-07-28 | low | ASI04 | SR-3 |
|
|
95
|
+
| SW-MCP-006 | Protocol sessions (Mcp-Session-Id) in use | medium | ASI04 | SR-3 |
|
|
96
|
+
| SW-MCP-007 | Requires the initialize handshake; no server/discover | medium | ASI04 | SR-3 |
|
|
97
|
+
| SW-MCP-008 | Uses deprecated Roots, Sampling or Logging | medium | ASI04 | SR-3 |
|
|
98
|
+
| SW-MCP-009 | Endpoint not served over HTTPS | high | MCP01 | SC-7 |
|
|
99
|
+
| SW-MCP-010 | No protected resource metadata, or issuer not validated | medium | MCP01 | IA-5 |
|
|
100
|
+
| SW-MCP-011 | Tool description contains instruction-like text | high | ASI01, MCP10 | SI-10 |
|
|
101
|
+
|
|
102
|
+
Ids 016 to 018 and 020 to 030 are reserved. `RuleSet.baseline()` returns these rules; `ruleset.with_rules(extra)` adds your own `Rule` objects built with `spellwarden_scan.rules.make_rule`.
|
|
103
|
+
|
|
104
|
+
## Versions
|
|
105
|
+
|
|
106
|
+
`spellwarden_scan.__version__` is the package version and `spellwarden_scan.RULES_VERSION` (`YYYY.MM.N`) the rule set's. A change to what any rule detects bumps both the rules version and the package minor version; a fix anywhere else bumps the patch. Every scan result carries both, so a stored finding always says which rules produced it.
|
|
107
|
+
|
|
108
|
+
## Releases
|
|
109
|
+
|
|
110
|
+
Releases are built and published by GitHub Actions through PyPI trusted publishing (OpenID Connect): a push of a tag `vX.Y.Z` whose version equals the one in `pyproject.toml` builds the sdist and the wheel and publishes them from the `pypi` environment. No API token exists anywhere. The sources are checked on Python 3.11, 3.12 and 3.13 on every push.
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
make check # ruff, pytest, uv build
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`tests/test_pure.py` fails the build if any module reaches for the network, the file system or the environment; `tests/test_fixture_coverage.py` fails it if a rule lacks a positive or a negative fixture.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
Apache-2.0. See `LICENSE`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"probe": {
|
|
3
|
+
"endpoint": "https://r001n.example/mcp",
|
|
4
|
+
"reachable": true,
|
|
5
|
+
"capabilities": {
|
|
6
|
+
"tools": {}
|
|
7
|
+
},
|
|
8
|
+
"session_id_seen": false,
|
|
9
|
+
"probed_at": "2026-10-18T12:00:00Z",
|
|
10
|
+
"post_status": 200,
|
|
11
|
+
"post_content_type": "application/json",
|
|
12
|
+
"discover": {
|
|
13
|
+
"supportedVersions": [
|
|
14
|
+
"2026-07-28"
|
|
15
|
+
],
|
|
16
|
+
"capabilities": {
|
|
17
|
+
"tools": {}
|
|
18
|
+
},
|
|
19
|
+
"serverInfo": {
|
|
20
|
+
"name": "r001n",
|
|
21
|
+
"version": "1.0.0"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"unauthenticated_status": 401,
|
|
25
|
+
"www_authenticate": "Bearer resource_metadata=\"https://r001n.example/.well-known/oauth-protected-resource\"",
|
|
26
|
+
"resource_metadata": {
|
|
27
|
+
"resource": "https://r001n.example/mcp",
|
|
28
|
+
"authorization_servers": [
|
|
29
|
+
"https://auth.r001n.example"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"auth_server_metadata": {
|
|
33
|
+
"issuer": "https://auth.r001n.example",
|
|
34
|
+
"metadata_url": "https://auth.r001n.example/.well-known/oauth-authorization-server",
|
|
35
|
+
"registration_endpoint": null,
|
|
36
|
+
"client_id_metadata_document_supported": true,
|
|
37
|
+
"grant_types_supported": [
|
|
38
|
+
"authorization_code",
|
|
39
|
+
"refresh_token"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"expected": {
|
|
44
|
+
"transport": "streamable-http",
|
|
45
|
+
"findings": []
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"probe": {
|
|
3
|
+
"endpoint": "https://r001.example/mcp",
|
|
4
|
+
"reachable": true,
|
|
5
|
+
"capabilities": {
|
|
6
|
+
"tools": {}
|
|
7
|
+
},
|
|
8
|
+
"session_id_seen": false,
|
|
9
|
+
"probed_at": "2026-10-18T12:00:00Z",
|
|
10
|
+
"post_status": 200,
|
|
11
|
+
"post_content_type": "application/json",
|
|
12
|
+
"discover": {
|
|
13
|
+
"supportedVersions": [
|
|
14
|
+
"2026-07-28"
|
|
15
|
+
],
|
|
16
|
+
"capabilities": {
|
|
17
|
+
"tools": {}
|
|
18
|
+
},
|
|
19
|
+
"serverInfo": {
|
|
20
|
+
"name": "r001",
|
|
21
|
+
"version": "1.0.0"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"unauthenticated_status": 200,
|
|
25
|
+
"tools": [
|
|
26
|
+
{
|
|
27
|
+
"name": "query",
|
|
28
|
+
"description": "Runs a query.",
|
|
29
|
+
"annotations": {}
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"tools_source": "probe"
|
|
33
|
+
},
|
|
34
|
+
"expected": {
|
|
35
|
+
"transport": "streamable-http",
|
|
36
|
+
"findings": [
|
|
37
|
+
{
|
|
38
|
+
"rule_id": "SW-MCP-001",
|
|
39
|
+
"severity": "high",
|
|
40
|
+
"path": "https://r001.example/mcp",
|
|
41
|
+
"line": null
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"probe": {
|
|
3
|
+
"endpoint": "https://r002n.example/mcp",
|
|
4
|
+
"reachable": true,
|
|
5
|
+
"capabilities": {
|
|
6
|
+
"tools": {}
|
|
7
|
+
},
|
|
8
|
+
"session_id_seen": false,
|
|
9
|
+
"probed_at": "2026-10-18T12:00:00Z",
|
|
10
|
+
"post_status": 200,
|
|
11
|
+
"post_content_type": "application/json",
|
|
12
|
+
"discover": {
|
|
13
|
+
"supportedVersions": [
|
|
14
|
+
"2026-07-28"
|
|
15
|
+
],
|
|
16
|
+
"capabilities": {
|
|
17
|
+
"tools": {}
|
|
18
|
+
},
|
|
19
|
+
"serverInfo": {
|
|
20
|
+
"name": "r002n",
|
|
21
|
+
"version": "1.0.0"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"unauthenticated_status": 401,
|
|
25
|
+
"www_authenticate": "Bearer resource_metadata=\"https://r002n.example/.well-known/oauth-protected-resource\"",
|
|
26
|
+
"resource_metadata": {
|
|
27
|
+
"resource": "https://r002n.example/mcp",
|
|
28
|
+
"authorization_servers": [
|
|
29
|
+
"https://auth.r002n.example"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"auth_server_metadata": {
|
|
33
|
+
"issuer": "https://auth.r002n.example",
|
|
34
|
+
"metadata_url": "https://auth.r002n.example/.well-known/oauth-authorization-server",
|
|
35
|
+
"registration_endpoint": null,
|
|
36
|
+
"client_id_metadata_document_supported": true,
|
|
37
|
+
"grant_types_supported": [
|
|
38
|
+
"authorization_code",
|
|
39
|
+
"refresh_token"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"expected": {
|
|
44
|
+
"transport": "streamable-http",
|
|
45
|
+
"findings": []
|
|
46
|
+
}
|
|
47
|
+
}
|