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.

Note

  • 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.

  • 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 image1 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  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 image2 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 image3 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 image4 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  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 image5 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.

      • To disable private network ciphertext access, 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 image6 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.

    SCRAM-SHA-512 is enabled by default. To use PLAIN, enable SASL/PLAIN.

    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.

    SCRAM-SHA-512 is enabled by default. To use PLAIN, enable SASL/PLAIN. SCRAM-SHA-512 authentication is recommended for plaintext transmission.

    Cross-VPC Access Protocol

    -

    • When Plaintext Access is enabled and Ciphertext Access is disabled, PLAINTEXT is used for Cross-VPC Access Protocol.

    • When Ciphertext Access is enabled and Security Protocol is SASL_SSL, SASL_SSL is used for Cross-VPC Access Protocol.

    • When Ciphertext Access is enabled and Security Protocol is SASL_PLAINTEXT, SASL_PLAINTEXT is used for Cross-VPC Access Protocol.

    Fixed once the instance is created.

    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.

    A username should contain 4 to 64 characters, start with a letter, and contain only letters, digits, hyphens (-), and underscores (_).

    A password must meet the following requirements:

    • Contains 8 to 32 characters.

    • Cannot start with a hyphen (-) and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, spaces, and special characters `~! @#$%^&*()-_=+\|[{}];:'",<.>?

    • Cannot be the username spelled forwards or backwards.

    The username cannot be changed once ciphertext access is enabled.

    Note

    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 image7 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  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 image8 next to Plaintext Access in the Private Network Access area.

    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 image9 next to Plaintext Access in the Public Network Access area.

    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 image10 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  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

    To disable private network ciphertext access, contact customer service.

    Public network ciphertext access

    1. Click image11 next to Ciphertext Access in the Public Network Access area.

    2. Click OK. The Background Tasks page is displayed. If the status of the task turns to Successful, ciphertext access is successfully disabled.

    Note

    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.