Skip to content

fix(iac): scan the workspace when no path is configured - #169

Merged
tembleking merged 1 commit into
fix/iac-report-collisions-and-labelsfrom
fix/iac-default-path-scans-the-workspace
Aug 5, 2026
Merged

fix(iac): scan the workspace when no path is configured#169
tembleking merged 1 commit into
fix/iac-report-collisions-and-labelsfrom
fix/iac-default-path-scans-the-workspace

Conversation

@tembleking

Copy link
Copy Markdown
Collaborator

Stacked on #168.

A step with no path configured was not scanning the workspace, which is what the README documents and the
only thing that makes sense for a build. Two things went wrong at once, both visible in a real build's console:

$ /…/workspace/iac/bin/sysdig-cli-scanner --iac … --recursive --severity-threshold=high
INF Scanning paths paths=[""]

The step passes its configured path through as is, and an empty string is still an argument, so the .
fallback never applied and the scanner got an empty path. And nothing ever set the process working directory,
so the "current directory" that the empty path (or any relative path, such as the documented
path: 'infrastructure/') resolved against was wherever the agent's JVM happened to be started — for an inbound
agent, its own installation directory.

Blank paths are now dropped before the fallback and the scanner runs in the workspace, so . and relative paths
mean the workspace. The report page also names the workspace as the scan root in that case, since that is what
the module paths in it are relative to; with a path configured nothing changes.

Anyone who had worked around this by pointing path at an absolute directory keeps working — absolute paths are
unaffected. Anyone relying on the old (accidental) behaviour of scanning the agent's own directory will now scan
the workspace instead.

The step hands its configured path straight to the scanner, and that path starts
out empty, so the scanner was invoked with an empty argument instead of falling
back to the current directory — and the current directory was never set either, so
it was whatever directory the agent's JVM happened to sit in. A default-configured
step therefore walked something that has nothing to do with the build, which is
also not what the README documents; verified from a real build's console:
`Scanning paths paths=[""]` with no working directory in the launched command.

Blank paths are now dropped before the fallback, and the process runs in the
workspace, so both the default and any relative path mean what they say. The
report also names the workspace when no path is configured, since that is the root
its module paths are relative to.
@tembleking
tembleking force-pushed the fix/iac-default-path-scans-the-workspace branch from 4559808 to c2b6e00 Compare August 5, 2026 08:09
@tembleking
tembleking merged commit 22c7797 into main Aug 5, 2026
21 checks passed
@tembleking
tembleking deleted the fix/iac-default-path-scans-the-workspace branch August 5, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants