設定リファレンス
Security Scanner MCPの完全な設定ガイド。
設定ファイル
.securityscannerrc
プロジェクトルートに作成:
{
"version": "1.0",
"exclude": [
"node_modules/**",
"dist/**",
"build/**",
"*.test.js",
"*.spec.ts"
],
"include": [
"src/**/*.js",
"src/**/*.ts",
"lib/**/*.py"
],
"severity": {
"minLevel": "medium",
"failOn": ["critical", "high"]
},
"rules": {
"secrets": {
"enabled": true,
"patterns": "default"
},
"injection": {
"enabled": true,
"sql": true,
"nosql": true,
"command": true
},
"xss": {
"enabled": true,
"strictMode": false
},
"crypto": {
"enabled": true,
"allowedAlgorithms": ["sha256", "sha512", "bcrypt"]
},
"auth": {
"enabled": true,
"enforceHttpOnly": true,
"enforceSecure": true
},
"path": {
"enabled": true,
"checkTraversal": true
}
},
"output": {
"format": "json",
"verbose": false,
"colors": true
}
}
Package.json 統合
{
"securityScanner": {
"exclude": ["test/**"],
"severity": {
"minLevel": "high"
}
}
}
ルール設定
ルールを有効/無効化
{
"rules": {
"secrets": true, // 有効化
"injection": false, // 無効化
"xss": { // 詳細設定
"enabled": true,
"detectInnerHTML": true,
"detectEval": true,
"detectDocumentWrite": false
}
}
}
カスタム重大度レベル
{
"severity": {
"minLevel": "medium",
"custom": {
"sql-injection": "critical",
"xss-innerHTML": "high",
"weak-crypto": "medium"
}
}
}
カスタムパターン
{
"customPatterns": {
"secrets": [
{
"name": "Custom API Key",
"pattern": "custom_api_[0-9a-z]{32}",
"severity": "critical"
}
],
"injection": [
{
"name": "GraphQL Injection",
"pattern": "\\$\\{.*query.*\\}",
"severity": "high"
}
]
}
}
環境変数
スキャナー設定
# 詳細性
export SCANNER_VERBOSE=true
export SCANNER_DEBUG=false
# 出力フォーマット
export SCANNER_OUTPUT=json # json | text | sarif
# 重大度フィルタリング
export SCANNER_MIN_SEVERITY=high
# パフォーマンス
export SCANNER_PARALLEL=true
export SCANNER_MAX_FILES=1000
サンドボックス設定
# Docker設定
export SANDBOX_MEMORY=1g
export SANDBOX_CPU=1.0
export SANDBOX_TIMEOUT=60000
# ネットワーク
export SANDBOX_NETWORK=none
# ツールバージョン
export TRIVY_VERSION=0.50.4
export GITLEAKS_VERSION=8.18.4
MCPサーバー設定
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.jsonを編集:
{
"mcpServers": {
"security-scanner": {
"command": "security-scanner-mcp",
"args": [],
"env": {
"SCANNER_MIN_SEVERITY": "high"
}
}
}
}
Claude Code CLI
claude mcp add --scope project security-scanner \
-- security-scanner-mcp \
--env SCANNER_VERBOSE=true \
--env SCANNER_MIN_SEVERITY=medium
除外パターン
インラインで除外
// security-scanner-ignore
const apiKey = "test_key_for_development";
// security-scanner-ignore-next-line
const query = `SELECT * FROM ${table}`;
/* security-scanner-disable */
const unsafe = eval(userInput);
/* security-scanner-enable */
ファイルレベルで除外
// security-scanner-disable-file
// このファイルはスキャンから除外されます
.securityscannerignore
# テストファイル
*.test.js
*.spec.ts
# 生成されたファイル
**/*.generated.js
# サードパーティ
vendor/**