Skip to content

ADH-6782: Add SPNEGO authentication for History Server & SQL Gateway REST APIs #15

Open
iamlapa wants to merge 9 commits into
develop/4.3.0/2.2.1.1from
ADH-6782
Open

ADH-6782: Add SPNEGO authentication for History Server & SQL Gateway REST APIs #15
iamlapa wants to merge 9 commits into
develop/4.3.0/2.2.1.1from
ADH-6782

Conversation

@iamlapa

@iamlapa iamlapa commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ADH-6782: SPNEGO authentication for Flink History Server.
  • ADH-6783: SPNEGO authentication for SQL Gateway REST.

The default behavior remains unchanged: authentication type is NONE unless explicitly enabled.

Problem

History Server and SQL Gateway REST can be exposed on network interfaces without authentication.

This allows unauthenticated users to:

  • browse completed Flink jobs, execution graphs, configs, timestamps, and logs via History Server;
  • create SQL Gateway sessions, execute SQL, submit jobs, and access configured data sources via SQL Gateway REST.

Changes

  • Added SPNEGO authentication support for History Server UI and REST endpoints.
  • Added SPNEGO authentication support for all SQL Gateway REST paths, including /v*/info.
  • Added Hadoop-compatible Authorization: Negotiate / WWW-Authenticate: Negotiate flow.
  • Added signed hadoop.auth cookies after successful SPNEGO negotiation.
  • Added startup validation for required Kerberos principal/keytab options.
  • Added support for HTTP/_HOST@REALM principal replacement and wildcard * keytab principal loading.
  • Added optional shared cookie signing secret for multi-instance deployments.
  • Added /auth/user History Server endpoint and UI display of the authenticated user.
  • Updated documentation with SPNEGO setup examples and exposure warnings.

New Settings

History Server

  • historyserver.web.authentication.type
    Authentication mode. Default: NONE. Supported: NONE, KERBEROS.

  • historyserver.web.authentication.kerberos.principal
    Kerberos HTTP service principal for SPNEGO. Required for KERBEROS. Supports HTTP/_HOST@REALM and *.

  • historyserver.web.authentication.kerberos.keytab
    Keytab path for the History Server SPNEGO principal. Required for KERBEROS.

  • historyserver.web.authentication.kerberos.name-rules
    Optional Kerberos auth-to-local rules. Uses the default Hadoop rule when unset.

  • historyserver.web.authentication.token.validity
    Signed auth cookie validity. Default: 10 h.

  • historyserver.web.authentication.cookie.path
    Cookie path for hadoop.auth. Default: /.

  • historyserver.web.authentication.signature.secret
    Inline shared cookie-signing secret.

  • historyserver.web.authentication.signature.secret-file
    File containing shared cookie-signing secret.

SQL Gateway REST

  • sql-gateway.endpoint.rest.authentication.type
    Authentication mode. Default: NONE. Supported: NONE, KERBEROS.

  • sql-gateway.endpoint.rest.authentication.kerberos.principal
    Kerberos HTTP service principal for SPNEGO. Required for KERBEROS. Supports HTTP/_HOST@REALM and *.

  • sql-gateway.endpoint.rest.authentication.kerberos.keytab
    Keytab path for the SQL Gateway REST SPNEGO principal. Required for KERBEROS.

  • sql-gateway.endpoint.rest.authentication.kerberos.name-rules
    Kerberos auth-to-local rules. Default: DEFAULT.

  • sql-gateway.endpoint.rest.authentication.token.validity
    Signed auth cookie validity. Default: 10 h.

  • sql-gateway.endpoint.rest.authentication.cookie.path
    Cookie path for hadoop.auth. Default: /.

  • sql-gateway.endpoint.rest.authentication.signature.secret
    Inline shared cookie-signing secret.

  • sql-gateway.endpoint.rest.authentication.signature.secret-file
    File containing shared cookie-signing secret.

iamlapa added 2 commits June 15, 2026 16:24
Add opt-in Kerberos/SPNEGO authentication for the History Server web UI and REST endpoints. When enabled, unauthenticated requests receive a Negotiate challenge and authenticated clients get a signed hadoop.auth cookie.
This change adds History Server authentication configuration options, Netty authentication handling, Hadoop Auth-compatible token signing, MiniKDC integration coverage, and documentation/config examples.
Authentication remains disabled by default.
Add opt-in Kerberos/SPNEGO authentication for SQL Gateway REST APIs. When enabled, unauthenticated requests receive a Negotiate challenge, valid SPNEGO clients receive a signed hadoop.auth cookie, and invalid tokens are rejected.
This change adds SQL Gateway REST authentication options, startup configuration validation, a ServiceLoader Netty inbound handler, cookie signing/verification, Hadoop Auth dependencies, MiniKDC coverage, docs, and sample configuration. Default behavior remains unchanged with authentication.type=NONE.
@iamlapa iamlapa requested review from Asmoday and tigrulya-exe June 16, 2026 07:26
Introduce a new API endpoint (`/auth/user`) to expose user authentication details in the History Server. This includes backend integration for user data retrieval, Angular frontend updates for UI visibility, and comprehensive tests to cover behavior in authenticated and unauthenticated scenarios.
iamlapa and others added 2 commits June 18, 2026 11:56
Add opt-in Kerberos/SPNEGO authentication for the JobManager Web UI and REST endpoint. The default mode remains NONE, while KERBEROS protects all WebMonitor paths including dashboard assets, job metadata, JAR upload/run, cancel, and rescale endpoints.
ADH-7564: Add SPNEGO authentication for JobManager Web UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants