Skip to content

fix(signing): add writable volume for TUF cache in distroless container#1736

Open
ab-ghosh wants to merge 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/tuf-cache-readonly-filesystem
Open

fix(signing): add writable volume for TUF cache in distroless container#1736
ab-ghosh wants to merge 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/tuf-cache-readonly-filesystem

Conversation

@ab-ghosh

Copy link
Copy Markdown
Member

Changes

When signers.x509.tuf.mirror.url is set to a custom TUF mirror (e.g., one provided by the Trusted Artifact Signer operator), the sigstore TUF library tries to create a cache directory at $HOME/.sigstore/root. In the Chains distroless container, HOME defaults to / (user 65532) and readOnlyRootFilesystem: true is set, causing:

error configuring x509 signer: initialize tuf: creating cached local store: mkdir /.sigstore: read-only file system

This blocks artifact signing when using private sigstore deployments.

Fix: Add an emptyDir volume (sigstore-cache) mounted at /home/nonroot and set HOME=/home/nonroot, giving the TUF client a writable cache location.

The default TUF mirror (https://tuf-repo-cdn.sigstore.dev) is unaffected since it skips TUF initialization entirely (trust root is embedded in the binary).

Testing:

  • Unit test added that reproduces the read-only failure and verifies the fix
  • Manually verified on a kind cluster with a custom TUF mirror URL - confirmed the read-only file system error is gone after the fix

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Fix TUF mirror initialization failure ("mkdir /.sigstore: read-only file system") when using a custom signers.x509.tuf.mirror.url with private sigstore deployments. Added writable emptyDir volume and HOME env var to the controller deployment.

  When signers.x509.tuf.mirror.url is set to a custom TUF mirror,
  the sigstore library tries to create a cache directory at
  $HOME/.sigstore/root. In the Chains distroless container, HOME
  defaults to "/" and readOnlyRootFilesystem is true, causing
  "mkdir /.sigstore: read-only file system" and blocking signing.

  Add an emptyDir volume mounted at /home/nonroot and set HOME to
  point there, giving the TUF client a writable cache location.

Signed-off-by: ab-ghosh <abghosh@redhat.com>
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from ab-ghosh after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 29, 2026
@ab-ghosh

Copy link
Copy Markdown
Member Author

/retest

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

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants