You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable authentication in your Redpanda cluster, you have the following options, depending on your requirements for SASL authentication and authorization.
458
+
Redpanda provides two distinct methods for enabling SASL authentication. Choose ONE method based on your requirements.
459
+
460
+
[IMPORTANT]
461
+
====
462
+
*Do not mix configuration methods*
463
+
464
+
Using both `enable_sasl` and `kafka_enable_authorization` + `authentication_method` together can lead to configuration inconsistencies and initialization failures. Choose one approach and use it consistently.
465
+
====
459
466
460
467
NOTE: You must <<create-superusers, create at least one superuser>> before enabling authentication. Enabling authentication without a superuser can result in being locked out of the cluster.
461
468
462
-
- Enable SASL authentication for all Kafka listeners:
463
-
+
464
-
Use this method if you haven't already enabled authentication and you want to apply SASL authentication to all Kafka listeners. This approach does not require you to restart the cluster.
465
-
+
466
-
NOTE: This command implicitly enables authorization. If you want to disable authorization, you can use the `kafka_enable_authorization` cluster configuration property.
467
-
+
469
+
==== Method 1: Global authentication (recommended)
470
+
471
+
Use this method if you want SASL authentication on all Kafka listeners and prefer simpler configuration.
472
+
473
+
*Behavior:*
474
+
475
+
* Enables SASL authentication on ALL Kafka API listeners automatically
476
+
* Implicitly enables authorization (`kafka_enable_authorization` is set to `true`)
477
+
* No `redpanda.yaml` changes required
478
+
* No cluster restart required
479
+
480
+
*Command:*
481
+
468
482
[source,bash]
469
483
----
470
484
rpk cluster config set enable_sasl true
471
485
----
472
486
473
-
- Explicitly enable authorization and define authentication method per listener:
474
-
+
475
-
Choose this method if you require specific control over the authentication method for each Kafka listener, or if you need to enable authorization explicitly. This option requires a cluster restart.
476
-
+
477
-
1. Enable authorization:
487
+
[WARNING]
488
+
====
489
+
When using this method, do NOT additionally set `kafka_enable_authorization: true` or add `authentication_method: sasl` to `redpanda.yaml`. The `enable_sasl` setting handles both automatically.
Use this method if you need different authentication methods on different listeners or want explicit control.
495
+
496
+
*Behavior:*
497
+
498
+
* Requires explicit configuration in `redpanda.yaml` for each listener
499
+
* Requires explicit authorization enablement
500
+
* Requires cluster restart to apply changes
501
+
502
+
*Steps:*
503
+
504
+
1. Enable authorization explicitly:
478
505
+
479
506
[source,bash]
480
507
----
481
508
rpk cluster config set kafka_enable_authorization true
482
509
----
483
510
484
-
2. Define the authentication method for each listener. See <<Authentication for the Kafka API>> and <<Authentication for the HTTP APIs>>.
511
+
2. Configure authentication method for each listener in `redpanda.yaml`. See <<Authentication for the Kafka API>>.
512
+
513
+
3. Restart the cluster.
514
+
515
+
[WARNING]
516
+
====
517
+
When using this method, do NOT set `enable_sasl: true`. The per-listener configuration and explicit `kafka_enable_authorization` handle authentication and authorization separately.
518
+
====
485
519
486
520
For detailed information about these and other cluster configurations, see xref:manage:cluster-maintenance/cluster-property-configuration.adoc[].
487
521
endif::[]
@@ -509,15 +543,15 @@ NOTE: Redpanda provides an option to configure different SASL authentication mec
509
543
510
544
==== Enable SASL
511
545
512
-
To enable SASL authentication for the Kafka API, set the xref:reference:properties/broker-properties.adoc#kafka_api_auth_method[`authentication_method`] broker property of the Kafka listeners to `sasl`.
513
-
514
546
ifdef::env-kubernetes[The Redpanda Helm chart sets the xref:reference:properties/broker-properties.adoc#kafka_api_auth_method[`authentication_method`] broker property to `sasl` for all Kafka listeners by default when you <<enable-authentication, enable authentication>>.]
515
547
516
-
ifndef::env-kubernetes[If you <<enable-sasl-authentication, enabled authentication with `enable_sasl=true`>>, Redpanda implicitly sets xref:reference:properties/broker-properties.adoc#kafka_api_auth_method[`authentication_method`] to `sasl` for the Kafka listeners.]
548
+
ifndef::env-kubernetes[]
549
+
How you enable SASL depends on which <<enable-sasl-authentication, authentication method>> you chose:
517
550
518
-
ifndef::env-kubernetes[If you <<enable-sasl-authentication, enabled authentication with `kafka_enable_authorization=true`>>, you must enable SASL for the Kafka listeners.]
551
+
*If you used Method 1* (`enable_sasl: true`): SASL is already enabled on all Kafka listeners automatically. Skip this section.
552
+
553
+
*If you used Method 2* (per-listener): Set the xref:reference:properties/broker-properties.adoc#kafka_api_auth_method[`authentication_method`] broker property to `sasl` for the Kafka listeners that require authentication.
519
554
520
-
ifndef::env-kubernetes[]
521
555
In `redpanda.yaml`, enter:
522
556
523
557
[,yaml,lines=6]
@@ -1901,6 +1935,102 @@ redpanda:
1901
1935
----
1902
1936
endif::[]
1903
1937
1938
+
== Troubleshooting authentication
1939
+
1940
+
=== Schema Registry 403 Forbidden errors
1941
+
1942
+
If clients receive error code 50302 or 403 when registering or fetching schemas, the internal `schema_registry_internal` role may be incomplete.
1943
+
1944
+
*Symptoms:*
1945
+
1946
+
Clients see:
1947
+
1948
+
[source,json]
1949
+
----
1950
+
{
1951
+
"error_code": 50302,
1952
+
"message": "broker_not_available"
1953
+
}
1954
+
----
1955
+
1956
+
Redpanda logs show:
1957
+
1958
+
[source,log]
1959
+
----
1960
+
WARN Failed to create ACLs for type {ephemeral user} name {__schema_registry}
1961
+
ERROR Schema registry failed to initialize: broker_not_available
1962
+
----
1963
+
1964
+
*Cause:*
1965
+
1966
+
When `schema_registry_enable_authorization` is enabled during cluster instability (controller election, restart, heavy load), ACL creation for the internal role may fail partway through, leaving an incomplete role that persists across restarts.
1967
+
1968
+
*Diagnosis:*
1969
+
1970
+
Check if the internal role is complete:
1971
+
1972
+
[source,bash]
1973
+
----
1974
+
rpk security role describe schema_registry_internal
1975
+
----
1976
+
1977
+
*Expected output (complete role - 8 ACLs):*
1978
+
1979
+
[source,text]
1980
+
----
1981
+
PRINCIPAL RESOURCE-TYPE RESOURCE-NAME OPERATION PERMISSION
rpk security role assign schema_registry_internal \
2020
+
--principal User:__schema_registry
2021
+
2022
+
# Restart to reinitialize
2023
+
systemctl restart redpanda
2024
+
----
2025
+
2026
+
Verify the fix by checking the role again and testing schema registration.
2027
+
2028
+
*Prevention:*
2029
+
2030
+
* Only enable `schema_registry_enable_authorization` when the cluster is stable
2031
+
* Avoid enabling during cluster restarts or controller failovers
2032
+
* Verify role completeness after enabling Schema Registry authorization
2033
+
1904
2034
== Generate security report
1905
2035
1906
2036
Use the link:/api/doc/admin/operation/operation-get_security_report[`/v1/security/report`] endpoint to generate a comprehensive security report for your cluster. This endpoint provides detailed information about current TLS configuration, authentication methods, authorization status, and security alerts across all Redpanda interfaces (Kafka, RPC, Admin, Schema Registry, HTTP Proxy).
0 commit comments