stackabletech / stackabletech/nifi-operator

Fix NiFi 2 clustering

Offen
#809 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

epic size/XL type/security
Vorherrschende Sprache
Rust
Sterne
48
Forks
12
Ø Merge
11 Std. 26 Min.
Gemergte PRs (30 T.)
10

Beschreibung

Description

Currently, if you create a JWT token for a nifi node, you can only log into this specific node. This is apparently by design as explained in https://issues.apache.org/jira/browse/NIFI-7246.

The problem with this is that it forces sticky sessions (when using a load balancer) which defeats the purpose of using a stateless token.

This appears to exist because some NiFi state is not shares, so for some API calls you currently must connect to the applicable node.

Slightly relevant is that there are SNI checks (so that the server can verify that the client is connecting via the expected hostname). Presumably this was implemented due to the previously mentioned requirement for connecting to the correct node.

Proposed Solution

[!TIP]
As this is a specific problem of the product NiFi we think it might be useful to fix it upstream.

There are multiple parts to the overall solution:

  1. Fix NiFi 2's state sharing so that there is no longer a need to send requests to a specific node.
  2. Allow JWTs to be issued by a cluster wide issuer for a single audience so that the same token can be used on any node (thereby removing the need for sticky sessions).
  3. Additional nice-to-have's:
    • Remove the SNI hostname check (assuming it was only there as a protection mechanism for what was mentioned in the Description section).
    • Possibly remove authentication from metrics endpoints (and ideally run metrics on a different http server).

Unknowns

  • How is the JWT signing key currently generated?
  • Can the SNI check be removed once it doesn't matter which cluster node is connected to?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Untersuchung des State-Sharings und des clusterweiten JWT-Verhaltens von NiFi 2, einschließlich der Frage, wie der Signaturschlüssel generiert wird und wie SNI-Hostname-Prüfungen verwendet werden. Überprüfe außerdem den Authentifizierungspfad für metrics. Als erledigt gilt die Untersuchung, wenn clusterweit ausgestellte Tokens auf jedem Knoten ohne Sticky Sessions funktionieren und die vorgeschlagenen SNI- und metrics-Änderungen bewertet wurden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
kubernetes
Bereich
authentication, distributed-systems, infrastructure
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.