Skip to main content

Enable and configure SASL authentication

Aiven for Apache Kafka® provides multiple authentication methods to secure Kafka data, including Simple Authentication and Security Layer (SASL) over SSL.

Enable SASL authentication

  1. Access the Aiven Console and select your Aiven for Apache Kafka service.
  2. Click Service settings.
  3. Scroll to Advanced configuration and click Configure.
  4. Click Add configuration options.
  5. Select kafka_authentication_methods.sasl from the list and set the value to Enabled.
  6. Click Save configurations.

The Connection information in the Overview page now allows connections via SASL or Client certificate.

note

Although these connections use a different port, the host, CA, and user credentials remain consistent.

Configure SASL mechanisms

After enabling SASL authentication, fine-tune the active SASL mechanisms for your Aiven for Apache Kafka service. By default, all mechanisms (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) are enabled. Configure these settings only to disable any mechanisms.

  1. Access the Aiven Console and select your Aiven for Apache Kafka® service.

  2. Click Service settings.

  3. Scroll to Advanced configuration and click Configure.

  4. In the Advanced configuration window, set the corresponding kafka_sasl_mechanisms value to either Enabled or Disabled:

    • PLAIN: kafka_sasl_mechanisms.plain
    • SCRAM-SHA-256: kafka_sasl_mechanisms.scram_sha_256
    • SCRAM-SHA-512: kafka_sasl_mechanisms.scram_sha_512
  5. Click Save configurations.

note
  • At least one SASL mechanism must remain enabled. Disabling all results in an error.
  • OAUTHBEARER is enabled if sasl_oauthbearer_jwks_endpoint_url is specified.

Enable public CA for SASL authentication

After enabling SASL authentication, enable the public CA if Kafka clients cannot install or trust the default project CA.

  1. Access the Aiven Console and select your Aiven for Apache Kafka service.

  2. Click Service settings.

  3. Go to the Cloud and network section, click Actions > More network configurations.

  4. In the Network configuration dialog:

    1. Click Add configuration options.
    2. Find letsencrypt_sasl (or letsencrypt_sasl_privatelink for PrivateLink).
    3. Select the configuration option.
    4. Set the value to Enabled.
    5. Click Save configurations.

The Connection information on the Overview page now supports SASL connections using either Project CA or Public CA.

note
  • The public certificate is issued and validated by Let's Encrypt, a widely trusted certification authority. For details, see How It Works

  • When enabling the public CA over a PrivateLink connection, network configuration may take several minutes before clients can connect. A new port must be allocated and the load balancer route table updated before clients can connect.

Related pages