harrisoncramer / harrisoncramer/ultra

Secrets in env_file bypass leak detection

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2
Forks
1
Avg merge
4m
Merged PRs (30d)
1

Description

Leak detection reads the compose with docker compose config --no-interpolate to tell a hardcoded secret from a forwarded variable. That read does not expand env_file into the environment block, but the interpolated read the config resolver uses does.

The effect is that a secret pasted into an env_file is served by the config resolver as ordinary non-secret config and is invisible to LeakedSecrets, so lint and validate never flag it. Putting secrets in an env_file is itself an anti-pattern, but ultra should still catch it.

A fix likely needs to compare the interpolated and no-interpolate reads, or read the env_file directly, rather than relying on the no-interpolate output alone.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the config resolver and LeakedSecrets path, then compare the outputs of docker compose config --no-interpolate and the interpolated read for an env_file case. Confirm that a secret supplied through env_file is detected by both lint and validate; the fix is done when it is no longer treated as ordinary non-secret config.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.