Reviewed-by: Antonova, Ekaterina <ekantono@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
29 KiB
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.
- 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
- Log in to the console.
- Click
in the upper left corner to select a region.
- Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.
- Click a Kafka instance to go to the Basic Information page.
- 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
Public network plaintext access
- Check that Public Access is enabled. If it is not enabled, enable it. For details, see Configuring Kafka Public Access.
- Click
next to Plaintext Access in the Public Network Access area. A confirmation dialog box is displayed.
- 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
- Log in to the console.
- Click
in the upper left corner to select a region.
- Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.
- Click a Kafka instance to go to the Basic Information page.
- 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
- Click
next to Ciphertext Access in the Private Network Access area. The Private Network Ciphertext Access dialog box is displayed.
- 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
- Check that Public Access is enabled. If it is not enabled, enable it. For details, see Configuring Kafka Public Access.
- Click
next to Ciphertext Access in the Public Network Access area. The Public Network Ciphertext Access dialog box is displayed.
- 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.
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).
- Click
Disabling Plaintext Access
- Log in to the console.
- Click
in the upper left corner to select a region.
- Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.
- Click a Kafka instance to go to the Basic Information page.
- 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.
Public network plaintext access
Disabling Ciphertext Access
- Log in to the console.
- Click
in the upper left corner to select a region.
- Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.
- Click a Kafka instance to go to the Basic Information page.
- 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.