Skip to content

fix: random secret names for registry and MinIO credentials - #417

Merged
patrick-hermann-sva merged 1 commit into
mainfrom
fix/random-secret-names
Oct 7, 2026
Merged

patrick-hermann-sva merged 1 commit into
mainfrom
fix/random-secret-names

Conversation

@patrick-hermann-sva

Copy link
Copy Markdown
Contributor

Follow-up to #403, same finding as #411 (point 1, sops set).

Problem

#403 named the secrets after an unsalted SHA-256 prefix of their content:

Where Name Content
crossplane / helm / oci / flux push.go docker-config-<sha256(config.json)[:8]> base64 user:token
hugo export.go mc-host-<sha256(url)[:8]> https://<access key>:<secret key>@<endpoint>

Secret names are not secret: they show up in --progress plain and in traces (Dagger Cloud). Someone who knows the username and endpoint can confirm a guessed password offline against the hash prefix. For long GitHub PATs that's practically impossible; for weak MinIO keys it isn't.

Fix

The names are now crypto/rand.Text() per call (Go ≥ 1.24, 26 random base32 characters, cannot fail). No more sha256/hex in these files.

Side effect: a new secret ID per call means push/export are never served from the Dagger cache either. That's correct for side-effecting operations.

The only other SetSecret without random naming in the repo is ansible/execute.go, which uses the environment variable's name, not something derived from the value.

Verified

  • dagger develop + go vet: crossplane, helm, oci, flux, hugo
  • oci push-artifact --password env:FAKEPW --progress plain against ghcr.io, run twice:
    • the name appears in the log, so the concern is real: docker-config-KZ73L6DPGBL7LNC5EVLUXEXAL7, then docker-config-WKI3EVINUOA6PW7VYKI2IQ55WT, i.e. different per call
    • password and base64 credential: 0 hits
    • the registry still answers DENIED, so the credentials still arrive
  • hugo export not tested end to end (no MinIO available), same as fix: keep registry and git credentials out of --progress plain #403

🤖 Generated with Claude Code

#403 named the docker config secret (crossplane, helm, oci, flux push)
and the mc host secret (hugo export) after a SHA-256 prefix of their
content. Secret names are not secret: they show up in --progress plain
output and in traces. An unsalted hash of the base64 user:token, or of
https://<access key>:<secret key>@<endpoint>, lets a guessed credential
be confirmed offline. Same finding as #411 for sops set.

The names are now crypto/rand.Text() per call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrick-hermann-sva
patrick-hermann-sva merged commit 172bc68 into main Oct 7, 2026
9 checks passed
@patrick-hermann-sva
patrick-hermann-sva deleted the fix/random-secret-names branch October 7, 2026 14:10
github-actions Bot pushed a commit that referenced this pull request Oct 7, 2026
## [0.137.3](v0.137.2...v0.137.3) (2026-10-07)

### Bug Fixes

* random secret names for registry and MinIO credentials ([#417](#417)) ([172bc68](172bc68)), closes [#403](#403) [#411](#411)
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.137.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

patrick-hermann-sva added a commit to stuttgart-things/blueprints that referenced this pull request Oct 7, 2026
…s) (#227)

dagger v0.137.3 (stuttgart-things/dagger#417) names the registry docker
config secret and the MinIO mc host secret randomly per call instead of
after a SHA-256 prefix of the credential. The names show up in
--progress plain output and traces, and an unsalted hash lets a guessed
credential be confirmed offline. Between v0.136.2 and v0.137.3 these
three modules changed only by #417.

- helm: flux, helm, kubernetes-microservice
- crossplane: crossplane-configuration
- hugo: presentations

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot pushed a commit to stuttgart-things/blueprints that referenced this pull request Oct 7, 2026
## [3.11.1](v3.11.0...v3.11.1) (2026-10-07)

### Bug Fixes

* bump dagger helm/crossplane/hugo to v0.137.3 (random secret names) ([#227](#227)) ([bebc3df](bebc3df)), closes [stuttgart-things/dagger#417](stuttgart-things/dagger#417)

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant