Manusで任意のスキルを実行
ワンクリックで
ワンクリックで
ワンクリックでManusで任意のスキルを実行
始めるsecure-code-review
スター6
フォーク1
更新日2026年4月2日 06:09
安全代码审查的专业技能和方法论
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SKILL.md
readonlyメニュー
安全代码审查的专业技能和方法论
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
API安全测试的专业技能和方法论
业务逻辑漏洞测试的专业技能和方法论
云安全审计的专业技能和方法论
命令注入漏洞测试的专业技能和方法论
容器安全测试的专业技能和方法论
CSRF跨站请求伪造测试的专业技能和方法论
| name | secure-code-review |
| description | 安全代码审查的专业技能和方法论 |
| version | 1.0.0 |
安全代码审查是识别代码中安全漏洞的重要方法。本技能提供安全代码审查的方法、工具和最佳实践。
检查项目:
检查项目:
检查项目:
检查项目:
使用SAST工具:
# SonarQube
sonar-scanner
# Checkmarx
# 使用Web界面
# Fortify
sourceanalyzer -b project build.sh
sourceanalyzer -b project -scan
# Semgrep
semgrep --config=auto .
审查清单:
危险函数:
# Python危险函数
eval()
exec()
pickle.loads()
os.system()
subprocess.call()
// Java危险函数
Runtime.exec()
ProcessBuilder()
Class.forName()
// PHP危险函数
eval()
exec()
system()
passthru()
危险代码:
String query = "SELECT * FROM users WHERE id = " + userId;
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(query);
安全代码:
String query = "SELECT * FROM users WHERE id = ?";
PreparedStatement stmt = connection.prepareStatement(query);
stmt.setInt(1, userId);
ResultSet rs = stmt.executeQuery();
危险代码:
document.innerHTML = userInput;
element.innerHTML = "<div>" + userInput + "</div>";
安全代码:
element.textContent = userInput;
element.setAttribute("data-value", userInput);
// 或使用编码库
element.innerHTML = escapeHtml(userInput);
危险代码:
import os
os.system("ping " + user_input)
安全代码:
import subprocess
subprocess.run(["ping", "-c", "1", validated_input])
危险代码:
String filePath = "/uploads/" + fileName;
File file = new File(filePath);
安全代码:
String basePath = "/uploads/";
String fileName = Paths.get(fileName).getFileName().toString();
String filePath = basePath + fileName;
File file = new File(filePath);
if (!file.getCanonicalPath().startsWith(basePath)) {
throw new SecurityException("Invalid path");
}
危险代码:
String apiKey = "1234567890abcdef";
String password = "admin123";
安全代码:
String apiKey = System.getenv("API_KEY");
String password = keyStore.getPassword("db_password");
# 启动SonarQube
docker run -d -p 9000:9000 sonarqube
# 运行扫描
sonar-scanner \
-Dsonar.projectKey=myproject \
-Dsonar.sources=. \
-Dsonar.host.url=http://localhost:9000
# 安装
pip install semgrep
# 运行扫描
semgrep --config=auto .
# 使用规则
semgrep --config=p/security-audit .
# 创建数据库
codeql database create database --language=java --source-root=.
# 运行查询
codeql database analyze database security-and-quality.qls --format=sarif-latest