Updated on 2024-05-24 GMT+08:00

Configuring Plaintext or Ciphertext Access to Kafka Instances

You can access a Kafka instance in plaintext or ciphertext. This section describes how to change the access mode on the console.

  • When you change the access mode for the first time, some instances will restart. You can see the actual situation on the console. The restart takes about 75–80s. The instance will not be restarted when the access mode is changed again.
  • Instance access mode is not available in the following regions.
    • CN North-Beijing1
    • ME-Riyadh
    • LA-Sao Paulo1
    • LA-Santiago
  • For a single-node instance, you can only enable or disable plaintext for public network access.

Prerequisites

You can change the access mode of a Kafka instance only when the instance is in the Running state.

Enabling Plaintext Access

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click a Kafka instance to go to the Basic Information page.
  5. An instance can be accessed in plaintext over the private network and public network. For details about how to enable plaintext access, see Table 1.

    Table 1 Enabling plaintext access

    Access Method

    Enabling Plaintext Access

    Private network plaintext access

    1. Click next to Plaintext Access in the Private Network Access area. A confirmation dialog box is displayed.
    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, plaintext access is successfully enabled.

    Public network plaintext access

    1. Check that Public Access is enabled. If it is not enabled, enable it. For details, see Configuring Kafka Public Access.
    2. Click next to Plaintext Access in the Public Network Access area. A confirmation dialog box is displayed.
    3. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, plaintext access is successfully enabled.

Enabling Ciphertext Access

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click a Kafka instance to go to the Basic Information page.
  5. An instance can be accessed in ciphertext over the private network and public network. For details about how to enable ciphertext access, see Table 2.

    Table 2 Enabling ciphertext access

    Access Method

    Enabling Ciphertext Access

    Private network ciphertext access

    1. Click next to Ciphertext Access in the Private Network Access area. The Private Network Ciphertext Access dialog box is displayed.
    2. Set the Kafka security protocol, SASL/PLAIN mechanism, username, and password, and click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, ciphertext access is successfully enabled.
      NOTE:
      • When enabling ciphertext access for the first time (including through private network and public network), you need to set the Kafka security protocol, SASL/PLAIN mechanism, username, and password. Next time when you enable ciphertext access, you only need to set the Kafka security protocol.
      • Private network ciphertext access cannot be disabled in some regions. In this case, contact customer service.

    Public network ciphertext access

    1. Check that Public Access is enabled. If it is not enabled, enable it. For details, see Configuring Kafka Public Access.
    2. Click next to Ciphertext Access in the Public Network Access area. The Public Network Ciphertext Access dialog box is displayed.
    3. Set the Kafka security protocol, SASL/PLAIN mechanism, username, and password, and click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, ciphertext access is successfully enabled.
      NOTE:

      When enabling ciphertext access for the first time (including through private network and public network), you need to set the Kafka security protocol, SASL/PLAIN mechanism, username, and password. Next time when you enable ciphertext access, you only need to set the Kafka security protocol.

    The Kafka security protocol, SASL/PLAIN mechanism, username, and password are described as follows.

    Table 3 Ciphertext access parameters

    Parameter

    Value

    Description

    Security Protocol

    SASL_SSL

    SASL is used for authentication. Data is encrypted with SSL certificates for high-security transmission.

    This protocol supports the SCRAM-SHA-512 and PLAIN mechanisms.

    What are SCRAM-SHA-512 and PLAIN mechanisms?

    • SCRAM-SHA-512: uses the hash algorithm to generate credentials for usernames and passwords to verify identities. SCRAM-SHA-512 is more secure than PLAIN.
    • PLAIN: a simple username and password verification mechanism.

    SASL_PLAINTEXT

    SASL is used for authentication. Data is transmitted in plaintext for high performance.

    This protocol supports the SCRAM-SHA-512 and PLAIN mechanisms.

    SCRAM-SHA-512 authentication is recommended for plaintext transmission.

    SASL/PLAIN

    -

    • If SASL/PLAIN is disabled, the SCRAM-SHA-512 mechanism is used for username and password authentication.
    • If SASL/PLAIN is enabled, both the SCRAM-SHA-512 and PLAIN mechanisms are supported. You can select either of them as required.

    The SASL/PLAIN setting cannot be changed once ciphertext access is enabled.

    Username and Password

    -

    Username and password used by the client to connect to the Kafka instance.

    The username cannot be changed once ciphertext access is enabled.

    The Kafka security protocol, SASL/PLAIN mechanism, username, and password are required when the client accesses a Kafka instance with ciphertext access enabled. For details, see Connecting to Kafka Using the Client (Ciphertext Access).

Disabling Plaintext Access

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click a Kafka instance to go to the Basic Information page.
  5. An instance can be accessed in plaintext over the private network and public network. For details about how to disable plaintext access, see Table 4.

    Table 4 Disabling plaintext access

    Access Method

    Disabling Plaintext Access

    Private network plaintext access

    Once enabled, private network access cannot be disabled. Enable plaintext or ciphertext access, or both. If ciphertext access is disabled, plaintext access cannot be disabled.

    1. Click next to Plaintext Access in the Private Network Access area. A confirmation dialog box is displayed.
    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, plaintext access is successfully disabled.

    Public network plaintext access

    1. Click next to Plaintext Access in the Public Network Access area. A confirmation dialog box is displayed.
    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, plaintext access is successfully disabled.

Disabling Ciphertext Access

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click a Kafka instance to go to the Basic Information page.
  5. An instance can be accessed in ciphertext over the private network and public network. For details about how to disable ciphertext access, see Table 5.

    Table 5 Disabling ciphertext access

    Access Method

    Disabling Plaintext Access

    Private network ciphertext access

    In regions where private network ciphertext access cannot be disabled, contact customer service. In regions where it can be disabled, do as follows:

    1. Click next to Ciphertext Access in the Private Network Access area. A confirmation dialog box is displayed.
    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, ciphertext access is successfully disabled.

    Public network ciphertext access

    1. Click next to Ciphertext Access in the Public Network Access area. A confirmation dialog box is displayed.
    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, ciphertext access is successfully disabled.

    After you disable ciphertext access, the created users will not be deleted. You do not need to create users again when you enable ciphertext access next time.