Category: Technology

SPIFFE: Who Is Allowed to Become Agent XYZ? Attestation and Identity Issuance

The first security question is not whether a certificate or token can be verified. It is whether the system should have issued that identity in the first place. An attacker who satisfies an overly broad issuance policy can receive authentic credentials; signature verification will then work exactly as designed.

Node evidence and workload evidence are separate

SPIRE uses node attestation to establish an agent’s eligibility and workload attestation to determine the identities available to local callers. Registration entries associate a SPIFFE ID with selectors and a parent identity. Agents obtain relevant entries and compare caller evidence with them.

For architecture review, identify the evidence producer, the administrator able to influence it, and the verifier relying on it. A cloud instance identity, a Kubernetes service-account assignment, and a local process UID have different provenance and compromise assumptions. Do not treat three labels derived from one mutable source as three independent factors.

An illustrative registration policy

identity: spiffe://agents.example.org/agent/xyz
parent: <eligible attested node or node group>
required workload evidence:
namespace: agents-prod
service_account: agent-xyz
credential lifetime: <reviewed deployment setting

Namespace and service-account evidence can be useful, but ask who can create a pod using that account. If a developer can choose the privileged account while creating an arbitrary pod, the selectors alone do not distinguish the intended workload from the developer’s replacement. Add controls at the deployment boundary: reviewed manifests, admission policy, appropriately scoped RBAC, and protected automation identities. These are complementary infrastructure controls, not properties supplied by SPIRE.

Evidence or control Who may influence it? Review question
Namespace/service-account assignment Pod creators and deployment automation Can an unrelated workload use XYZ’s account?
Unix process UID Host administrators and privileged processes Can the attacker execute as that UID?
Registration entry SPIRE registration administrators/controllers Can a broad entry issue privileged identities?
Node enrollment Infrastructure and attestation administrators Can an unauthorized node become eligible?
Workload API access Host/container isolation administrators Can another process obtain or steal the credential?

 

Choose the identity boundary deliberately

A SPIFFE ID often represents a service or deployment with many replicas. It is not necessarily a unique process-instance identifier. A single orchestrator running multiple logical agents with shared credentials does not create independently attested identities merely by assigning different agent names. Use isolated workloads and distinct policies where separate security principals are required. Preserve execution IDs as audit metadata rather than presenting them as attestation evidence. The Workload API identifies local callers under its implementation’s security boundary.

Attestation establishes eligibility under configured evidence rules; it is not a behavioral verdict. Prompt injection, malicious dependencies, or compromised application logic may all exist inside an eligible workload. Credential theft and local isolation also remain in the threat model.

Configuration-review checklist

  • Enumerate every registration entry that can issue XYZ’s identity, including controller-generated entries.
  • Map every selector to its evidence source and modification privileges.
  • Test an unauthorized workload that intentionally resembles XYZ.
  • Document whether replicas share an identity and how individual runs are correlated.
  • Separate registration administration from ordinary application deployment wherever practical.
  • Require review of broad selector changes and retain a recoverable history of issuance policy.

Takeaway: issuance policy is an authorization boundary. Reviewing the SPIFFE ID string without reviewing who can satisfy its evidence is an incomplete security review.

SPIFFE: Giving Software an Identity It Can Prove

A service connecting to another service needs to answer a deceptively difficult question: what is the caller, and why should I believe it?

SPIFFE and SPIRE address that question with cryptographically verifiable workload identities, issued at runtime rather than provisioned as long-lived application secrets. SPIFFE defines the identity standards and interfaces; SPIRE implements the attestation, issuance, and rotation machinery. Together, they provide an identity layer that can operate across heterogeneous infrastructure.

Why this exists: the bootstrap problem

Consider an application retrieving a database password from a secrets manager. Moving the password out of a configuration file is useful, but the application still needs to authenticate to the secrets manager. Where does that initial credential come from?

This is the secret-zero problem: protecting a credential often requires another credential. SPIRE approaches it through secure introduction—using evidence about the workload and its execution environment to determine which identity it may receive. It is not a secrets manager; its identities can instead authenticate workloads to a secrets manager.

The same identity machinery supports service-to-service authentication. SPIRE delivers short-lived, automatically rotated credentials suitable for mutual TLS, either directly to applications or to proxies acting on their behalf. The objective is not to invent a replacement for TLS, but to automate the trustworthy introduction and credential lifecycle that TLS requires.

SPIFFE is the contract; SPIRE is the machinery

SPIFFE, the Secure Production Identity Framework for Everyone, defines standards for workload identifiers, verifiable identity documents, trust material, and APIs through which workloads obtain and use their identities. SPIRE, the SPIFFE Runtime Environment, is a reference implementation that adds node and workload attestation, identity registration, signing, and credential renewal. Other implementations can participate in the SPIFFE ecosystem; SPIFFE and SPIRE are not interchangeable names.

The central concepts are straightforward, but their security implications matter.

SPIFFE ID: the name, not the credential

A SPIFFE ID is a URI:

spiffe://prod.example.org/payments/settlement-api

Here, prod.example.org is the trust domain, and /payments/settlement-api identifies the workload within it. The identifier is not secret and does not prove identity by itself. Proof comes from a verifiable document carrying that identifier.

A trust domain establishes an identity authority boundary. Its name resembles a DNS name but need not resolve through DNS. An organization might use separate trust domains for independently administered environments rather than treating every cluster as part of one authority.

SVID: the verifiable credential

A SPIFFE Verifiable Identity Document, or SVID, carries the SPIFFE ID in a cryptographically verifiable form. Two foundational formats are X.509-SVIDs and JWT-SVIDs.

An X.509-SVID is a constrained X.509 certificate. Its SPIFFE ID appears in the Subject Alternative Name extension as a URI SAN; the specification requires exactly one URI SAN. In an mTLS deployment, the certificate identifies the workload, while possession of the corresponding private key supplies the cryptographic proof during authentication.

A JWT-SVID supports token-based authentication, particularly across application-layer boundaries. Unlike certificate-based TLS authentication, a JWT-SVID is a bearer credential: a recipient can potentially replay it to another service accepting its audience. Audience restrictions limit that exposure but do not turn it into proof-of-possession authentication.

Trust bundle: the verification material

A workload also needs the public trust material required to verify its peers. SPIFFE distributes this through trust bundles, containing the relevant certificates or public keys for an issuing trust domain. A bundle is verification material—not a collection of workload private keys.

Workload API: the local delivery interface

The SPIFFE Workload API is a protobuf-defined gRPC interface through which workloads retrieve credentials and trust material. Crucially, the workload does not need to present a pre-provisioned application secret to use it. The implementation must identify the caller; SPIRE does so using local workload attestation, including inspection of operating-system metadata.

That distinction is fundamental: reaching the API is not equivalent to being entitled to an arbitrary identity.

How SPIRE turns evidence into identity

A conventional SPIRE deployment has two principal components:

  • SPIRE Server: maintains identity registration policy and signs SVIDs.
  • SPIRE Agent: runs on workload nodes, attests local callers, and exposes the Workload API.

The server is the identity authority; the agent is a trusted intermediary between that authority and local workloads. SPIRE can operate its own certificate authority or integrate with an upstream authority.

The resulting flow separates two different questions.

  1. Node attestation: may this agent participate?

First, the agent proves its node identity to the server using a configured node-attestation mechanism. The server must establish trust in the agent before relying on its statements about local workloads. Node-attestor plugins allow this introduction to use evidence appropriate to the hosting environment.

This does not eliminate bootstrap trust. It relocates it into the attestation mechanism and the infrastructure supplying its evidence.

  1. Registration: which evidence permits which identity?

The server stores registration entries mapping:

  • A SPIFFE ID.
  • One or more selectors describing eligible workloads.
  • A parent ID establishing the relevant identity relationship.

The server distributes applicable entries to agents, which cache and update them. During workload attestation, an agent compares discovered selectors against those entries to determine which identities the caller may receive.

An illustrative policy might express:

Identity:

spiffe://prod.example.org/payments/settlement-api

Required evidence:

Kubernetes namespace = payments

Kubernetes service account = settlement-api

Placement:

Eligible attested nodes

This is an issuance policy, not an assertion the application makes about itself. Available selectors depend on the configured workload-attestor plugins, and multiple attestation strategies can contribute evidence for one workload.

  1. Workload attestation: what is this local caller?

When a workload contacts the agent, the agent establishes facts about the calling process and its environment. It matches that evidence to registration policy and returns the identities the workload is entitled to use—not merely the identity it requests.

The architectural sequence is:

Node evidence → trusted agent

Local caller evidence → matching registration policy

Matching policy → workload SVID and trust material

The agent obtains and caches SVIDs from the server, exposing the appropriate material locally to eligible workloads. Credential issuance therefore does not require every application to implement its own enrollment protocol against a central CA.

  1. Authentication: prove identity to a peer

For mTLS, workloads use their X.509-SVIDs and private keys to authenticate a connection and use trust bundles to validate the peer. Applications can integrate directly, or Envoy can obtain credentials through SPIRE’s Secret Discovery Service integration. SPIRE streams rotated material to Envoy, which applies it to new connections.

But a trusted certificate is only the beginning of an access decision.

A settlement API may accept credentials issued by the production trust domain while permitting requests only from a particular caller identity. Authentication establishes who is calling; authorization decides what that identity may do. SPIRE supplies the former, while application logic or a policy engine such as OPA supplies the latter.

Federation: recognize another authority without merging it

SPIFFE federation allows workloads to validate identities issued in another trust domain by securely obtaining that domain’s trust bundle. Each domain retains its identity authority; federation does not require sharing private signing keys or collapsing the domains into one namespace.

A useful security interpretation is:

Federation makes another domain’s identities verifiable. Authorization determines which of those identities are acceptable.

Consequently, bundle authenticity and the binding between a trust domain and its bundle are security-critical. Trusting the wrong bundle means trusting the wrong issuer.

What security teams should scrutinize

The following are architectural implications of the attestation and credential model—not properties that deploying SPIRE automatically guarantees:

  • Selector governance is credential-issuance governance. If an attacker can arrange for a workload to satisfy privileged registration selectors, the identity system may issue that privileged identity correctly according to its policy. Review who controls the underlying attributes, not just the selector syntax.
  • Attestation does not guarantee integrity. Matching execution-environment evidence establishes eligibility under policy; it does not demonstrate that the application is uncompromised.
  • Workload isolation remains essential. SPIFFE explicitly assumes sufficient isolation to prevent one workload from stealing another’s issued credentials. The standard does not supply that isolation.
  • Rotation is not containment. Short-lived credentials reduce the useful lifetime of stolen material, but an attacker retaining control of an eligible workload can potentially obtain replacements. Credential lifecycle controls must accompany workload remediation.
  • The identity plane is privileged infrastructure. Servers sign identities, agents determine local eligibility, and bundles establish verification trust. Their protection belongs in the authentication threat model.

The takeaway

SPIFFE standardizes how software names and proves its identity. SPIRE operationalizes that model by connecting infrastructure evidence to issuance policy and continuously delivering usable credentials. Its value is not simply “automatic certificates”; it is a consistent, attestable identity foundation for service authentication and secure introduction.

SPIFFE

I’ve been working on a mechanism that allows agents—and other workloads—to identify themselves without relying on long-lived application secrets. My earlier proposal for workload-managed credentials with very short lifetimes never gained traction. Our existing OAuth client-secret approach establishes that a caller possesses the secret associated with a registered client, but that is not the same as establishing which running workload is presenting it. Rotation is operationally awkward in our environment, and a copied secret can be presented from somewhere other than its intended deployment.

So I’m setting up SPIFFE (Secure Production Identity Framework For Everyone) using SPIRE (SPIFFE Runtime Environment). SPIFFE defines workload identities and their verifiable credentials; SPIRE supplies the server and node-local agents that establish eligibility and issue those credentials. It is better understood as an attestation-based identity issuance system than as a proxy for certificate authentication.

There are two distinct trust decisions. First, the SPIRE server establishes the identity of the node’s agent through node attestation. In my configuration (x509pop), this is a machine certificate. There are, however, many other options. I used a jointoken to set up an initial sandbox, k8s_psat is ideal in a Kubernetes environment, and I could see using Azure/AWS/GCE for machines hosted in one of those environments.

Mechanism What the agent presents Typical fit
aws_iid AWS EC2 instance identity evidence, verified against AWS Agents running on EC2
gcp_iit Google Compute Engine instance identity evidence, verified using GCP APIs Agents running on GCE
azure_imds Azure instance metadata/identity evidence Agents running on Azure VMs
azure_msi A signed token obtained through Azure Managed Service Identity Azure nodes with managed identity enabled
k8s_psat A Kubernetes projected service-account token, verified by the server against the Kubernetes cluster Agents running in Kubernetes; the plugin specifically attests nodes inside Kubernetes
x509pop A provisioned X.509 certificate plus proof of possession of its private key Environments with an existing certificate-provisioning or machine-PKI process.
sshpop SSH host-identity evidence plus proof of possession of the associated private key Environments that provision and manage SSH host certificates/keys
tpm_devid TPM-backed device identity evidence Hardware-backed node identity where compatible TPMs are available
jointoken A pre-provisioned, one-time join token Bootstrap or environments where cloud/hardware attestation isn’t available; the token itself must be provisioned and protected
http_challenge A challenge/response that checks the agent is reachable at a valid DNS name Specific DNS-reachable deployments; it is not equivalent to hardware-backed instance identity

Second, when an application connects to the agent’s local Workload API, the agent establishes facts about the calling workload. Depending on the configured attestors, those facts can include its Unix UID, systemd unit, or Kubernetes namespace and service account. Registration policy determines which SPIFFE identity those facts entitle the workload to receive. The application does not simply say “I am Agent XYZ” and get XYZ’s credentials.

Access to the Workload API socket is therefore necessary in this local integration, but not sufficient: the calling process must also satisfy the identity’s registration policy. The important boundary is which workload may obtain the credential, rather than possession of a pre-provisioned application secret.

There is an important limitation: attestation controls issuance, not every subsequent use. If an attacker steals an issued certificate and its private key—or a bearer JWT-SVID—the credential can potentially be used outside the original workload until it expires. Workload isolation, credential protection, audience restrictions, and downstream authorization remain essential. SPIFFE reduces reliance on long-lived secrets; it does not make credential theft impossible.

 

Term Meaning in this context
SPIFFE ID Workload identifier; not a secret or credential by itself.
SVID SPIFFE Verifiable Identity Document: a cryptographically verifiable identity document carrying a SPIFFE identity.
JWT-SVID SPIFFE JWT identity document with intended audience; not universally an OAuth access token.
SPIRE Workload identity implementation providing attestation and issuance.
STS Security Token Service: validating evidence and issuing tokens under policy.
Subject Principal whose authority is represented by the token.
Actor Party exercising delegated authority; current actor is the outer act.
OAuth client Client registration/authentication identity, distinct from subject and actor.
Delegation grant Protected application approval/authorization context; implementation-specific.
Audience Intended recipient context enforced by the agreed token profile.
Sender constraint Token use requires possession of an associated presenting key.
Revocation window Measured delay before every relevant enforcement point denies authority.

Token Usage Efficiency

Whenever I hear people start to talk about efficient token usage — the same people who, a year ago, were USE IT, USE IT, USE IT!!!! Don’t think about where AI is appropriate and where it isn’t! who are now decreeing that all AI usage should be well thought out to see if it even needs AI, done in the most efficient manner possible, etc — I think about early mobile phones. Specifically the big bag that went in a car. I knew so many people who got one and would call from the driveway or garage to say “hey, honey, guess where I’m calling from!” Which was less funny the nineteenth time the answer was “just pulled into the driveway” or “the garage!!!”.

And then they got their first bill. Now, folks buying the bag phone generally weren’t ruined by a one-off thousand dollar airtime bill. But they were shocked by it (and stopped calling from the garage).

The past year has been the “guess where I’m calling from!” Stage of AI. And I think someone just saw the bill!

I think being able to determine where a probabalistic agent (i.e.. AI) provide value v/s where a deterministic agent (i.e. cron’d up script) is sufficient will be the high value skill of the next few years. An example we used to use in programming class — the question is “2+3”. Writing 5 is the “scored 100%” answer. You were never asked to write a program. Now, if someone writes a program (which is an inefficient way to solve the problem) and takes user input … they’ll get a good score too. Hard code the 2 and 3 at the top as variables used subsequently (i.e. identify the probability that the next time this code is used, you may want to add 7 and 284), that’s OK too.

The guy who writes this? 75% – mediocre work.

#include <iostream>
int main() {
     std::cout << 2 + 3 << '\n';
     return 0;
}

Well, maybe lower for failure to document the code. I’ve been asking an analogous question about AI since it first hit mainstream. The Ducks, Google, etc all have AI enhanced answers to web searches. Sometimes it’s enlightening, enriching, and useful … but it’s often the high resource approach to answering a straight forward question. It would make a lot more sense to have the “enhance your answer with AI!!!” button at the top and only incur the usage when the top couple of web results don’t already answer the question.

Does it make sense to have an AI agent generate a weekly report? No! Ask for a script that will generate the report (a one-time expense) and schedule execution of that script. The results don’t change (well, if the source data changes the script may need to be updated to continue working). Does it make sense to have an AI count the number of times “ThisString” occurs in your spreadsheet data? No! Use countif() and the spreadsheet can do this for you.

Java cacerts From OS Trust Bundle

One of the vexing things about Java is that it uses its own cacerts trust store when the OS has its own updated and configurable trust store. In Windows, there’s a solution. Add a flag to set a system property

-Djavax.net.ssl.trustStoreType=Windows-ROOT

Linux folks? There actually is a way to use the OS trust store. It’s just not so clear and easy. There is a package which uses the system CA store as the source of truth and creates a hook to regenerate the JDK’s cacerts from it whenever the system bundle is rebuilt. The JDK’s cacerts path is a symlink into the generated file, so Java reads whatever the last rebuild produced. Nothing syncs continuously. The sync happens only when the rebuild command runs.

Debian/Ubuntu

  • Source: /usr/local/share/ca-certificates/*.crt (your additions) plus the packaged roots in /usr/share/ca-certificates/.
  • Rebuild: update-ca-certificates combines these into /etc/ssl/certs/ca-certificates.crt and runs the hooks in /etc/ca-certificates/update.d/.
  • Java hook: the ca-certificates-java package installs a hook that uses the JDK’s keytool to build /etc/ssl/certs/java/cacerts from the system bundle.
  • Link: the JDK’s lib/security/cacerts is managed by update-alternatives and points to /etc/ssl/certs/java/cacerts.
  • Triggers: running update-ca-certificates (manually, or by package install/upgrade or your config management), and installing or upgrading ca-certificates-java.

RHEL/Fedora/CentOS

  • Source: /etc/pki/ca-trust/source/anchors/ (your additions), plus vendor anchors in /usr/share/pki/ca-trust-source/.
  • Rebuild: update-ca-trust extract uses p11-kit to generate bundles under /etc/pki/ca-trust/extracted/, including a java/cacerts file.
  • Link: /etc/pki/java/cacerts points to the generated extracted/java/cacerts, and the JDK’s cacerts links to that.
  • Triggers: running update-ca-trust (manually, or by RPM scriptlets when the ca-certificates package updates).

Flatpak – Escaping the Sandbox

We’ve been running Cura from a flatpak because the rpm distributed version was out of date. The big drawback, though, is that this flatpak could not see the files from network mounts. The mount is fine – in fstab, same user account can interact with those files in other applications. Just not this flatpak thing.

Turns out that’s normal – flatpaks operate in a sort of sandbox. You just have to tell it to let an individual flatpak access the location where the network mounts are. In this case, the /mnt path:

flatpack override com.ultimaker.cura --filesystem=/mnt

MiniPlasma Mitigation

Microsoft Windows Cloud Files Mini Filter Driver Elevation of Privilege Vulnerability (alternately referred to as MiniPlasma) is one of those findings that is a little confusing. The vulnerability appears tied to an issue Microsoft originally addressed in 2020, which raises the obvious question: if it was already patched, why is it relevant again now?

The original fix may have closed a specific exploitation path without fully eliminating the underlying bug class. The remediation may have been incomplete. Or a later code change may have reintroduced a previously fixed condition. Without updated vendor detail, it is hard to say exactly which of those happened; but the operational conclusion is the same: a system can still be exposed today even if the original 2020 patch was installed.

For environments looking for a practical mitigation, the good news is that many servers do not need Windows Cloud Files functionality at all. The vulnerable component is the Cloud Files Mini Filter Driver (CldFlt), which supports placeholder and hydration behavior used by features such as OneDrive Files On-Demand and other CfAPI-based integrations.

That makes CldFlt a viable mitigation target. If the filter is loaded but not attached to any volumes, there is a good chance it can be safely unloaded and disabled. This does not remove the driver from disk, but it does remove the active kernel attack surface associated with the running minifilter. Since this is an elevation-of-privilege issue, that distinction matters: the goal is not to claim the file no longer exists, but to prevent the vulnerable driver from being active in the system.

The following process checks whether any volumes are associated with CldFlt, temporarily unloads the filter, verifies that the system continues functioning normally, and then disables the driver persistently.

REM Check instances on CldFlt — if 0, proceed with testing disablement
fltmc filters

REM Example output:
REM Filter Name Num Instances Altitude Frame
REM —————————— ————- ———— —–
REM bindflt 0 409800 0
REM MsSecFlt 9 385600 0
REM CSAgent 9 321410.78870 0
REM storqosflt 0 244000 0
REM wcifs 0 189900 0
REM CldFlt 0 180451 0
REM FileCrypt 0 141100 0
REM UnionFS 0 130850 0
REM npsvctrig 1 46000 0
REM Wof 1 40700 0

REM Unload cldflt
fltmc unload cldflt

REM Verify stopped
sc query cldflt

REM Verify no longer in filters list
fltmc filters

REM Verify applications and expected file operations still work normally
REM If everything looks good, disable persistent startup
sc config cldflt start= disabled

Fedora 43 to 44 upgrade: dnf5 plugin load failure after upgrade

After completing an in-place upgrade from Fedora 43 to Fedora 44, dnf5 failed to run with this error:

[lisa@fedora05 ~]# dnf5 update
Cannot load dnf5 plugin: /usr/lib64/dnf5/plugins/automatic_cmd_plugin.so
Cannot load shared library “/usr/lib64/dnf5/plugins/automatic_cmd_plugin.so”: libdnf5-cli.so.2: cannot open shared object file: No such file or directory

What happened

The Fedora 44 upgrade completed, and the installed dnf5 packages were all current Fedora 44 versions. However, there was a leftover plugin file still sitting in /usr/lib64/dnf5/plugins/automatic_cmd_plugin.so.

That file was not owned by any RPM package and had been built against an older library, libdnf5-cli.so.2.

But Fedora 44 had /usr/lib64/libdnf5-cli.so.3.

dnf5 was trying to load a stale plugin from before the upgrade.

How I verified it

These commands showed the problem:

ls -l /usr/lib64/libdnf5-cli.so*
rpm -qf /usr/lib64/dnf5/plugins/automatic_cmd_plugin.so
ldd /usr/lib64/dnf5/plugins/automatic_cmd_plugin.so

Results:

  • libdnf5-cli.so.3 existed
  • automatic_cmd_plugin.so was not owned by any package
  • ldd showed it was looking for libdnf5-cli.so.2

Fix

Remove the orphaned plugin file:

rm /usr/lib64/dnf5/plugins/automatic_cmd_plugin.so
ldconfig
dnf5 update

After deleting the stale plugin, dnf5 worked normally again.

Root cause

This appears to be a leftover orphaned dnf5 plugin from before the major version upgrade. Even though the main dnf5 and libdnf5 packages were updated correctly, dnf5 still tried to load the old .so file it found in the plugins directory.

Kafbat – OAUTH With RBAC

I encountered a challenge with a Kafka management tool — it supports SSO, and I was able to get an OAUTH connection set up to control what users could see when logging in through the UI, but the API component didn’t extract information from the bearer token and there was nothing in the rbac mapping to allow the bearer-token client ID to access anything.

Updates to allow the /api components to be authenticated by simple bearer tokens and a client ID mapped into a role are at https://github.com/ljr55555/kafka-ui

AuthorizationController.java was updated to properly support non-browser, machine-principal auth.

Added/fixed:

  • avoids null failure when authentication.getName() is missing
  • resolves principal name from alternate attributes such as:
    • client_id
    • sub
    • username
  • updated displayed permissions logic so /api/authorization uses the same effective RBAC matching idea as the backend

Result

/api/authorization now works for bearer-token API callers and shows:

  • username = client ID
  • populated permissions list

AccessControlService.java

Added support for API bearer-token principals

Previously, getUser() only worked when the authenticated principal was a RbacUser, which covered the browser/user flow.

Now it can also derive an AuthenticatedUser from opaque-token authenticated principals by extracting:

  • principal name
  • group-like values from attributes/authorities if present

Updated role matching logic

Previously, role matching was only role name matches one of user.groups(). Now it also supports role name matches user.principal(). That enables RBAC binding directly to the API client ID.

Result

RBAC now works for:

  • normal browser users via groups
  • API bearer-token callers via client principal name

DynamicConfigMapper.java

Fixed a mapper bug.

Before

The method mapping resource server config created a populated OAuth2ResourceServerProperties result object but always returned null.

After

It now returns result.

Result

Dynamic/config mapping for resource-server settings no longer silently discards the mapped object.

Build/package note

To preserve the browser UI, the jar needs to be built with frontend included — which you know if you read the doc … or you take my route, start it all up, test the API successfully, and then get baffled that the user UI throws


        bash./gradlew clean assemble -Pinclude-frontend=true

application.yml

server:
  port: 8443
  ssl:
    enabled: true
    key-store: file:/etc/kafkaui/certs/kafbat.rushworth.us.p12
    key-store-password: ${KEYSTORE_PASSWORD}
    key-store-type: PKCS12
    key-alias: kafbat

auth:
  type: OAUTH2
  oauth2:
    client:
      pingfed:
        client-id: ${OAUTH_CLIENT_ID}
        client-secret: ${OAUTH_CLIENT_SECRET}
        scope:
          - openid
          - profile
          - email
        client-name: oauthclient
        provider: oauthclient
        redirect-uri: https://kafbat.rushworth.us:8443/login/oauth2/code/oauthclient
        authorization-grant-type: authorization_code
        issuer-uri: https://login.example.com
        jwk-set-uri: https://login.example.com/pf/JWKS
        authorization-uri: https://login.example.com/as/authorization.oauth2
        token-uri: https://login.example.com/as/token.oauth2
        user-info-uri: https://login.example.com/idp/userinfo.openid
        user-name-attribute: username
        custom-params:
          type: oauth
          roles-field: memberOf

    resource-server:
      opaque-token:
        client-id: ${OAUTH_CLIENT_ID}
        client-secret: ${OAUTH_CLIENT_SECRET}
        introspection-uri: https://login.example.com/as/introspect.oauth2

kafka:
  clusters:
    - name: test
      bootstrapServers: ${KAFKA_BOOTSTRAP_SERVERS} 

roles.yml

rbac:
  roles:
    - name: "admins"
      clusters:
        - test
      subjects:
        - provider: oauth
          type: role
          value: "CN=KafbatAdmins,OU=SecurityGroups,DC=example,DC=com"
      permissions:
        - resource: applicationconfig
          actions: all

        - resource: clusterconfig
          actions: all

        - resource: topic
          value: ".*"
          actions: all

        - resource: consumer
          value: ".*"
          actions: all

        - resource: schema
          value: ".*"
          actions: all

        - resource: connect
          value: ".*"
          actions: all

        - resource: ksql
          actions: all

        - resource: acl
          actions: [ view ]

    - name: "${OAUTH_CLIENT_ID}"
      clusters:
        - test
      subjects:
        - provider: oauth
          type: user
          value: "${OAUTH_CLIENT_ID}"
      permissions:
        - resource: applicationconfig
          actions: all

        - resource: clusterconfig
          actions: all

        - resource: topic
          value: ".*"
          actions: all

        - resource: consumer
          value: ".*"
          actions: all

        - resource: schema
          value: ".*"
 
        - resource: connect
          value: ".*"
          actions: all

        - resource: ksql
          actions: all

        - resource: acl
          actions: [ view ]
 

docker-compose.yml

services:
  redpanda:
    image: redpandadata/redpanda:v25.1.2
    container_name: redpanda
    command:
      - redpanda
      - start
      - --overprovisioned
      - --smp=1
      - --memory=1G
      - --reserve-memory=0M
      - --node-id=0
      - --check=false
      - --kafka-addr=PLAINTEXT://0.0.0.0:9092
      - --advertise-kafka-addr=PLAINTEXT://redpanda:9092
    ports:
      - "9092:9092"

  kafbat-ui:
    image: ghcr.io/kafbat/kafka-ui:latest
    container_name: kafbat-ui
    restart: unless-stopped
    depends_on:
      - redpanda
    ports:
      - "8443:8443"
    volumes:
      - ./config/application.yml:/etc/kafkaui/application.yml:ro
      - ./config/roles.yml:/etc/kafkaui/roles.yml:ro
      - ./certs:/etc/kafkaui/certs:ro
    environment:
      SPRING_CONFIG_LOCATION: file:/etc/kafkaui/application.yml
      SPRING_CONFIG_ADDITIONAL_LOCATION: file:/etc/kafkaui/roles.yml
      KEYSTORE_PASSWORD: REDACTED
      OAUTH_CLIENT_ID: REDACTED
      OAUTH_CLIENT_SECRET: REDACTED
      KAFKA_BOOTSTRAP_SERVERS: redpanda:9092