stackabletech / stackabletech/nifi-operator

Fix: Use a common JWT issuer across the whole NiFi 2 cluster

Open
#811 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

size/M type/security
Dominant language
Rust
Stars
48
Forks
12
Avg merge
11h 26m
Merged PRs (30d)
10

Description

Part of https://github.com/stackabletech/nifi-operator/issues/809.

[!CAUTION]
Depends on https://github.com/stackabletech/nifi-operator/issues/810.

Technically it could be done, but it is likely to be rejected upstream as it appears to have been done to avoid connecting to the wrong server.

Current state

In NiFi2, JWT tokens are issued for specific nodes, and the current recommendation is to use sticky-sessions on load balancers.

NIFI-7246
The uniqueness of JWT-generating keys to individual nodes (and thus the lack of transitivity of tokens between nodes) is by design. The solution is to enable sticky sessions in the load balancer.

This is rather unusual when dealing with a "cluster" where any healthy member should be able to service requests with the same answer as any other, and using the same authentication token.

JWT tokens are by design stateless, they contain everything they need to be validated without sticky-sessions or server-side shared session stores.

Example claim showing the issuer for a specific cluster member.

{
  "aud": "https://simple-nifi-node-default-0.simple-nifi-node-default.default.svc.cluster.local:8443",
  "exp": 1747013821,
  "groups": [],
  "iat": 1746985021,
  "iss": "https://simple-nifi-node-default-0.simple-nifi-node-default.default.svc.cluster.local:8443",
  "jti": "ad20e97e-5f60-4404-87a5-bcd8b3093746",
  "nbf": 1746985021,
  "preferred_username": "admin",
  "sub": "admin"
}

Future state

  • There should be a common issuer for the cluster so that a JWT token can be used on any cluster node.
  • Any healthy cluster member should accept a valid JWT token in the same way any other cluster member would.

Unknowns

  • How is the issuer currently generated? Does it persist across restarts?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review issues 810 and 809 first, then read Apache NiFi issue NIFI-7246 for the upstream constraints. Trace how the issuer is currently generated and whether it persists across restarts; done means one cluster-wide issuer is used and any healthy member accepts a valid JWT.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, rust
Domain
authentication, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.