Files
gosec/examples/gosec-with-exclude-rules.json
T
Ravi Sastry Kadali 9f202122a7 feat: support path-based rule exclusions via exclude-rules (#1465)
* add path-based rule exclusions

Implements #1287

* Ssupport for excluding specific rules from specific paths, enabling large monorepos to apply different security rules to different components (e.g., CLI tools vs services).

* fix formatting issuue with path filter test to pass gci
2026-01-15 11:59:43 +01:00

37 lines
706 B
JSON

{
"global": {
"audit": false,
"nosec": false,
"show-ignored": false
},
"G101": {
"pattern": "(?i)passwd|pass|password|pwd|secret|private_key|token|api_key",
"ignore_entropy": false,
"entropy_threshold": "80.0",
"per_char_threshold": "3.0",
"truncate": "32"
},
"exclude-rules": [
{
"path": "cmd/.*",
"rules": ["G204", "G304"]
},
{
"path": "internal/testutil/.*",
"rules": ["G101", "G401", "G501"]
},
{
"path": "scripts/.*",
"rules": ["*"]
},
{
"path": ".*_test\\.go$",
"rules": ["G101", "G304"]
},
{
"path": "internal/(mock|fake|stub)s?/.*",
"rules": ["*"]
}
]
}