43622283/li-codeql-llm/SKILL.md
CodeQL 安全扫描与 LLM 智能分析融合工具。自动检测 CodeQL 安装、扫描指定目录、生成漏洞报告、LLM 分析、Jenkins 集成、输出验证 Checklist。
npx skillsauth add openclaw/skills Li_codeql_LLMInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本 Skill 实现 CodeQL 扫描与 LLM 智能分析的完整自动化流程:
# 检查 CodeQL 是否安装
codeql --version
# 如果未安装,下载并解压
wget https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip
unzip codeql-linux64.zip -d /opt/codeql
ln -s /opt/codeql/codeql/codeql /usr/local/bin/codeql
在对话中直接请求:
扫描 /path/to/project 的安全漏洞
或指定靶机目录:
扫描 /root/devsecops-python-web 靶机,生成验证清单
# 扫描当前目录
codeql database create codeql-db --language=python --source-root=.
codeql database analyze codeql-db python-security-extended.qls \
--format=sarif-latest --output=results.sarif
在 OpenClaw 会话中:
/codeql_scan /path/to/project
或直接描述需求:
帮我扫描这个项目,用 CodeQL 分析安全问题,然后生成报告
# 检查 CodeQL
which codeql && codeql --version
# 检查支持的語言
codeql resolve languages
# Python 项目
codeql database create codeql-db \
--language=python \
--source-root=/path/to/project \
--overwrite
# 下载查询包
codeql pack download codeql/python-queries
# 运行分析
codeql database analyze codeql-db \
/root/.codeql/packages/codeql/python-queries/*/codeql-suites/python-security-extended.qls \
--format=sarif-latest \
--output=codeql-results.sarif
将 SARIF 结果发送给 LLM:
import json
with open('codeql-results.sarif') as f:
data = json.load(f)
# 提取关键信息
results = data['runs'][0]['results']
for r in results:
print(f"规则:{r['ruleId']}")
print(f"描述:{r['message']['text']}")
print(f"位置:{r['locations'][0]['physicalLocation']['artifactLocation']['path']}")
LLM 分析内容:
生成以下文件:
扫描 /root/devsecops-python-web 靶机
- 识别所有安全漏洞
- 按 OWASP Top 10 分类
- 生成利用 payload
- 输出验证 Checklist
扫描 /path/to/my-project
- 检测严重和高危漏洞
- 给出修复优先级
- 生成审计报告
# .github/workflows/security.yml
- name: CodeQL Scan
run: |
codeql database create db --language=python
codeql database analyze db python-security-extended.qls \
--format=sarif-latest --output=results.sarif
- name: LLM Analysis
run: |
# 调用 LLM 分析 results.sarif
# 生成修复建议
包含:
包含:
# Python
--language=python
# JavaScript
--language=javascript
# Java
--language=java
# Go
--language=go
# 多语言
--language=python,javascript
# 安全扩展(推荐)
python-security-extended.qls
# 代码质量
python-code-quality.qls
# 安全与质量
python-security-and-quality.qls
# 代码扫描(默认)
python-code-scanning.qls
# SARIF(推荐)
--format=sarif-latest
# CSV
--format=csv
# JSON
--format=json
A: 确保项目可以正常构建:
# Python 项目
python -m pip install -r requirements.txt
# 然后创建数据库
codeql database create db --language=python
A: 使用过滤:
# 只看严重和高危
codeql database analyze db python-security-extended.qls \
--rerun --checkout=latest \
--sarif-category=severity \
--output=results.sarif
A:
python-security-extended.qls 而非 python-code-scanning.qls用户: 扫描 /root/devsecops-python-web 靶机
助手:
用户: 分析最严重的 3 个漏洞
助手:
' OR '1'='1__import__('os').system('id'); cat /etc/passwd详细利用方法见报告...
版本: 1.0.0
作者: OpenClaw Community
许可: MIT
tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。