Skip to content

fix(x509): support ed25519 keys in the x509 signer - #2133

Open
yuminn-k wants to merge 1 commit into
tektoncd:mainfrom
yuminn-k:chains-1189-ed25519
Open

yuminn-k wants to merge 1 commit into
tektoncd:mainfrom
yuminn-k:chains-1189-ed25519

Conversation

@yuminn-k

Copy link
Copy Markdown

Changes

docs/signing.md says the x509 signer accepts a key of type ed25519 or ecdsa, but x509Signer only accepted *ecdsa.PrivateKey and returned unsupported private key type ed25519.PrivateKey for an ed25519 PKCS8 key.

  • x509Signer now switches on the parsed key type: ECDSA keys load as before, ed25519.PrivateKey loads through signature.LoadED25519SignerVerifier, anything else still returns unsupported private key type.
  • TestSigner_SignED25519 is enabled (the t.Skip is removed). Before the change it failed with unsupported private key type ed25519.PrivateKey, only ECDSA keys are supported; after it passes.
  • TestNewSignerUnsupportedX509KeyType used an ed25519 key as its example of an unsupported key. It now uses a generated RSA PKCS8 key.

Fixes #1189

Scope and risks

  • This covers the x509 signer only. I did not check whether an ed25519 signature can be uploaded to Rekor (hashedrekord) or used by the other signing paths.
  • Open PR [Not to merge] Experiment support for post quantum mldsa65 #1366 ("[Not to merge] Experiment support for post quantum mldsa65") experiments with key-type branching in the same area, so the direction may differ from what the maintainers want there.

AI disclosure

This change was written with Claude (Claude Code). The commit carries an Assisted-by: Claude trailer.

Submitter 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

The x509 signer now accepts ed25519 private keys, as documented in docs/signing.md.

docs/signing.md says the x509 signer accepts ed25519 or ecdsa keys,
but x509Signer only loaded ECDSA keys and rejected ed25519 with an
"unsupported private key type" error. Load ed25519 keys with
signature.LoadED25519SignerVerifier and enable the skipped
TestSigner_SignED25519. The unsupported key type test now uses an RSA key.

Assisted-by: Claude
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: yuminn-k / name: YuMin Kim (c81a761)

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 15, 2026
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.24%. Comparing base (42b7490) to head (c81a761).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2133      +/-   ##
==========================================
- Coverage   80.26%   80.24%   -0.03%     
==========================================
  Files          59       59              
  Lines        3395     3396       +1     
==========================================
  Hits         2725     2725              
- Misses        668      669       +1     
  Partials        2        2              
Flag Coverage Δ
unit-tests 80.24% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anithapriyanatarajan

Copy link
Copy Markdown
Contributor

@yuminn-k Thanks for addressing the mismatch between the documented Ed25519 support and the x509 signer. The changes in this PR require more interoperability proof than unit testing. Hence, Could you add or share end-to-end evidence that the signatures produced by Chains interoperate with Rekor and Cosign?

Further section gives a overview of the different paths followed in chains and includes a box at the end of each path what needs to be verified as please demonstrate:

The key selects the signer; the payload path determines what bytes are signed. This PR loads Ed25519 with LoadED25519SignerVerifier, selecting pure Ed25519. Wrapping provenance as DSSE changes the bytes being signed, not the signer selected by the key.

flowchart TD
  A["ConfigMap selects x509 signer<br/>artifacts.oci.signer: x509<br/>artifacts.taskrun.signer: x509<br/>artifacts.pipelinerun.signer: x509"]
  B["Kubernetes Secret supplies key<br/>signing-secrets / x509.pem"]
  A --> C["Chains loads signer for key type"]
  B --> C
  C --> D["This PR: Ed25519 key selects pure Ed25519 signer"]
  D --> E{Payload format from ConfigMap}

  E -->|OCI image| F["SimpleSigning<br/>artifacts.oci.format: simplesigning"]
  E -->|TaskRun| G["in-toto or SLSA<br/>artifacts.taskrun.format"]
  E -->|PipelineRun| H["in-toto or SLSA<br/>artifacts.pipelinerun.format"]

  F --> I["Sign SimpleSigning payload bytes"]
  G --> J["Wrap provenance as DSSE<br/>then sign the DSSE PAE"]
  H --> J

  I --> K["One transparency setting<br/>transparency.enabled"]
  J --> K

  K -->|false| L["No Rekor upload"]
  K -->|true| M["Upload eligible signatures"]
  K -->|manual| N["Upload only annotated TaskRuns/PipelineRuns<br/>chains.tekton.dev/transparency-upload: true"]
  M --> O{Chains routes by payload format}
  N --> O

  O -->|SimpleSigning| P["cosign.TLogUpload<br/>Rekor hashedrekord"]
  O -->|in-toto or SLSA| Q["cosign.TLogUploadDSSEEnvelope<br/>Rekor DSSE entry"]

  P --> R["Please demonstrate: Rekor accepts the entry<br/>and supported Cosign verifies image and log proof"]
  Q --> S["Please demonstrate: supported Cosign verifies<br/>attestation and log proof"]

  I --> T["Store signed result"]
  J --> T
  T --> U{Storage backend selected in ConfigMap}
  U -->|OCI storage enabled| V{storage.oci.encoding-format}
  U -->|Other backend, e.g. tekton| W["Store in that backend<br/>storage choice does not change signing mode"]
  V -->|dsse default| X["Tag-based OCI layout<br/>.sig and .att"]
  V -->|sigstore-bundle| Y["OCI 1.1 Referrers API<br/>with registry fallback when needed"]
  X --> Z["Please demonstrate: supported Cosign verifies stored result"]
  Y --> Z
Loading

The following ConfigMap settings identify the paths to exercise:

Path ConfigMap setting
Sign OCI image with x509 key artifacts.oci.signer: "x509" and artifacts.oci.format: "simplesigning"
Store OCI image signature in OCI artifacts.oci.storage: "oci"
Sign TaskRun/PipelineRun provenance artifacts.taskrun.signer: "x509" / artifacts.pipelinerun.signer: "x509"; format defaults to "in-toto" and also supports SLSA formats
Store provenance in OCI artifacts.taskrun.storage: "oci" / artifacts.pipelinerun.storage: "oci"
Automatically upload to Rekor transparency.enabled: "true"
Do not upload to Rekor transparency.enabled: "false" (documented default)
Upload manually selected runs transparency.enabled: "manual" plus annotation chains.tekton.dev/transparency-upload: "true"
Use default tag-based OCI layout storage.oci.encoding-format: "dsse" (default)
Use OCI 1.1 Referrers storage.oci.encoding-format: "sigstore-bundle"

The private key itself is supplied in the Kubernetes Secret signing-secrets, under x509.pem; it is not a ConfigMap setting. The tekton backend is a storage choice, not a separate payload or signing mode. The configuration docs, key docs, and OCI encoding docs describe these options.

Could you add or share tests demonstrating these results?

  1. SimpleSigning image with transparency.enabled: "true": Rekor accepts the hashedrekord entry, and the Cosign version Chains supports verifies the image signature and log proof. Rekor’s hashedrekord verifier uses Ed25519ph, so please demonstrate that the signature produced by this change is accepted on this path.
  2. in-toto/SLSA provenance with transparency.enabled: "true": the DSSE entry is accepted, and Cosign verifies the attestation and log proof.
  3. OCI storage: repeat the relevant verification with both storage.oci.encoding-format: "dsse" and "sigstore-bundle". In bundle mode, please verify the signature cryptographically with Cosign, not only that the referrer can be discovered or the bundle has the expected fields.
  4. No transparency upload: if supported, verify the stored signatures with the Cosign version Chains supports.

These are requested passing checks. A direct ed25519.Verify test confirms pure Ed25519 signing, but does not demonstrate the Rekor and Cosign paths above.

Cosign has an open, unreleased PR Cosign PR #5074 exploring whether Ed25519 needs to be handled differently for attestations and image signatures. Since it is not part of a released version, please verify this Chains change directly with the Cosign and Rekor versions Chains supports. Document the findings/caveats.

Also Finally, Ed25519 is not post-quantum and is not approved for CNSA/NSS use. The NSA guidance is scoped to those environments, not a blanket prohibition for all Chains users. A brief documentation caveat would help operators choose according to their policy.

cc: @tektoncd/chains-collaborators

@anithapriyanatarajan anithapriyanatarajan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the interoperability evidences as requried.

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign infernus01 after the PR has been reviewed.
You can assign the PR to them by writing /assign @infernus01 in a comment when ready.

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

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.

panic using ed25519 signing key

3 participants