跳到主内容
智客 ZICQ

技能库 智客分类:安全测试 Python Security Scan

Python Security Scan

Python项目(包括Flask、Django和FastAPI应用程序)的安全脆弱性综合扫描仪。 探测 OWASP 10大弱点,注射缺陷,不安全的去序列化,认证问题,硬码秘密,以及特定框架的安全问题. 审计已知的CVES的依赖性并生成可采取行动的安全报告.

527 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

Python项目(包括Flask、Django和FastAPI应用程序)的安全脆弱性综合扫描仪。 探测 OWASP 10大弱点,注射缺陷,不安全的去序列化,认证问题,硬码秘密,以及特定框架的安全问题. 审计已知的CVES的依赖性并生成可采取行动的安全报告.

何时用

这个技能

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Python Security Scan Skill、When to Use This Skill、Supported Frameworks、Scan Types、1. Quick Scan、2. Full Scan。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/dependency-audit.sh、scripts/secret-scanner.py、references/python-vulnerabilities.md、references/injection-patterns.md、references/deserialization.md、references/flask-security.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Comprehensive security vulnerability scanner for Python projects including Flask, Django, and FastAPI applications. Detects OWASP Top 10 vulnerabilities, injection flaws, insecure deserialization, authentication issues, hardcoded secrets, and framework-specific security problems. Audits dependencies for known CVEs and generates actionable security reports.

Python Security Scan SkillWhen to Use This SkillSupported FrameworksScan Types1. Quick Scan2. Full Scan3. Targeted ScanScan ProcedureStep 1: Project DiscoveryStep 2: Framework DetectionDetection patternsStep 3: Dependency Audit

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
Python Security Scan
description
Comprehensive security vulnerability scanner for Python projects including Flask, Django, and FastAPI applications. Detects OWASP Top 10 vulnerabilities, injection flaws, insecure deserialization, authentication issues, hardcoded secrets, and framework-specific security problems. Audits dependencies for known CVEs and generates actionable security reports.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 10
  • scripts/dependency-audit.sh
  • scripts/secret-scanner.py
  • references/python-vulnerabilities.md
  • references/injection-patterns.md
  • references/deserialization.md
  • references/flask-security.md
  • references/django-security.md
  • references/fastapi-security.md
  • assets/report-template.md
  • references/owasp-top-10.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「Python Security Scan」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-46b5a7fdacc56450-Python-%E5%AE%89%E5%85%A8%E6%89%AB%E6%8F%8F.html
请存为 .cursor/skills/python-security-scan/SKILL.md 或 .claude/skills/python-security-scan/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/sugarforever/01coder-agent-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/sugarforever/01coder-agent-skills' --list

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: "Python Security Scan" description: "Comprehensive security vulnerability scanner for Python projects including Flask, Django, and FastAPI applications. Detects OWASP Top 10 vulnerabilities, injection flaws, insecure deserialization, authentication issues, hardcoded secrets, and framework-specific security problems. Audits dependencies for known CVEs and generates actionable security reports." --- # Python Security Scan Skill This skill enables comprehensive security scanning of Python projects based on OWASP guidelines, Python security best practices, and framework-specific vulnerabilities. ## When to Use This Skill - Security audits of Python applications - Code review for security vulnerabilities - Pre-deployment security checks - Dependency vulnerability assessment - Detecting hardcoded secrets and credentials - Framework-specific security reviews (Flask, Django, FastAPI) ## Supported Frameworks This skill automatically detects and applies framework-specific checks for: - **Flask** - Template injection, session security, CORS, extensions - **Django** - ORM injection, CSRF, template security, settings - **FastAPI** - Dependency injection, Pydantic validation, OAuth2 - **General Python** - Core language vulnerabilities applicable to all projects ## Scan Types ### 1. Quick Scan Fast scan focusing on critical vulnerabilities: - Hardcoded secrets, API keys, and credentials - Dangerous function usage (`eval`, `exec`, `pickle.loads`) - Command injection via `subprocess`, `os.system` - SQL injection patterns - Known vulnerable dependencies ### 2. Full Scan Comprehensive security assessment covering: - All OWASP Top 10:2025 categories - Python-specific vulnerabilities - Framework-specific security issues - Injection vulnerabilities (SQL, NoSQL, Command, LDAP) - Insecure deserialization - Authentication and authorization flaws - Cryptographic failures - Security misconfigurations - Dependency audit (CVE check) - Environment variable and secrets exposure ### 3. Targeted Scan Focus on specific vulnerability categories: - `--injection` - SQL/NoSQL/Command/LDAP injection - `--deserialization` - Pickle, YAML, JSON deserialization - `--auth` - Authentication/authorization issues - `--secrets` - Hardcoded credentials - `--deps` - Dependency vulnerabilities - `--crypto` - Cryptographic issues - `--flask` - Flask-specific vulnerabilities - `--django` - Django-specific vulnerabilities - `--fastapi` - FastAPI-specific vulnerabilities ## Scan Procedure ### Step 1: Project Discovery 1. Identify project type and framework: - Check for `requirements.txt`, `Pipfile`, `pyproject.toml`, `setup.py` - Detect Flask (`from flask import`), Django (`django.conf`), FastAPI (`from fastapi import`) 2. Locate configuration files 3. Map the codebase structure ### Step 2: Framework Detection ```python # Detection patterns Flask: "from flask import", "Flask(__name__)" Django: "django.conf.settings", "INSTALLED_APPS", "manage.py" FastAPI: "from fastapi import", "FastAPI()" ``` ### Step 3: Dependency Audit Run the dependency audit script: ```bash ./scripts/dependency-audit.sh /path/to/project ``` Or manually: ```bash pip-audit # or safety check ``` ### Step 4: Secret Scanning Scan for hardcoded secrets: ```bash python scripts/secret-scanner.py /path/to/project ``` **Important: Environment File Handling** - By default, real `.env` files are **SKIPPED** (`.env`, `.env.local`, `.env.production`, etc.) - These files contain actual secrets and should not be in version control - Only `.env.example` and `.env.template` files are analyzed for documentation quality - Use `--include-env-files` flag only if explicitly requested by user The scanner will: 1. Scan source code for hardcoded secrets 2. Analyze `.env.example` templates to check: - Which sensitive variables are documented - Whether variables have descriptions (comments) - If placeholder values look like real secrets - Suggestions for missing common variables (SECRET_KEY, DATABASE_URL, etc.) ### Step 5: Pattern Analysis For each file in the codebase, check against patterns in: - `references/python-vulnerabilities.md` - Core Python issues - `references/injection-patterns.md` - Injection flaws - `references/deserialization.md` - Insecure deserialization - `references/flask-security.md` - Flask vulnerabilities - `references/django-security.md` - Django vulnerabilities - `references/fastapi-security.md` - FastAPI vulnerabilities ### Step 6: Report Generation Generate a security report using: - `assets/report-template.md` - Report structure ## Severity Classification | Severity | Description | Action Required | |----------|-------------|-----------------| | CRITICAL | Exploitable vulnerability with severe impact | Immediate fix required | | HIGH | Significant security risk | Fix before deployment | | MEDIUM | Potential security issue | Fix in next release | | LOW | Minor security concern | Consider fixing | | INFO | Security best practice suggestion | Optional improvement | ## Key Files to Scan ### Always Check - `**/*.py` - All Python source files - `requirements.txt`, `Pipfile`, `pyproject.toml` - Dependencies - `setup.py`, `setup.cfg` - Package configuration - `config.py`, `settings.py` - Configuration files - `**/secrets*`, `**/credentials*` - Obvious secret locations ### Environment Files - `.env.example`, `.env.template` - **SCAN** for template analysis - `.env`, `.env.local`, `.env.production` - **SKIP** by default (contain real secrets) **Note:** Real `.env` files should never be committed to version control. The scanner analyzes `.env.example` templates to ensure proper documentation of required variables. ### High Priority Locations - `app.py`, `main.py`, `wsgi.py` - Entry points - `**/views.py`, `**/routes.py` - Request handlers - `**/api/**/*.py` - API endpoints - `**/auth*`, `**/login*` - Authentication code - `**/models.py` - Database models - `**/serializers.py` - Data serialization - `**/middleware.py` - Middleware code ### Framework-Specific **Flask:** - `app.py`, `__init__.py` - Application factory - `**/blueprints/**` - Blueprint routes - `templates/**` - Jinja2 templates **Django:** - `settings.py`, `**/settings/*.py` - Django settings - `urls.py` - URL configuration - `**/views.py` - View functions/classes - `**/forms.py` - Form definitions - `templates/**` - Django templates **FastAPI:** - `main.py` - Application entry - `**/routers/**` - API routers - `**/dependencies.py` - Dependency injection - `**/schemas.py` - Pydantic models ## Output Format Findings should be reported as: ``` [SEVERITY] Category: Description File: path/to/file.py:lineNumber Code: Risk: Fix: ``` ## Integration with CI/CD This skill can generate output compatible with: - GitHub Security Advisories - SARIF format for GitHub Code Scanning - JSON for custom integrations - JUnit XML for CI pipelines ## References Load additional context as needed: - `references/owasp-top-10.md` - OWASP Top 10:2025 quick reference - `references/python-vulnerabilities.md` - Python-specific vulnerabilities - `references/injection-patterns.md` - Injection vulnerability patterns - `references/deserialization.md` - Insecure deserialization patterns - `references/flask-security.md` - Flask security guide - `references/django-security.md` - Django security guide - `references/fastapi-security.md` - FastAPI security guide

相关技能

安全测试

Skill Vetter

人工智能特工的安全第一技能审查。 在安装来自 ClawdHub, GitHub 或其他来源的任何技能之前使用 。 检查红旗,许可范围,可疑图案.

安全测试

Moltguard

MoltGuard——由OpenGuardrails担任OpenClaw保安. 安装 MoltGuard 以保护你和你的人类免受迅速注射、数据过滤和恶意命令的影响。 资料来源:https://github.com/openguardrails/openguardrails/tre…

安全测试

Security Auditor

用于审查安全漏洞代码,实施认证流,审计OWASP Top 10,配置CORS/CSP头,处理秘密,输入验证,SQL注射预防,XSS保护,或任何与安全相关的代码审查.

安全测试

Skill Vetter

安装任何AI代理技能前的安全审查协议. 红旗侦取入证盗取,疏通密码,放出. 风险分类:低/中/高/高。 编制结构化审查报告。 不先运行此功能, 绝不安装不信任的技能 .