agentsclimarketplace

Code safety audit

Skill serejaris/kimi-skills/skills/code-safety-audit

扫描代码安全漏洞,检测依赖漏洞、密钥泄露和OWASP安全模式。当用户提到安全扫描、漏洞检测、依赖审计、密钥泄露、API key、OWASP、npm audit、pip-audit或SQL注入/XSS等关键词时触发。From its SKILL.md

Install
npx -y skills add serejaris/kimi-skills --skill code-safety-audit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 22 days oldThe repository was created 22 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.7 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

security-scanner

代码安全扫描工具,提供三大扫描能力:

  1. 依赖漏洞扫描 — 自动检测 npm / pip 依赖中的已知漏洞
  2. 密钥泄露检测 — 通过正则匹配 + Shannon 熵值分析发现硬编码的密钥、Token、密码
  3. OWASP 模式检测 — 识别 SQL 注入、XSS、命令注入、不安全反序列化等常见安全反模式

Quick Start

# 扫描当前目录(全部检查项)
python3 scripts/security_scan.py .

# 仅扫描依赖漏洞
python3 scripts/security_scan.py --mode deps .

# 仅检测密钥泄露
python3 scripts/security_scan.py --mode secrets /path/to/project

# 仅检测 OWASP 安全模式
python3 scripts/security_scan.py --mode owasp .

# 输出 JSON 格式报告
python3 scripts/security_scan.py --format json --output report.json .

# 只显示 high 及以上严重级别
python3 scripts/security_scan.py --severity high .

扫描模块详情

1. 依赖漏洞扫描 (deps)

自动检测项目类型并调用相应工具:

项目类型检测文件使用工具
Node.jspackage.json + package-lock.jsonnpm audit
Pythonrequirements.txt / pyproject.toml / Pipfilepip-audit

如果对应的审计工具未安装,会给出提示而不是报错。

2. 密钥泄露检测 (secrets)

通过两种方式检测:

正则匹配:覆盖常见的密钥格式

密钥类型示例模式
AWS Access KeyAKIA 开头的 20 字符
GitHub Tokenghp_github_pat_ 开头
Slack Tokenxoxb-xoxp- 开头
Stripe Keysk_live_pk_live_ 开头
私钥文件-----BEGIN PRIVATE KEY-----
通用 API Keyapi_key = "..." 格式
URL 内嵌凭据https://user:pass@host
JWT TokeneyJ... 格式

Shannon 熵值分析:对代码中的字符串常量计算信息熵(阈值 > 4.5 且长度 >= 20),用于发现非标准格式的密钥。

3. OWASP 模式检测 (owasp)

覆盖 OWASP Top 10 中可静态检测的安全模式:

OWASP 分类检测模式
A02: 密码学失败弱哈希 (MD5/SHA1)、弱加密 (DES/RC4)
A03: 注入SQL 注入、命令注入 (os.system/subprocess shell/eval/exec)、XSS (innerHTML/document.write/dangerouslySetInnerHTML/v-html)
A04: 不安全设计路径遍历
A05: 安全配置错误Debug 模式开启、CORS 通配符、绑定 0.0.0.0
A08: 完整性失败不安全反序列化 (pickle/yaml.load/marshal/unserialize)
A10: SSRF用户输入直接用于 HTTP 请求

支持语言:Python、JavaScript/TypeScript、Java、PHP、Ruby、Go 等。

参数说明

参数说明默认值
TARGET扫描目标目录当前目录
--mode MODE扫描模式:alldepssecretsowaspall
--format FORMAT输出格式:textjsontext
--output FILE输出文件路径stdout
--severity LEVEL最低报告级别:lowmediumhighcriticallow
--exclude-dir DIR额外排除的目录(可重复使用)-
--max-file-kb SIZE单文件最大扫描大小 (KB)512
-h, --help显示帮助-

输出格式

文本输出(默认)

=== Security Scan Report ===
Target: /path/to/project
Modules: deps, secrets, owasp

[CRITICAL] AWS Access Key ID
  File: src/config.py:15
  Code: AWS_KEY = "AKIAIOSFODNN7EXAMPLE"

[HIGH] SQL Injection (f-string)
  File: src/db.py:42
  Code: cursor.execute(f"SELECT * FROM users WHERE id={user_id}")

--- Summary ---
Critical: 1 | High: 1 | Medium: 0 | Low: 0
Total findings: 2

JSON 输出

{
  "target": "/path/to/project",
  "scan_time": "2026-04-14T10:30:00",
  "findings": [
    {
      "scanner": "secrets",
      "name": "AWS Access Key ID",
      "severity": "critical",
      "file": "src/config.py",
      "line": 15,
      "snippet": "AWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"",
      "category": "secret-pattern"
    }
  ],
  "summary": {"critical": 1, "high": 0, "medium": 0, "low": 0, "total": 1}
}

退出码

退出码含义
0无发现
1有发现(至少一个安全问题)
2扫描器自身错误

前置条件

  • Python 3.7+(仅使用标准库)
  • 依赖扫描需要相应工具:npm(Node.js 项目)、pip-audit(Python 项目)
  • 如缺少审计工具,该模块会跳过并给出提示,不影响其他模块运行

What ships with it: 2 files

30.4 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,871. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.