名称: 安全扫描器 描述: 运行安全扫描,包括SAST、依赖项扫描和密钥检测 允许使用的工具:
- Bash
- 读取
- 写入
- Glob
安全扫描器技能
概述
运行全面的安全扫描,包括使用Semgrep/CodeQL进行SAST扫描、使用Snyk/OWASP进行依赖项漏洞扫描、密钥检测以及容器镜像扫描。
能力
- SAST扫描(Semgrep,CodeQL)
- 依赖项漏洞扫描(Snyk,OWASP Dependency-Check)
- 密钥检测(git-secrets,truffleHog,gitleaks)
- 容器镜像扫描(Trivy,Grype)
- 许可证合规性检查
- SBOM生成
- CVE数据库查询
目标流程
- 安全架构审查
- 基础设施即代码审查
输入模式
{
"type": "object",
"required": ["targets"],
"properties": {
"targets": {
"type": "array",
"items": { "type": "string" },
"description": "要扫描的路径"
},
"scanTypes": {
"type": "array",
"items": {
"type": "string",
"enum": ["sast", "dependencies", "secrets", "containers", "licenses"]
},
"default": ["sast", "dependencies", "secrets"]
},
"tools": {
"type": "object",
"properties": {
"sast": {
"type": "string",
"enum": ["semgrep", "codeql"],
"default": "semgrep"
},
"dependencies": {
"type": "string",
"enum": ["snyk", "owasp", "npm-audit"],
"default": "snyk"
},
"secrets": {
"type": "string",
"enum": ["gitleaks", "trufflehog"],
"default": "gitleaks"
}
}
},
"options": {
"type": "object",
"properties": {
"severityThreshold": {
"type": "string",
"enum": ["critical", "high", "medium", "low"],
"default": "medium"
},
"failOnVulnerability": {
"type": "boolean",
"default": true
}
}
}
}
}
输出模式
{
"type": "object",
"properties": {
"vulnerabilities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"severity": { "type": "string" },
"type": { "type": "string" },
"file": { "type": "string" },
"line": { "type": "number" },
"description": { "type": "string" },
"cve": { "type": "string" },
"fix": { "type": "string" }
}
}
},
"secrets": {
"type": "array"
},
"dependencyVulnerabilities": {
"type": "array"
},
"summary": {
"type": "object",
"properties": {
"critical": { "type": "number" },
"high": { "type": "number" },
"medium": { "type": "number" },
"low": { "type": "number" }
}
},
"passed": {
"type": "boolean"
}
}
}
使用示例
{
kind: 'skill',
skill: {
name: 'security-scanner',
context: {
targets: ['src/**/*.ts', 'package.json'],
scanTypes: ['sast', 'dependencies', 'secrets'],
tools: {
sast: 'semgrep',
dependencies: 'snyk'
},
options: {
severityThreshold: 'high',
failOnVulnerability: true
}
}
}
}