Skip to content

[RFC-XXXX] Vendor-Agnostic Short-Lived Credentials#5702

Open
matheuscscp wants to merge 2 commits intomainfrom
rfc-creds
Open

[RFC-XXXX] Vendor-Agnostic Short-Lived Credentials#5702
matheuscscp wants to merge 2 commits intomainfrom
rfc-creds

Conversation

@matheuscscp
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp requested a review from a team February 2, 2026 01:41
@matheuscscp matheuscscp added enhancement New feature or request area/security Security related issues and pull requests area/oci OCI related issues and pull requests labels Feb 2, 2026
@matheuscscp matheuscscp force-pushed the rfc-creds branch 4 times, most recently from 87c0172 to e2a8a56 Compare February 2, 2026 02:13
@matheuscscp matheuscscp force-pushed the rfc-creds branch 2 times, most recently from 4adaa54 to 635872b Compare February 2, 2026 13:59
Comment on lines +83 to +84
short-lived credential to use for authentication. The field is mutually exclusive
with `.spec.provider` (when set to a cloud provider) because "provider" conveys
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we provide another CEL rule example for this? Given "mutual exclusivity".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure I follow the suggestion 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the current CEL expression already covers the entire mutual exclusivity, no? 🤔

@matheuscscp matheuscscp force-pushed the rfc-creds branch 2 times, most recently from f9632fd to 792631f Compare February 3, 2026 18:08
@matheuscscp
Copy link
Copy Markdown
Member Author

matheuscscp commented Feb 3, 2026

@hiddeco I fixed the inconsistencies you found around the SPIFFE flags in this diff: https://github.com/fluxcd/flux2/compare/f9632fd9d7c118763ba7bfbd2e88cbe8a9dbf8e3..792631f49699aa8813cc24f2875f3a75fe1a826c

They were an artifact of my late decision to introduce a separate flag for the trust domain.

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
The trust domain for the SPIFFE ID is configured via the controller flag
`--spiffe-trust-domain`. The `iss` claim is set to the controller flag
`--spiffe-issuer`, which third-party services use for OIDC discovery. The
JWT is signed using a private key provided via `--spiffe-secret-name`. Unlike
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we just read this secret every time and let the client decide how long to cache it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't cache secrets in Flux, it's always a live lookup

@matheuscscp
Copy link
Copy Markdown
Member Author

@stefanprodan @hiddeco @stealthybox The last week to work on ServiceAccountToken for Flux 2.8 is the next one, let's try to approve this RFC ASAP 🙏

- **`SpiffeCertificate`**: The controller issues a short-lived SPIFFE SVID
x509 certificate for client authentication via mTLS. The certificate encodes
the same SPIFFE ID as `SpiffeJWT` in the SAN URI field. The certificate is
signed using a CA private key and certificate provided via the controller
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think having to supply CA key as secret will be acceptable to many security teams to be honest..

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All Flux APIs require the CA be specified in a secret.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To be clear, I mean the private key of the CA which as I understand is required for issuance for this proposal to work, not the CA (public) certificate (aka root of trust).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@SpectralHiss As we discussed in our call today, this proposal indeed needs to be clearer and to better frame why we are proposing to provide a CA key to Flux: The idea is replacing the PKI from the Kubernetes ServiceAccount token issuer with one dedicated for Flux. There are two major advantages:

  • This CA would be dedicated for Flux. Only Flux can/should issue short-lived creds with it. This is better than Kube's SA token issuer because there are much less components issuing creds with it: it's just Flux, and not Kube itself (for its own built-in purposes) plus anything else that has the create RBAC verb for the serviceaccounts/token resource in the cluster.
  • Flux can issue identities mapping 1:1 with objects, the identity is the object itself. With Kube SA token issuer we're limited to SAs, which can be reused by different objects.

The justification for this is that Flux is normally the most trusted component in the cluster, deploying absolutely everything inside it, including CNI (e.g. https://timoni.sh/flux-aio/).

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

Labels

area/oci OCI related issues and pull requests area/security Security related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants