cisco-ai-skill-scanner 1.0.0__py3-none-any.whl
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.
- cisco_ai_skill_scanner-1.0.0.dist-info/METADATA +253 -0
- cisco_ai_skill_scanner-1.0.0.dist-info/RECORD +100 -0
- cisco_ai_skill_scanner-1.0.0.dist-info/WHEEL +4 -0
- cisco_ai_skill_scanner-1.0.0.dist-info/entry_points.txt +4 -0
- cisco_ai_skill_scanner-1.0.0.dist-info/licenses/LICENSE +17 -0
- skillanalyzer/__init__.py +45 -0
- skillanalyzer/_version.py +34 -0
- skillanalyzer/api/__init__.py +25 -0
- skillanalyzer/api/api.py +34 -0
- skillanalyzer/api/api_cli.py +78 -0
- skillanalyzer/api/api_server.py +634 -0
- skillanalyzer/api/router.py +527 -0
- skillanalyzer/cli/__init__.py +25 -0
- skillanalyzer/cli/cli.py +816 -0
- skillanalyzer/config/__init__.py +26 -0
- skillanalyzer/config/config.py +149 -0
- skillanalyzer/config/config_parser.py +122 -0
- skillanalyzer/config/constants.py +85 -0
- skillanalyzer/core/__init__.py +24 -0
- skillanalyzer/core/analyzers/__init__.py +75 -0
- skillanalyzer/core/analyzers/aidefense_analyzer.py +872 -0
- skillanalyzer/core/analyzers/base.py +53 -0
- skillanalyzer/core/analyzers/behavioral/__init__.py +30 -0
- skillanalyzer/core/analyzers/behavioral/alignment/__init__.py +45 -0
- skillanalyzer/core/analyzers/behavioral/alignment/alignment_llm_client.py +240 -0
- skillanalyzer/core/analyzers/behavioral/alignment/alignment_orchestrator.py +216 -0
- skillanalyzer/core/analyzers/behavioral/alignment/alignment_prompt_builder.py +422 -0
- skillanalyzer/core/analyzers/behavioral/alignment/alignment_response_validator.py +136 -0
- skillanalyzer/core/analyzers/behavioral/alignment/threat_vulnerability_classifier.py +198 -0
- skillanalyzer/core/analyzers/behavioral_analyzer.py +453 -0
- skillanalyzer/core/analyzers/cross_skill_analyzer.py +490 -0
- skillanalyzer/core/analyzers/llm_analyzer.py +440 -0
- skillanalyzer/core/analyzers/llm_prompt_builder.py +270 -0
- skillanalyzer/core/analyzers/llm_provider_config.py +215 -0
- skillanalyzer/core/analyzers/llm_request_handler.py +284 -0
- skillanalyzer/core/analyzers/llm_response_parser.py +81 -0
- skillanalyzer/core/analyzers/meta_analyzer.py +845 -0
- skillanalyzer/core/analyzers/static.py +1105 -0
- skillanalyzer/core/analyzers/trigger_analyzer.py +341 -0
- skillanalyzer/core/analyzers/virustotal_analyzer.py +463 -0
- skillanalyzer/core/exceptions.py +77 -0
- skillanalyzer/core/loader.py +377 -0
- skillanalyzer/core/models.py +300 -0
- skillanalyzer/core/reporters/__init__.py +26 -0
- skillanalyzer/core/reporters/json_reporter.py +65 -0
- skillanalyzer/core/reporters/markdown_reporter.py +209 -0
- skillanalyzer/core/reporters/sarif_reporter.py +246 -0
- skillanalyzer/core/reporters/table_reporter.py +195 -0
- skillanalyzer/core/rules/__init__.py +19 -0
- skillanalyzer/core/rules/patterns.py +165 -0
- skillanalyzer/core/rules/yara_scanner.py +157 -0
- skillanalyzer/core/scanner.py +437 -0
- skillanalyzer/core/static_analysis/__init__.py +27 -0
- skillanalyzer/core/static_analysis/cfg/__init__.py +21 -0
- skillanalyzer/core/static_analysis/cfg/builder.py +439 -0
- skillanalyzer/core/static_analysis/context_extractor.py +742 -0
- skillanalyzer/core/static_analysis/dataflow/__init__.py +25 -0
- skillanalyzer/core/static_analysis/dataflow/forward_analysis.py +715 -0
- skillanalyzer/core/static_analysis/interprocedural/__init__.py +21 -0
- skillanalyzer/core/static_analysis/interprocedural/call_graph_analyzer.py +406 -0
- skillanalyzer/core/static_analysis/interprocedural/cross_file_analyzer.py +190 -0
- skillanalyzer/core/static_analysis/parser/__init__.py +21 -0
- skillanalyzer/core/static_analysis/parser/python_parser.py +380 -0
- skillanalyzer/core/static_analysis/semantic/__init__.py +28 -0
- skillanalyzer/core/static_analysis/semantic/name_resolver.py +206 -0
- skillanalyzer/core/static_analysis/semantic/type_analyzer.py +200 -0
- skillanalyzer/core/static_analysis/taint/__init__.py +21 -0
- skillanalyzer/core/static_analysis/taint/tracker.py +252 -0
- skillanalyzer/core/static_analysis/types/__init__.py +36 -0
- skillanalyzer/data/__init__.py +30 -0
- skillanalyzer/data/prompts/boilerplate_protection_rule_prompt.md +26 -0
- skillanalyzer/data/prompts/code_alignment_threat_analysis_prompt.md +901 -0
- skillanalyzer/data/prompts/llm_response_schema.json +71 -0
- skillanalyzer/data/prompts/skill_meta_analysis_prompt.md +303 -0
- skillanalyzer/data/prompts/skill_threat_analysis_prompt.md +263 -0
- skillanalyzer/data/prompts/unified_response_schema.md +97 -0
- skillanalyzer/data/rules/signatures.yaml +440 -0
- skillanalyzer/data/yara_rules/autonomy_abuse.yara +66 -0
- skillanalyzer/data/yara_rules/code_execution.yara +61 -0
- skillanalyzer/data/yara_rules/coercive_injection.yara +115 -0
- skillanalyzer/data/yara_rules/command_injection.yara +54 -0
- skillanalyzer/data/yara_rules/credential_harvesting.yara +115 -0
- skillanalyzer/data/yara_rules/prompt_injection.yara +71 -0
- skillanalyzer/data/yara_rules/script_injection.yara +83 -0
- skillanalyzer/data/yara_rules/skill_discovery_abuse.yara +57 -0
- skillanalyzer/data/yara_rules/sql_injection.yara +73 -0
- skillanalyzer/data/yara_rules/system_manipulation.yara +65 -0
- skillanalyzer/data/yara_rules/tool_chaining_abuse.yara +60 -0
- skillanalyzer/data/yara_rules/transitive_trust_abuse.yara +73 -0
- skillanalyzer/data/yara_rules/unicode_steganography.yara +65 -0
- skillanalyzer/hooks/__init__.py +21 -0
- skillanalyzer/hooks/pre_commit.py +450 -0
- skillanalyzer/threats/__init__.py +25 -0
- skillanalyzer/threats/threats.py +480 -0
- skillanalyzer/utils/__init__.py +28 -0
- skillanalyzer/utils/command_utils.py +129 -0
- skillanalyzer/utils/di_container.py +154 -0
- skillanalyzer/utils/file_utils.py +86 -0
- skillanalyzer/utils/logging_config.py +96 -0
- skillanalyzer/utils/logging_utils.py +71 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cisco-ai-skill-scanner
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Security scanner for Claude Skills and Codex Skills packages - Detects prompt injection, data exfiltration, and malicious code
|
|
5
|
+
Project-URL: Homepage, https://github.com/cisco-ai-defense/skill-scanner
|
|
6
|
+
Project-URL: Documentation, https://github.com/cisco-ai-defense/skill-scanner#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/cisco-ai-defense/skill-scanner
|
|
8
|
+
Project-URL: Issues, https://github.com/cisco-ai-defense/skill-scanner/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/cisco-ai-defense/skill-scanner/releases
|
|
10
|
+
Author: Cisco
|
|
11
|
+
License: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai-security,anthropic,claude,codex,llm-security,mcp,openai,prompt-injection,scanner,security,skills,static-analysis,threat-detection
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Security
|
|
26
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
27
|
+
Classifier: Topic :: Software Development :: Testing
|
|
28
|
+
Classifier: Typing :: Typed
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
|
+
Requires-Dist: anthropic>=0.40.0
|
|
31
|
+
Requires-Dist: click>=8.1.0
|
|
32
|
+
Requires-Dist: fastapi>=0.125.0
|
|
33
|
+
Requires-Dist: google-genai>=0.2.0
|
|
34
|
+
Requires-Dist: google-generativeai>=0.8.0
|
|
35
|
+
Requires-Dist: httpx>=0.28.1
|
|
36
|
+
Requires-Dist: litellm>=1.77.0
|
|
37
|
+
Requires-Dist: openai>=1.0.0
|
|
38
|
+
Requires-Dist: pydantic>=2.6.0
|
|
39
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
40
|
+
Requires-Dist: python-frontmatter>=1.0.0
|
|
41
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
42
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
43
|
+
Requires-Dist: rich>=13.0.0
|
|
44
|
+
Requires-Dist: tabulate>=0.9.0
|
|
45
|
+
Requires-Dist: uvicorn[standard]>=0.29.0
|
|
46
|
+
Requires-Dist: yara-python>=4.5.4
|
|
47
|
+
Provides-Extra: all
|
|
48
|
+
Requires-Dist: azure-identity>=1.15.0; extra == 'all'
|
|
49
|
+
Requires-Dist: boto3>=1.28.57; extra == 'all'
|
|
50
|
+
Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == 'all'
|
|
51
|
+
Provides-Extra: azure
|
|
52
|
+
Requires-Dist: azure-identity>=1.15.0; extra == 'azure'
|
|
53
|
+
Provides-Extra: bedrock
|
|
54
|
+
Requires-Dist: boto3>=1.28.57; extra == 'bedrock'
|
|
55
|
+
Provides-Extra: vertex
|
|
56
|
+
Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == 'vertex'
|
|
57
|
+
Description-Content-Type: text/markdown
|
|
58
|
+
|
|
59
|
+
# Skill Scanner
|
|
60
|
+
|
|
61
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
62
|
+
[](https://www.python.org/downloads/)
|
|
63
|
+
[](https://pypi.org/project/cisco-ai-skill-scanner/)
|
|
64
|
+
[](https://github.com/cisco-ai-defense/skill-scanner/actions/workflows/python-tests.yml)
|
|
65
|
+
[](https://discord.com/invite/nKWtDcXxtx)
|
|
66
|
+
[](https://www.cisco.com/site/us/en/products/security/ai-defense/index.html)
|
|
67
|
+
[](https://learn-cloudsecurity.cisco.com/ai-security-framework)
|
|
68
|
+
|
|
69
|
+
A security scanner for AI Agent Skills that detects prompt injection, data exfiltration, and malicious code patterns. Combines **pattern-based detection** (YAML + YARA), **LLM-as-a-judge**, and **behavioral dataflow analysis** for comprehensive threat detection.
|
|
70
|
+
|
|
71
|
+
Supports [Anthropic Claude Skills](https://docs.anthropic.com/en/docs/agents-and-tools/claude-skills), [OpenAI Codex Skills](https://openai.github.io/codex/), and [Cursor Agent Skills](https://docs.cursor.com/context/rules) formats following the [Agent Skills specification](https://agentskills.io).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Highlights
|
|
76
|
+
|
|
77
|
+
- **Multi-Engine Detection** - Static analysis, behavioral dataflow, LLM semantic analysis, and cloud-based scanning
|
|
78
|
+
- **False Positive Filtering** - Meta-analyzer achieves ~65% noise reduction while maintaining 100% threat detection
|
|
79
|
+
- **CI/CD Ready** - SARIF output for GitHub Code Scanning, exit codes for build failures
|
|
80
|
+
- **Extensible** - Plugin architecture for custom analyzers
|
|
81
|
+
|
|
82
|
+
**[Join the Cisco AI Discord](https://discord.com/invite/nKWtDcXxtx)** to discuss, share feedback, or connect with the team.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
| Guide | Description |
|
|
89
|
+
|-------|-------------|
|
|
90
|
+
| [Quick Start](docs/quickstart.md) | Get started in 5 minutes |
|
|
91
|
+
| [Architecture](docs/architecture.md) | System design and components |
|
|
92
|
+
| [Threat Taxonomy](docs/threat-taxonomy.md) | Complete AITech threat taxonomy with examples |
|
|
93
|
+
| [LLM Analyzer](docs/llm-analyzer.md) | LLM configuration and usage |
|
|
94
|
+
| [Meta-Analyzer](docs/meta-analyzer.md) | False positive filtering and prioritization |
|
|
95
|
+
| [Behavioral Analyzer](docs/behavioral-analyzer.md) | Dataflow analysis details |
|
|
96
|
+
| [API Reference](docs/api-server.md) | REST API documentation |
|
|
97
|
+
| [Development Guide](docs/developing.md) | Contributing and development setup |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Installation
|
|
102
|
+
|
|
103
|
+
**Prerequisites:** Python 3.10+ and [uv](https://docs.astral.sh/uv/) (recommended) or pip
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Using uv (recommended)
|
|
107
|
+
uv pip install cisco-ai-skill-scanner
|
|
108
|
+
|
|
109
|
+
# Using pip
|
|
110
|
+
pip install cisco-ai-skill-scanner
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary><strong>Cloud Provider Extras</strong></summary>
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# AWS Bedrock support
|
|
118
|
+
pip install cisco-ai-skill-scanner[bedrock]
|
|
119
|
+
|
|
120
|
+
# Google Vertex AI support
|
|
121
|
+
pip install cisco-ai-skill-scanner[vertex]
|
|
122
|
+
|
|
123
|
+
# Azure OpenAI support
|
|
124
|
+
pip install cisco-ai-skill-scanner[azure]
|
|
125
|
+
|
|
126
|
+
# All cloud providers
|
|
127
|
+
pip install cisco-ai-skill-scanner[all]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
</details>
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Quick Start
|
|
135
|
+
|
|
136
|
+
### Environment Setup (Optional)
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# For LLM analyzer and Meta-analyzer
|
|
140
|
+
export SKILL_SCANNER_LLM_API_KEY="your_api_key"
|
|
141
|
+
export SKILL_SCANNER_LLM_MODEL="claude-3-5-sonnet-20241022"
|
|
142
|
+
|
|
143
|
+
# For VirusTotal binary scanning
|
|
144
|
+
export VIRUSTOTAL_API_KEY="your_virustotal_api_key"
|
|
145
|
+
|
|
146
|
+
# For Cisco AI Defense
|
|
147
|
+
export AI_DEFENSE_API_KEY="your_aidefense_api_key"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### CLI Usage
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Scan a single skill (static analyzer only)
|
|
154
|
+
skill-analyzer scan /path/to/skill
|
|
155
|
+
|
|
156
|
+
# Scan with behavioral analyzer (dataflow analysis)
|
|
157
|
+
skill-analyzer scan /path/to/skill --use-behavioral
|
|
158
|
+
|
|
159
|
+
# Scan with all engines
|
|
160
|
+
skill-analyzer scan /path/to/skill --use-behavioral --use-llm --use-aidefense
|
|
161
|
+
|
|
162
|
+
# Scan with meta-analyzer for false positive filtering
|
|
163
|
+
skill-analyzer scan /path/to/skill --use-llm --enable-meta
|
|
164
|
+
|
|
165
|
+
# Scan multiple skills recursively
|
|
166
|
+
skill-analyzer scan-all /path/to/skills --recursive --use-behavioral
|
|
167
|
+
|
|
168
|
+
# CI/CD: Fail build if threats found
|
|
169
|
+
skill-analyzer scan-all ./skills --fail-on-findings --format sarif --output results.sarif
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Python SDK
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
from skillanalyzer import SkillScanner
|
|
176
|
+
from skillanalyzer.core.analyzers import StaticAnalyzer, BehavioralAnalyzer
|
|
177
|
+
|
|
178
|
+
# Create scanner with analyzers
|
|
179
|
+
scanner = SkillScanner(analyzers=[
|
|
180
|
+
StaticAnalyzer(),
|
|
181
|
+
BehavioralAnalyzer(use_static_analysis=True),
|
|
182
|
+
])
|
|
183
|
+
|
|
184
|
+
# Scan a skill
|
|
185
|
+
result = scanner.scan_skill("/path/to/skill")
|
|
186
|
+
|
|
187
|
+
print(f"Safe: {result.is_safe}")
|
|
188
|
+
print(f"Findings: {len(result.findings)}")
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Security Analyzers
|
|
194
|
+
|
|
195
|
+
| Analyzer | Detection Method | Scope | Requirements |
|
|
196
|
+
|----------|------------------|-------|--------------|
|
|
197
|
+
| **Static** | YAML + YARA patterns | All files | None |
|
|
198
|
+
| **Behavioral** | AST dataflow analysis | Python files | None |
|
|
199
|
+
| **LLM** | Semantic analysis | SKILL.md + scripts | API key |
|
|
200
|
+
| **Meta** | False positive filtering | All findings | API key |
|
|
201
|
+
| **VirusTotal** | Hash-based malware | Binary files | API key |
|
|
202
|
+
| **AI Defense** | Cloud-based AI | Text content | API key |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## CLI Options
|
|
207
|
+
|
|
208
|
+
| Option | Description |
|
|
209
|
+
|--------|-------------|
|
|
210
|
+
| `--use-behavioral` | Enable behavioral analyzer (dataflow analysis) |
|
|
211
|
+
| `--use-llm` | Enable LLM analyzer (requires API key) |
|
|
212
|
+
| `--use-virustotal` | Enable VirusTotal binary scanner |
|
|
213
|
+
| `--use-aidefense` | Enable Cisco AI Defense analyzer |
|
|
214
|
+
| `--enable-meta` | Enable meta-analyzer for false positive filtering |
|
|
215
|
+
| `--format` | Output: `summary`, `json`, `markdown`, `table`, `sarif` |
|
|
216
|
+
| `--output PATH` | Save report to file |
|
|
217
|
+
| `--fail-on-findings` | Exit with error if HIGH/CRITICAL found |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Example Output
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
$ skill-analyzer scan ./my-skill --use-behavioral
|
|
225
|
+
|
|
226
|
+
============================================================
|
|
227
|
+
Skill: my-skill
|
|
228
|
+
============================================================
|
|
229
|
+
Status: [OK] SAFE
|
|
230
|
+
Max Severity: SAFE
|
|
231
|
+
Total Findings: 0
|
|
232
|
+
Scan Duration: 0.15s
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Contributing
|
|
238
|
+
|
|
239
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
Apache 2.0 - See [LICENSE](LICENSE) for details.
|
|
244
|
+
|
|
245
|
+
Copyright 2026 Cisco Systems, Inc. and its affiliates
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
<p align="center">
|
|
250
|
+
<a href="https://github.com/cisco-ai-defense/skill-scanner">GitHub</a> •
|
|
251
|
+
<a href="https://discord.com/invite/nKWtDcXxtx">Discord</a> •
|
|
252
|
+
<a href="https://pypi.org/project/cisco-ai-skill-scanner/">PyPI</a>
|
|
253
|
+
</p>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
skillanalyzer/__init__.py,sha256=raAwyMu06X3PXZ3YrxW9sUlZeG_UrDp4HIIUi6hN_zo,1318
|
|
2
|
+
skillanalyzer/_version.py,sha256=vLA4ITz09S-S435nq6yTF6l3qiSz6w4euS1rOxXgd1M,704
|
|
3
|
+
skillanalyzer/api/__init__.py,sha256=z7QSgt7lMZQ7eO9pAO-Iao6jEJQ6UPQissGfb_U4iXc,754
|
|
4
|
+
skillanalyzer/api/api.py,sha256=2R8qpk_DbbhCChnvhzQCMH9FFq0xQDZLX-eMBy0wnbk,1038
|
|
5
|
+
skillanalyzer/api/api_cli.py,sha256=VjxcFg-UFJJIWJMcH713tAKKEtIUB0dV66H2Yzd1mb8,2392
|
|
6
|
+
skillanalyzer/api/api_server.py,sha256=XAU3QH5yz6BS3T4Tcl13yzz4x3VNK-v6KkidprepJy4,21142
|
|
7
|
+
skillanalyzer/api/router.py,sha256=8c1DQI3f3xDvV7SYVSua000oGUu-Oi5YcrzofmRVYnQ,17421
|
|
8
|
+
skillanalyzer/cli/__init__.py,sha256=17rrftCF-A1WQDiZ0kdBAfPHgG0ouED5wkdy-WvIRNA,763
|
|
9
|
+
skillanalyzer/cli/cli.py,sha256=8ZGZXJ2ccc-93jZS3XOpZyLSAHwjkOai5TU5yG_jmfE,35511
|
|
10
|
+
skillanalyzer/config/__init__.py,sha256=KQUqIL0lWI1hy_qu_EDt4EIcuW9a2ok2WVuQNViOf4g,847
|
|
11
|
+
skillanalyzer/config/config.py,sha256=-7ymRfwypmBGyoOUWiSuwwRIr7Ztt8t6GcuGjm-9XKw,4714
|
|
12
|
+
skillanalyzer/config/config_parser.py,sha256=XF8VwQqrBhzPuS4wf_AI-MAhlm9thgJnbIoncxIoIrs,3777
|
|
13
|
+
skillanalyzer/config/constants.py,sha256=4Jck7kUtcHTIa9Hcwnbgk0lUqZvxarcdp6c86Xn4Xwk,2521
|
|
14
|
+
skillanalyzer/core/__init__.py,sha256=issm88bGzNlQuFH5qy1tKzMgQbYL0ODSxsDgYjCMCKw,830
|
|
15
|
+
skillanalyzer/core/exceptions.py,sha256=zWB8XubcfwEL0uZutuagr1l3rEd3w-5mB1ggNLnz6cE,2015
|
|
16
|
+
skillanalyzer/core/loader.py,sha256=8pAr5nN0DLmf7Dc7xIFIT_okQ6w35RKGLyibNUDFbPU,13596
|
|
17
|
+
skillanalyzer/core/models.py,sha256=ZMe9CaufG7yMzLwei1GdVidj72HlA16brVwkPGmervg,10627
|
|
18
|
+
skillanalyzer/core/scanner.py,sha256=VfrG74SmFyslS3a5Z6HqSOou74u02TW1aos5Oj--_l4,14833
|
|
19
|
+
skillanalyzer/core/analyzers/__init__.py,sha256=loTObGAXelxAiodtR0XzR6r1Ebw17BiuZZXN9TA3eJc,2136
|
|
20
|
+
skillanalyzer/core/analyzers/aidefense_analyzer.py,sha256=al_j3HzfZIToI38WNOnqBG_AXfJEBd6QVm8_h_sjvA4,36471
|
|
21
|
+
skillanalyzer/core/analyzers/base.py,sha256=4BN6dHLn2Q9hQMLAJTSJXsl6tZgfCqqBxZO9icuu70Q,1374
|
|
22
|
+
skillanalyzer/core/analyzers/behavioral_analyzer.py,sha256=OcBs0abjmimbtLREkTbgQrarXvGfg18Fp8Z-Uas_gyI,19077
|
|
23
|
+
skillanalyzer/core/analyzers/cross_skill_analyzer.py,sha256=4KysKr_2WR5-JbbFs0tBKf27Oj0l35KK0wREFNRcvno,18939
|
|
24
|
+
skillanalyzer/core/analyzers/llm_analyzer.py,sha256=juvLmKn1n8HHOzkyizG94aPO-tz_ht-vexMmbGLZ3Mo,17836
|
|
25
|
+
skillanalyzer/core/analyzers/llm_prompt_builder.py,sha256=DEz4tP0HY4p2XWbXbxfSIdkwhLCd_dWX7cDe9A3CeOA,10162
|
|
26
|
+
skillanalyzer/core/analyzers/llm_provider_config.py,sha256=pbVx7N9OCohjIWjENMq-kiy6_svTn4IYvQfPxlR0M_Y,8488
|
|
27
|
+
skillanalyzer/core/analyzers/llm_request_handler.py,sha256=nz_gjnDTr0dT2GbfQMqKR6-n63x38AcB5G4UnPHLY9s,11679
|
|
28
|
+
skillanalyzer/core/analyzers/llm_response_parser.py,sha256=wO5ovd4se-KqIPwdZX-r0_tozaJEDUx7Q7yajKntPwk,2682
|
|
29
|
+
skillanalyzer/core/analyzers/meta_analyzer.py,sha256=rFyU-BW7cmHDib93KIgdtsH5J7OIVT8Wc0Pnx87OPIE,33373
|
|
30
|
+
skillanalyzer/core/analyzers/static.py,sha256=BNHmmZouX_8lbeJZlVC0P831-u9IPz9Gmft_05pI2pI,45259
|
|
31
|
+
skillanalyzer/core/analyzers/trigger_analyzer.py,sha256=BJuu0nbI7BKS2aoqZnzYON825ObETsfJcIOiSxkagH4,12263
|
|
32
|
+
skillanalyzer/core/analyzers/virustotal_analyzer.py,sha256=V7nG-fR2GhfdZhh8JVNvM6gOqRyUGsuxHN1yNRvmw6M,15988
|
|
33
|
+
skillanalyzer/core/analyzers/behavioral/__init__.py,sha256=mY0aRrrT5y7E8SOApQ8g-IewW6LR33Y4SlsZKzl90qQ,1070
|
|
34
|
+
skillanalyzer/core/analyzers/behavioral/alignment/__init__.py,sha256=nB2KWYnDu6I4yGiaewEyySzG4w96hElXiQBqJFfGmP4,1832
|
|
35
|
+
skillanalyzer/core/analyzers/behavioral/alignment/alignment_llm_client.py,sha256=vklWQ7rBoyfayzs1n1J8xlCo3_nimEqCgDViCXwyOZM,8646
|
|
36
|
+
skillanalyzer/core/analyzers/behavioral/alignment/alignment_orchestrator.py,sha256=zfkjFz-DDwUEOGDBpJ8cAZi5bH-VP_d_1bJTF1z0Si4,9478
|
|
37
|
+
skillanalyzer/core/analyzers/behavioral/alignment/alignment_prompt_builder.py,sha256=mXkBYQDpPaqA298Jly835x_cLOUWHjSc8sBDhgMrWxs,18043
|
|
38
|
+
skillanalyzer/core/analyzers/behavioral/alignment/alignment_response_validator.py,sha256=lu0gPPRbJkZJlkguqwUeSVl43HpMFypICXH_4s8Zjbo,4556
|
|
39
|
+
skillanalyzer/core/analyzers/behavioral/alignment/threat_vulnerability_classifier.py,sha256=DCXnbs9Fa2ajFT0We4sOo6nxIk7O_Pc0z01fGMDHsRg,7227
|
|
40
|
+
skillanalyzer/core/reporters/__init__.py,sha256=XCqeM_kiS1uvcwymDreueQ2KOzMhG5_4vQgxzReJS4w,943
|
|
41
|
+
skillanalyzer/core/reporters/json_reporter.py,sha256=JLlPTbs8ncMJHAXZk7iBWCHdL5Qn2PqHOQldHeH2ZGE,1798
|
|
42
|
+
skillanalyzer/core/reporters/markdown_reporter.py,sha256=1-pIwgXYBcCzqmKlxh2y2KU37TNRojqaTJ_CBSM_bSY,7842
|
|
43
|
+
skillanalyzer/core/reporters/sarif_reporter.py,sha256=n5tGCXKwRJzEovlJt7j0USkmMYDsctLQdF9VIMbN95g,8285
|
|
44
|
+
skillanalyzer/core/reporters/table_reporter.py,sha256=g-1W4XsJUzHW7LdzuW5CJ1krHAE5fvHViBKlw1ShFXI,7046
|
|
45
|
+
skillanalyzer/core/rules/__init__.py,sha256=zGlTBVjihqxgg0BKmhdGkyeCzSvRjVEASjBh-M0sn_8,680
|
|
46
|
+
skillanalyzer/core/rules/patterns.py,sha256=OuJ6mPlQVy9R8g1Pn9ozWIC8iWfDEuQamdDW5Uu8200,5833
|
|
47
|
+
skillanalyzer/core/rules/yara_scanner.py,sha256=YBH9-GEqha0zDglnGx4TV-lgv14cLianuxaqlFtLyx4,5327
|
|
48
|
+
skillanalyzer/core/static_analysis/__init__.py,sha256=meZnZQj7ChgHek6fIrfd-YInolXCqI37HTUTlQWEm7w,930
|
|
49
|
+
skillanalyzer/core/static_analysis/context_extractor.py,sha256=ZaR5bIgfk1WQGU1G2or2vNsPQ3tmW5HU6mtyRemYdK0,29791
|
|
50
|
+
skillanalyzer/core/static_analysis/cfg/__init__.py,sha256=jkvx12ZGddbRVu_0b04Bamr7JX084yD6BLxgOUEHT1w,816
|
|
51
|
+
skillanalyzer/core/static_analysis/cfg/builder.py,sha256=Tm1GZ56rfOoNx-3WLmn2MNov2KzPKN-QZgJbBG-9D2c,14932
|
|
52
|
+
skillanalyzer/core/static_analysis/dataflow/__init__.py,sha256=vjNUG8J5__m8HYd18VNkKxBzeAss1qugVrp0Amndg2w,834
|
|
53
|
+
skillanalyzer/core/static_analysis/dataflow/forward_analysis.py,sha256=haHWJVz-SZxZpZoEwAsNOum-67ldppe_YBRMZOSJqz0,30747
|
|
54
|
+
skillanalyzer/core/static_analysis/interprocedural/__init__.py,sha256=dFIglo65HpWMJ80ejB4tjv54MaNeSymQ5eowD5QGZic,798
|
|
55
|
+
skillanalyzer/core/static_analysis/interprocedural/call_graph_analyzer.py,sha256=NKpixV-wlK_lwnSgLY5Tw01pAoC2kl7R6U4_PWnKicE,14062
|
|
56
|
+
skillanalyzer/core/static_analysis/interprocedural/cross_file_analyzer.py,sha256=neP8pdyGhCUHJQmmTXfm0X_CFHlTHh7e3RU7HVJ0UVY,7472
|
|
57
|
+
skillanalyzer/core/static_analysis/parser/__init__.py,sha256=AXCg1HHVzyjswGJl4TNFhzwMKxgin8JY2EK00RVv9_Y,769
|
|
58
|
+
skillanalyzer/core/static_analysis/parser/python_parser.py,sha256=lkJKSODZkSC-Vg30eSpli_jsFeIouKt-DsSeEgce1u4,13804
|
|
59
|
+
skillanalyzer/core/static_analysis/semantic/__init__.py,sha256=7HS7lJ4APpyfWLTUQ_24aJkrLX2MQTcc4erYFtLKm3o,877
|
|
60
|
+
skillanalyzer/core/static_analysis/semantic/name_resolver.py,sha256=TEJQkEaTvkL7dnAZwNbcLALPVw85Qc3FS5jfr4CYEsQ,6218
|
|
61
|
+
skillanalyzer/core/static_analysis/semantic/type_analyzer.py,sha256=NXEOZO8-vYZ97SQJ5Gu_YLWFDMDhtvtuixVwYGarmDM,5942
|
|
62
|
+
skillanalyzer/core/static_analysis/taint/__init__.py,sha256=71JejlK110K2r3LXNIJOLGCZ7I5Q7cEn8XvfCCoEexA,809
|
|
63
|
+
skillanalyzer/core/static_analysis/taint/tracker.py,sha256=1WExA8NAV62X5Az64grI41LkkyMNQ7kFS8Mzf6Id1NI,7182
|
|
64
|
+
skillanalyzer/core/static_analysis/types/__init__.py,sha256=XluM6BlZ8ECfdAD-231ONJn13UeDdAGmirPAVc0zePk,937
|
|
65
|
+
skillanalyzer/data/__init__.py,sha256=WztWQdxkW4nkIejCTH4VH7l6mGU-p2JuEzEUFsj3z_4,977
|
|
66
|
+
skillanalyzer/data/prompts/boilerplate_protection_rule_prompt.md,sha256=wCaDgae0LU7Flsd2Q4Ob4vEeZnpc29nfX4oJjBrE-WM,1468
|
|
67
|
+
skillanalyzer/data/prompts/code_alignment_threat_analysis_prompt.md,sha256=mvSoW2OekXEz9lChZPaP4hUxVQ0-O57X3VI49ZrZqoY,25442
|
|
68
|
+
skillanalyzer/data/prompts/llm_response_schema.json,sha256=nBPlsOtuqv0zwIns4YY7uZsaAM0uPZ7mkcqe8tNDHl8,2971
|
|
69
|
+
skillanalyzer/data/prompts/skill_meta_analysis_prompt.md,sha256=O6vUsmCoqDvsd8j8ZbCCzYDdKYZd_UtXgRUJU4xaT4g,13924
|
|
70
|
+
skillanalyzer/data/prompts/skill_threat_analysis_prompt.md,sha256=SLSlPbQ_7ASyivbQFnu_MKXJkTx1CMpudb4x5_mykY0,11651
|
|
71
|
+
skillanalyzer/data/prompts/unified_response_schema.md,sha256=JzUGSRmF9J0cMcOWy05GGPWyGyYGkto4VPaXL59FWgM,3572
|
|
72
|
+
skillanalyzer/data/rules/signatures.yaml,sha256=EMNH1JU5PRU0o8BZai_WzjNXX3UDlv3Gle2SpNt-hb8,16476
|
|
73
|
+
skillanalyzer/data/yara_rules/autonomy_abuse.yara,sha256=MuS_YbczaPY4e58dvtaa4nQx6pdcklNjOWtkdo5YLew,2582
|
|
74
|
+
skillanalyzer/data/yara_rules/code_execution.yara,sha256=9QP_JR8ZdLCPuDgJMLee6FgsIQPV5UNSBPnOcInHD1M,1898
|
|
75
|
+
skillanalyzer/data/yara_rules/coercive_injection.yara,sha256=3QNzoiHDyhk1zUXHv7_COtCBSsr-bb--H4wKeNRCbBM,5359
|
|
76
|
+
skillanalyzer/data/yara_rules/command_injection.yara,sha256=8I4mztCPgIZhAipr6GeZbEIi4v6kowVYrqw_ay1ny-w,2165
|
|
77
|
+
skillanalyzer/data/yara_rules/credential_harvesting.yara,sha256=7W0pSKpW2KAmek1qP_DpjMHKuswv5L36tWusjuEl6Pc,5643
|
|
78
|
+
skillanalyzer/data/yara_rules/prompt_injection.yara,sha256=q5tT7-L__x9RCjdAbFLcs9mSs8gZOmPPzjbdNKRwIHE,2715
|
|
79
|
+
skillanalyzer/data/yara_rules/script_injection.yara,sha256=pzVPd7b9WNAS5iw8ZMoUgojKSBlEeSTLHLBho8UiMmA,3100
|
|
80
|
+
skillanalyzer/data/yara_rules/skill_discovery_abuse.yara,sha256=gCgFcdFyLFU__7VPZIk8Hgp6ZMw31SPzDUPlpjNa69E,2453
|
|
81
|
+
skillanalyzer/data/yara_rules/sql_injection.yara,sha256=pWq3ccqEvQtWz4fU8dQOkhCgVl6US9SZJDfuBU_YCY4,3691
|
|
82
|
+
skillanalyzer/data/yara_rules/system_manipulation.yara,sha256=XoO17sZrarzdC58yyHaIz8z36x5xyxzmQXBnkYdoYfM,2231
|
|
83
|
+
skillanalyzer/data/yara_rules/tool_chaining_abuse.yara,sha256=T-G3Tib8lU53ZYFdjlI2EEs6qQnZ831oUDNj2vjtONA,2256
|
|
84
|
+
skillanalyzer/data/yara_rules/transitive_trust_abuse.yara,sha256=msYKqzbeFWe4mSLsdX8nJwOwuTV9nLFKDf8dXY2wJ8g,2773
|
|
85
|
+
skillanalyzer/data/yara_rules/unicode_steganography.yara,sha256=5UxTvcy8CeWJLrPeldgJ9rY5gfODlC9bTNOkCauuOJA,2650
|
|
86
|
+
skillanalyzer/hooks/__init__.py,sha256=ufSIo7sdtGxRD4lVDOVqBOqF3dhgEZRSkTu-UT5ZkcA,740
|
|
87
|
+
skillanalyzer/hooks/pre_commit.py,sha256=y-9lz4OD2ILlYpbUa8S1uUjBfNDmU8EC-tWyUGU5NY8,13223
|
|
88
|
+
skillanalyzer/threats/__init__.py,sha256=PiQ3frPbbaiKmdcxsan-NAgYDOYn_jhr-44-jSIysoY,883
|
|
89
|
+
skillanalyzer/threats/threats.py,sha256=egFsT1crNlWQH3szG8yYIURMXXGh7GJnH3wI8w05nfI,21449
|
|
90
|
+
skillanalyzer/utils/__init__.py,sha256=KnfUi433fGDKwck57kob4vuA8upzwSC-Na6OHrZ2uDc,907
|
|
91
|
+
skillanalyzer/utils/command_utils.py,sha256=dTjN3Uzpk3dw5u7jbbOKO0j5FwmjYqcKlpr0vDA_1y4,4292
|
|
92
|
+
skillanalyzer/utils/di_container.py,sha256=0wsQaVFkVLzORVEoMpSoZK_wOJrKTCAkTFkeEuTPzos,4586
|
|
93
|
+
skillanalyzer/utils/file_utils.py,sha256=LT2xwrbqIWaYC-BYAL9zpF6a2xk6QNUVzItvGGJcBn8,2043
|
|
94
|
+
skillanalyzer/utils/logging_config.py,sha256=wJ3HUNmGECgWE9jwz-SSuUMN-xTde6ybF4Yqa8Qrix4,2940
|
|
95
|
+
skillanalyzer/utils/logging_utils.py,sha256=CLdOYmQdJejiLbcECTT2CbDU27PJ327AFMmeuVfCy94,1902
|
|
96
|
+
cisco_ai_skill_scanner-1.0.0.dist-info/METADATA,sha256=oh3eKpG8h_pfWcIDdV4z6aAM38Yz-Pv1ZybReEqhYys,9290
|
|
97
|
+
cisco_ai_skill_scanner-1.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
98
|
+
cisco_ai_skill_scanner-1.0.0.dist-info/entry_points.txt,sha256=IQSseT8ZcU7aaqYdl20wC1-TqKlklZR2Nw609NBQARw,175
|
|
99
|
+
cisco_ai_skill_scanner-1.0.0.dist-info/licenses/LICENSE,sha256=b4va5sK_CWxpeDnOO2MF0MKqsiwU-3YblMmWKnmuWZg,653
|
|
100
|
+
cisco_ai_skill_scanner-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Cisco Systems, Inc. and its affiliates
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Copyright 2026 Cisco Systems, Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
#
|
|
15
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
Claude Skill Analyzer - Security scanner for Claude Skills packages.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
__version__ = "0.2.0"
|
|
22
|
+
__author__ = "Cisco Systems, Inc."
|
|
23
|
+
|
|
24
|
+
# Core exports
|
|
25
|
+
from .config.config import Config
|
|
26
|
+
from .config.constants import SkillAnalyzerConstants
|
|
27
|
+
from .core.loader import SkillLoader, load_skill
|
|
28
|
+
from .core.models import Finding, Report, ScanResult, Severity, Skill, ThreatCategory
|
|
29
|
+
from .core.scanner import SkillScanner, scan_directory, scan_skill
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"SkillScanner",
|
|
33
|
+
"scan_skill",
|
|
34
|
+
"scan_directory",
|
|
35
|
+
"Skill",
|
|
36
|
+
"Finding",
|
|
37
|
+
"ScanResult",
|
|
38
|
+
"Report",
|
|
39
|
+
"Severity",
|
|
40
|
+
"ThreatCategory",
|
|
41
|
+
"SkillLoader",
|
|
42
|
+
"load_skill",
|
|
43
|
+
"Config",
|
|
44
|
+
"SkillAnalyzerConstants",
|
|
45
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '1.0.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 0, 0)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright 2026 Cisco Systems, Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
#
|
|
15
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
REST API server for Claude Skill Analyzer.
|
|
19
|
+
|
|
20
|
+
Matches MCP Scanner's API structure.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from .api import app
|
|
24
|
+
|
|
25
|
+
__all__ = ["app"]
|
skillanalyzer/api/api.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2026 Cisco Systems, Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
#
|
|
15
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
|
|
17
|
+
"""API module for Skill Analyzer.
|
|
18
|
+
|
|
19
|
+
This module provides a FastAPI application for scanning Claude Skills packages.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from fastapi import FastAPI
|
|
23
|
+
|
|
24
|
+
from .router import router as api_router
|
|
25
|
+
|
|
26
|
+
app = FastAPI(
|
|
27
|
+
title="Claude Skill Analyzer API",
|
|
28
|
+
description="Security scanning API for Claude Skills packages",
|
|
29
|
+
version="0.2.0",
|
|
30
|
+
docs_url="/docs",
|
|
31
|
+
redoc_url="/redoc",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
app.include_router(api_router)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Copyright 2026 Cisco Systems, Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
#
|
|
15
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
CLI for running the API server.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
import argparse
|
|
22
|
+
import sys
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def main():
|
|
26
|
+
"""Main entry point for API server CLI."""
|
|
27
|
+
parser = argparse.ArgumentParser(
|
|
28
|
+
description="Claude Skill Analyzer API Server",
|
|
29
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
30
|
+
epilog="""
|
|
31
|
+
Examples:
|
|
32
|
+
# Start server on default port
|
|
33
|
+
skill-analyzer-api
|
|
34
|
+
|
|
35
|
+
# Start on custom port
|
|
36
|
+
skill-analyzer-api --port 8080
|
|
37
|
+
|
|
38
|
+
# Start with auto-reload for development
|
|
39
|
+
skill-analyzer-api --reload
|
|
40
|
+
|
|
41
|
+
# Custom host and port
|
|
42
|
+
skill-analyzer-api --host 0.0.0.0 --port 9000
|
|
43
|
+
""",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
parser.add_argument("--host", default="0.0.0.0", help="Host to bind to (default: 0.0.0.0)")
|
|
47
|
+
|
|
48
|
+
parser.add_argument("--port", type=int, default=8000, help="Port to bind to (default: 8000)")
|
|
49
|
+
|
|
50
|
+
parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development")
|
|
51
|
+
|
|
52
|
+
args = parser.parse_args()
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
import uvicorn
|
|
56
|
+
except ImportError:
|
|
57
|
+
print("Error: API server dependencies not installed.", file=sys.stderr)
|
|
58
|
+
print("Install with: pip install fastapi uvicorn python-multipart", file=sys.stderr)
|
|
59
|
+
return 1
|
|
60
|
+
|
|
61
|
+
print("Starting Claude Skill Analyzer API Server...")
|
|
62
|
+
print(f"Server: http://{args.host}:{args.port}")
|
|
63
|
+
print(f"Docs: http://{args.host}:{args.port}/docs")
|
|
64
|
+
print(f"Health: http://{args.host}:{args.port}/health")
|
|
65
|
+
print()
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
uvicorn.run("skillanalyzer.api.api:app", host=args.host, port=args.port, reload=args.reload)
|
|
69
|
+
except KeyboardInterrupt:
|
|
70
|
+
print("\nShutting down server...")
|
|
71
|
+
return 0
|
|
72
|
+
except Exception:
|
|
73
|
+
print("Error: Could not start API server", file=sys.stderr)
|
|
74
|
+
return 1
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == "__main__":
|
|
78
|
+
sys.exit(main())
|