360 Secure SkillHub
360 安全技能中心

codeql-skill

提供 CodeQL 安全审计的三个独立模式:扫描仓库生成 SARIF、解析 SARIF 做漏洞分诊并输出报告、优化或调试 .ql 查询;附 Java/JavaScript/Python/C++ 查询编写参考与调试参考,由脚本完成机械步骤,模型负责复核可疑项与改写查询逻辑。

k2-l
k2-l
热度 57.26
最近更新 2026-05-11 17:30:24
分类:安全依赖:代码执行 / 读写文件 / 内部调用大模型应用场景:代码审查 / 报告撰写 / 调试排错 / 自动化脚本 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add codeql-skill
Metadata
name
codeql
description
CodeQL security audit pipeline: static scanning, SARIF triage, and QL query optimization. Trigger on: CodeQL, .ql, .sarif, taint tracking, source→sink, LGTM, GitHub Code Scanning, "scan this repo", "analyze this vulnerability", "optimize this query".

CodeQL Security Audit Skill

Three independent modes — identify which one the user needs and run the corresponding script.

User Intent Mode Script
Scan a repo / create a DB / generate SARIF [SCAN] scripts/scan.sh
Read SARIF / triage vulns / generate report [AUDIT] scripts/audit.py
Optimize or debug a .ql query file [TUNE] scripts/tune.py

[SCAN]

bash scripts/scan.sh <repo_path> [language] [output.sarif]
# language: java | javascript | python | cpp | auto (default)

The script handles: language detection → build command selection → CodeQL DB creation → security suite scan → SARIF output.

For writing custom queries, refer to the relevant language reference: references/lang-java.md / lang-javascript.md / lang-python.md / lang-cpp.md


[AUDIT]

python3 scripts/audit.py <results.sarif> --output exp.md

The script handles: SARIF parsing → attack surface inventory → vuln family grouping → source→sink evidence chain extraction → exp.md output.

Claude's responsibility (what the script cannot do):

  • Manually assess [SUSPICIOUS] entries with no data flow — determine if they are real vulnerabilities
  • Write POC requests based on business context
  • Provide concrete remediation code

[TUNE]

python3 scripts/tune.py <query.ql>

The script outputs a tuning checklist covering seven checks: coverage, false positives, performance, and metadata completeness.

Claude's responsibility (what the script cannot do):

  • Rewrite source / sink / sanitizer logic based on checklist findings
  • Debug queries with no results or unexpected output — refer to references/debugging.md