Skip to content

Commit 83d3801

Browse files
authored
fix: support TruffleHog exclude patterns (#94)
* fix: handle trufflehog exclude paths * fix: use absolute trufflehog scan targets * fix: complete trufflehog exclude handling * docs: clarify trufflehog exclude fix * fix: support trufflehog exclude globs * fix: complete trufflehog exclusions for v2.2.1 Signed-off-by: lelia <2418071+lelia@users.noreply.github.com> * fix(trufflehog): Address review feedback Signed-off-by: lelia <2418071+lelia@users.noreply.github.com> --------- Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 0d3f141 commit 83d3801

10 files changed

Lines changed: 737 additions & 108 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
88

99
## [Unreleased]
1010

11+
## [2.2.1] - 2026-07-30
12+
13+
### Fixed
14+
15+
- Fixed TruffleHog secret scanning when `trufflehog_exclude_dir` is configured:
16+
all entries now pass through one filter file and are honored for changed-file
17+
and explicit-file scans. Previously, configured values could be interpreted
18+
as filter filenames and fail or alter scans.
19+
- Added glob-pattern support for exclusions such as
20+
`**/appsettings.*.json`, with matching anchored beneath the workspace and
21+
root-relative globs kept distinct from recursive `**` globs.
22+
- Normalized exclusion entries before pattern generation so dot segments and
23+
repeated path separators behave consistently.
24+
- Fixed exclusion matching when the configured workspace is the filesystem root.
25+
- Normalized in-workspace TruffleHog finding paths relative to the workspace so
26+
host paths do not appear in facts and component identifiers remain stable
27+
across runs, working directories, and operating systems.
28+
1129
## [2.2.0] - 2026-07-29
1230

1331
### Added

‎action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "Socket"
44

55
runs:
66
using: "docker"
7-
image: "docker://ghcr.io/socketdev/socket-basics:2.2.0"
7+
image: "docker://ghcr.io/socketdev/socket-basics:2.2.1"
88
env:
99
# Core GitHub variables (these are automatically available, but we explicitly pass GITHUB_TOKEN)
1010
GITHUB_TOKEN: ${{ inputs.github_token }}
@@ -428,7 +428,7 @@ inputs:
428428
required: false
429429
default: "false"
430430
trufflehog_exclude_dir:
431-
description: "Comma-separated list of directories to exclude from secret scanning"
431+
description: "Comma-separated literal directory/file names or glob patterns to exclude from secret scanning beneath the workspace root; matching is case-sensitive"
432432
required: false
433433
default: ""
434434
trufflehog_show_unverified:

‎docs/parameters.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ socket-basics --disable-secrets
321321
```
322322

323323
### `--exclude-dir EXCLUDE_DIR`
324-
Comma-separated list of directories to exclude from secret scanning.
324+
Comma-separated literal directory/file names or glob patterns to exclude from
325+
secret scanning beneath the workspace root. Matching is case-sensitive. For
326+
example, `**/appsettings.*.json` matches files at any directory depth.
325327

326328
**Example:**
327329
```bash

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "socket_basics"
3-
version = "2.2.0"
3+
version = "2.2.1"
44
description = "Socket Basics with integrated SAST, secret scanning, and container analysis"
55
readme = "README.md"
66
requires-python = ">=3.10"

‎socket_basics/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .socket_basics import SecurityScanner, main
1313
from .core.config import load_config_from_env, Config
1414

15-
__version__ = "2.2.0"
15+
__version__ = "2.2.1"
1616
__author__ = "Socket.dev"
1717
__email__ = "support@socket.dev"
1818

‎socket_basics/connectors.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ connectors:
406406
- trufflehog_show_unverified
407407
- name: trufflehog_exclude_dir
408408
option: --exclude-dir
409-
description: "Comma-separated list of directories to exclude from secret scanning"
409+
description: "Comma-separated literal directory/file names or glob patterns to exclude from secret scanning beneath the workspace root; matching is case-sensitive"
410410
env_variable: INPUT_TRUFFLEHOG_EXCLUDE_DIR
411411
type: str
412412
default: ""

0 commit comments

Comments
 (0)