+
About this guide
+
+
This guide covers using the Kroxylicious SASL Inspection Filter. This filter extracts the authenticated principal from a successful SASL exchange between Kafka Client and Kafka Broker and makes it available to the other filters in the chain.
+
+
+
Refer to other Kroxylicious guides for information on running the proxy or for advanced topics such as plugin development.
+
+
+
This filter inspects the SASL exchange between Kafka Client and Broker and extracts the authenticated principal. If the client’s authentication with the broker is successful, the filter makes the authenticated principal available to the other filters in the chain, so that they may know on whose behalf they are acting.
+
+
+
+
+
+ |
+ The SASL Inspection Filter plays no part in deciding if the authentication is successful or not. That role remains the exclusive responsibility of the broker. |
+
+
+
+
+
+
To use this filter, the Kafka Cluster’s listener must be configured to authenticate using SASL, and it must use a SASL mechanism that enabled by this filter. If the Kafka Client is configured to use a SASL mechanism that is not supported by the proxy, or the proxy and Kafka Cluster do not have the same mechanism available the client will be disconnected with an unsupported SASL mechanism error.
+
+
+
This filter supports the following SASL mechanisms:
+
+
+ Table 1. Table of supported SASL mechanisms
+
+
+
+
+
+
+ | SASL mechanism |
+ Enabled by default |
+
+
+
+
+ |
+ PLAIN
+ |
+
+ No
+ |
+
+
+ |
+ SCRAM-SHA-256
+ |
+
+ Yes
+ |
+
+
+ |
+ SCRAM-SHA-512
+ |
+
+ Yes
+ |
+
+
+ |
+ OAUTHBEARER
+ |
+
+ Yes
+ |
+
+
+
+
+
Mechanisms that transmit credentials in plain text are disabled by default. This is done to avoid the plain-text passwords existing in the proxy’s memory. To use such a mechanism, you must enable it in the filter’s configuration.
+
+
+
For the OAUTHBEARER inspection, only JWT tokens that use using signatures (JWS) are supported. JWT tokens that use encryption (JWE) are not supported. Unsigned JWT tokens are supported but not recommended for production use.
+
+
+
If an attempted is made to use a unsupported token type, the authentication will fail with a SASL error.
+
+
+
+

+
+
Figure 1. Sequence diagram showing the SASL inspection filter extracting an authenticated principal from an SASL negotiation.
+
+