Skip to content

Commit 475eada

Browse files
authored
Merge pull request #3221 from emqx/251030-sync-release-5.8
251030 sync release 5.8
2 parents 80ea0a9 + a84a6d2 commit 475eada

File tree

11 files changed

+175
-59
lines changed

11 files changed

+175
-59
lines changed
-397 Bytes
Loading

en_US/access-control/authn/redis.md

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integrate with Redis
22

3-
EMQX supports integrating with Redis for password authentication. EMQX Redis authenticator currently supports connecting to running in three different modes, which are Single, [Redis Sentinel](https://redis.io/docs/manual/sentinel/) and [Redis Cluster](https://redis.io/docs/manual/scaling/). This section gives detailed instructions on the data schema supported and on how to configure with EMQX Dashboard and configuration file.
3+
EMQX supports integrating with Redis for password authentication. EMQX Redis authenticator currently supports connecting to Redis running in three different modes, which are Single, [Redis Sentinel](https://redis.io/docs/manual/sentinel/), and [Redis Cluster](https://redis.io/docs/manual/scaling/). This section gives detailed instructions on the data schema supported and on how to configure with EMQX Dashboard and the configuration file.
44

55
::: tip Prerequisite:
66

@@ -51,37 +51,56 @@ You can use EMQX Dashboard to configure how to use Redis for password authentica
5151

5252
<img src="./assets/authn-redis.png" alt="Authentication with redis" style="zoom:67%;" />
5353

54-
4. Follow the instructions below to configure the authentication backend:
55-
56-
- Enter the information for connecting to Redis.
57-
58-
- **Redis Mode**: Select how Redis is deployed, including `Single`, `Sentinel` and `Cluster`.
59-
- **Server(s)**: Specify the Redis server address that EMQX is to connect, if **Redis Mode** is set to `Sentinel` or `Cluster`, you will need to input all Redis servers (separated with a `,`) that EMQX is to connect.
60-
- **Sentinel Name**: Specify the name to use; type: strings; only needed if you set **Redis Mode** to `Sentinel`.
61-
- **Database**: Redis database name; Data type: strings.
62-
- **Password**: Specify Redis user password.
63-
- Configure settings related to authentication:
64-
65-
- **Password Hash**: Select the password hashing algorithm applied to plain-text passwords before results are stored in the database. Available options are `plain`, `md5`, `sha`, `sha256`, `sha512`, `bcrypt`, and `pbkdf2`. Additional configurations depend on the selected algorithm:
66-
- For `md5`, `sha`, `sha256` or `sha512`:
67-
- **Salt Position**: Determines how salt (random data) is mixed with the password. Options are `suffix`, `prefix`, or `disable`. You can keep the default value unless you migrate user credentials from external storage into the EMQX built-in database.
68-
- Resulting hash is represented as a string of hexadecimal characters, and compared case-insensitively with the stored credential.
69-
- For `plain`:
70-
- **Salt Position**: should be `disable`.
71-
- For `bcrypt`:
72-
- **Salt Rounds**: Defines the number of times the hash function is applied, expressed as _2<sup>Salt Rounds</sup>_, also known as the "cost factor". The default value is `10`, with a permissible range of `5` to `10`. A higher value is recommended for enhanced security. Note: Increasing the cost factor by 1 doubles the necessary time for authentication.
73-
- For `pbkdf2`:
74-
- **Pseudorandom Function**: Selects the hash function that generates the key, such as `sha256`.
75-
- **Iteration Count**: Sets the number of times the hash function is executed. The default is `4096`.
76-
- **Derived Key Length** (optional): Specifies the length in bytes of the generated key. If left blank, the length will default to that determined by the selected pseudorandom function.
77-
- Resulting hash is represented as a string of hexadecimal characters, and compared case-insensitively with the stored credential.
78-
- **Precondition**: A [Variform expression](../../configuration/configuration.md#variform-expressions) used to control whether this Redis authenticator should be applied to a client connection. The expression is evaluated against attributes from the client (such as `username`, `clientid`, `listener`, etc.). The authenticator will only be invoked if the expression evaluates to the string `"true"`. Otherwise, it will be skipped. For more information about the precondition, see [Authenticator Preconditions](./authn.md#authenticator-preconditions).
79-
- **Enable TLS**: Turn on the toggle switch if you want to enable TLS. For more information on enabling TLS, see [Network and TLS](../../network/overview.md).
80-
- **CMD**: Redis query command.
81-
- **Advanced Settings**:
82-
- **Pool size** (optional): Specify the number of concurrent connections from an EMQX node to a Redis server. Default: `8`.
83-
84-
5. After you finish the settings, click **Create**.
54+
Follow the instructions below on how to configure the authentication:
55+
56+
**Connect**: Enter the information for connecting to Redis.
57+
58+
- **Redis Mode**: Select how Redis is deployed, including `Single`, `Sentinel` and `Cluster`.
59+
60+
- **Server(s)**: Specify the Redis server address that EMQX is to connect, if **Redis Mode** is set to `Sentinel` or `Cluster`, you will need to input all Redis servers (separated with a `,`) that EMQX is to connect.
61+
62+
- **Sentinel Name**: Specify the name to use; type: strings; only needed if you set **Redis Mode** to `Sentinel`.
63+
64+
- **Database**: Redis database name; Data type: strings.
65+
66+
- **Username**: Specify the Redis username to connect with. This field is required if your Redis instance uses [Redis ACL](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/#create-and-edit-user-acls-with-the-acl-setuser-command) (introduced in Redis 6.0) for authentication. If your Redis server uses the default user (with ACLs disabled or not enforced), you can leave this field blank.
67+
68+
::: tip
69+
70+
The `username` field is supported starting from EMQX 5.2.0. Ensure your deployment is running this version or later to use Redis ACL.
71+
72+
:::
73+
74+
- **Password**: Specify the password for the Redis user. The field is required for connecting to Redis instances with authentication enabled.
75+
76+
- If you have entered a username, this password must match the credentials configured in your Redis ACL settings.
77+
- If no username is provided, this password will be used to authenticate as the `default` user (if enabled).
78+
79+
80+
**TLS Configuration**: Turn on the toggle switch if you want to enable TLS. For more information on enabling TLS, see [Network and TLS](../../network/overview.md).
81+
82+
**Connection Configuration**: Set the concurrent connections.
83+
84+
- **Pool size** (optional): Specify the number of concurrent connections from an EMQX node to a Redis server. Default: `8`.
85+
86+
**Authentication configuration**: Configure settings related to authentication:
87+
88+
- **Password Hash**: Select the password hashing algorithm applied to plain-text passwords before results are stored in the database. Available options are `plain`, `md5`, `sha`, `sha256`, `sha512`, `bcrypt`, and `pbkdf2`. Additional configurations depend on the selected algorithm:
89+
- For `md5`, `sha`, `sha256` or `sha512`:
90+
- **Salt Position**: Determines how salt (random data) is mixed with the password. Options are `suffix`, `prefix`, or `disable`. You can keep the default value unless you migrate user credentials from external storage into the EMQX built-in database.
91+
- Resulting hash is represented as a string of hexadecimal characters, and compared case-insensitively with the stored credential.
92+
- For `plain`:
93+
- **Salt Position**: should be `disable`.
94+
- For `bcrypt`:
95+
- **Salt Rounds**: Defines the number of times the hash function is applied, expressed as _2<sup>Salt Rounds</sup>_, also known as the "cost factor". The default value is `10`, with a permissible range of `5` to `10`. A higher value is recommended for enhanced security. Note: Increasing the cost factor by 1 doubles the necessary time for authentication.
96+
- For `pbkdf2`:
97+
- **Pseudorandom Function**: Selects the hash function that generates the key, such as `sha256`.
98+
- **Iteration Count**: Sets the number of times the hash function is executed. The default is `4096`.
99+
- **Derived Key Length** (optional): Specifies the length in bytes of the generated key. If left blank, the length will default to that determined by the selected pseudorandom function.
100+
- Resulting hash is represented as a string of hexadecimal characters, and compared case-insensitively with the stored credential.
101+
- **CMD**: Redis query command.
102+
103+
After you finish the settings, click **Create**.
85104

86105
## Configure with Configuration Items
87106

-99.2 KB
Binary file not shown.
102 KB
Loading

en_US/access-control/authz/redis.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,36 @@ All rules added in Redis Authorizer are **allow** rules, which means Redis Autho
5555

5656
You can use EMQX Dashboard to configure how to use Redis for user authorization.
5757

58-
1. On [EMQX Dashboard](http://127.0.0.1:18083/#/authentication), click **Access Control** -> **Authorization** on the left navigation tree to enter the **Authorization** page.
58+
1. On the EMQX Dashboard, click **Access Control** -> **Authorization** on the left navigation tree to enter the **Authorization** page.
5959

6060
2. Click **Create** at the top right corner, then click to select **Redis** as **Backend**. Click **Next**. The **Configuration** tab is shown as below.
6161

62-
<img src="./assets/authz-Redis_ee.png" alt="authz-Redis_ee" style="zoom:67%;" />
62+
<img src="./assets/authz-redis.png" alt="authz-Redis_ee" style="zoom:67%;" />
6363

64-
3. Follow the instructions below to do the configuration.
64+
3. Follow the instructions below to configure the settings.
6565

66-
**Connect**: Fill in the information needed to connect Redis.
67-
68-
- **Redis Mode**: Select how Redis is deployed, including **Single**, **Sentinel** and **Cluster**.
66+
- **Redis Mode**: Select how Redis is deployed, including `Single`, `Sentinel` and `Cluster`.
6967
- **Server**: Specify the server address that EMQX is to connect (`host:port`).
7068
- **Database**: Redis database name.
71-
- **Password**: Specify user password.
69+
- **Username**: Specify the Redis username to connect with. This field is required if your Redis instance uses [Redis ACL](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/#create-and-edit-user-acls-with-the-acl-setuser-command) (introduced in Redis 6.0) for authentication. If your Redis server uses the default user (with ACLs disabled or not enforced), you can leave this field blank.
70+
71+
::: tip
7272

73-
**TLS Configuration**: Turn on the toggle switch if you want to enable TLS.
73+
The `username` field is supported starting from EMQX 5.2.0. Ensure your deployment is running this version or later to use Redis ACL.
7474

75-
**Connection Configuration**: Set the concurrent connections and waiting time before a connection is timed out.
75+
:::
76+
- **Password**: Specify the password for the Redis user. The field is required for connecting to Redis instances with authentication enabled.
7677

77-
- **Pool size** (optional): Input an integer value to define the number of concurrent connections from an EMQX node to Redis. Default: **8**.
78+
- If you have entered a username, this password must match the credentials configured in your Redis ACL settings.
79+
- If no username is provided, this password will be used to authenticate as the `default` user (if enabled).
7880

79-
**Authorization configuration**: Fill in the authorization-related settings:
81+
- **Enable TLS**: Turn on the toggle switch if you want to enable TLS.
8082

8183
- **CMD**: Fill in the query command according to the data schema.
8284

85+
- **Advanced Settings**: Set the concurrent connections and waiting time before a connection is timed out.
86+
- **Pool size** (optional): Input an integer value to define the number of concurrent connections from an EMQX node to Redis. Default: `8`.
87+
8388
4. Click **Create** to finish the settings.
8489

8590
## Configure with Configuration Items

en_US/data-integration/s3.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ EMQX supports Amazon S3 and other S3-compatible storage services. You can use AW
6262

6363
1. In the [AWS S3 Console](https://console.amazonaws.cn/s3/home), click the **Create bucket** button. Follow the instructions to enter the relevant information, such as bucket name and region, to create an S3 bucket. For detailed operations, refer to the [AWS Documentation](https://docs.amazonaws.cn/AmazonS3/latest/userguide/creating-bucket.html).
6464
2. Set bucket permissions. After the bucket is created successfully, select the bucket and click the **Permissions** tab. Based on your needs, you can set the bucket to public read/write, private, or other permissions.
65-
3. Obtain access keys. In the AWS Console, search for and select the **IAM** service. Create a new user for S3 and obtain the Access Key and Secret Key.
65+
3. Obtain access keys.
66+
- **Manual Configuration**: In the AWS Console, search for and select the **IAM** service. Create a new user for S3 and obtain the Access Key ID and Secret Access Key. See [AWS guide: Managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).
67+
- **Automatic Retrieval (EC2 only)**: If EMQX is running on **AWS EC2**, [attach an **IAM role**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) with sufficient permissions. EMQX can automatically fetch temporary credentials from Instance Metadata via [**IMDSv2** API](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-metadata-security-credentials.html).
6668

6769
With the Amazon S3 bucket created and configured, you are now ready to create an Amazon S3 Sink in EMQX.
6870

@@ -103,13 +105,18 @@ Before adding the S3 Sink, you need to create the corresponding connector.
103105

104106
1. Go to the Dashboard **Integration** -> **Connector** page.
105107
2. Click the **Create** button in the top right corner.
106-
3. Select **Amazon S3** as the connector type and click next.
107-
4. Enter the connector name, a combination of upper and lowercase letters and numbers. Here, enter `my-s3`.
108+
3. Select **Amazon S3** as the connector type and click **Next**.
109+
4. Enter a name for the connector. The name must start with a letter or number and can contain letters, numbers, hyphens, or underscores. In this example, enter `my-s3`.
108110
5. Enter the connection information.
109111
- If you are using the Amazon S3 bucket, enter the following information:
110112
- **Host**: The host varies by region and is formatted as `s3.{region}.amazonaws.com`.
111113
- **Port**: Enter `443`.
112-
- **Access Key ID** and **Secret Access Key**: Enter the access keys created in AWS.
114+
- **Access Key ID** and **Secret Access Key**:
115+
116+
- Enter the access keys created in AWS, or
117+
- Leave blank if running EMQX on EC2 with an attached IAM role.
118+
119+
See the "Amazon S3" tab in [Prepare S3 Bucket](#prepare-s3-bucket) for details.
113120
- If you are using MinIO, enter the following information:
114121
- **Host**: Enter `127.0.0.1`. If you are running MinIO remotely, enter the actual host address.
115122
- **Port**: Enter `9000`.
-3.1 KB
Loading

zh_CN/access-control/authn/redis.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,26 @@ Redis 认证器支持使用 [Redis hashes](https://redis.io/docs/manual/data-typ
4747

4848
- Redis 数据库的连接设置:
4949

50-
- **部署模式**:选择 Redis 数据库的部署模式,可选值:**单节点****Sentinel****Cluster**
51-
- **服务****列表**):填入 Redis 服务器地址 (`host:port`) ;当部署模式选为 Sentinel 或 Cluster,您需在此提供所有相关 Redis 服务器的地址,不同地址之间以 `,` 分隔,格式为 `host1:port1,host2:port2,...`
52-
- **Sentinel 名字**:指定 Redis Sentinel 配置需要的[主服务器名称](https://redis.io/docs/manual/sentinel/#configuring-sentinel),仅需在**部署模式**设置为 **Sentinel** 时设置。
53-
- **数据库**:整数,用于指定 Redis 数据库的 Index。
54-
- **密码**:填入认证密码。
50+
- **部署模式**:选择 Redis 数据库的部署模式,可选值:**单节点****Sentinel****Cluster**
51+
52+
- **服务器地址**:填入 Redis 服务器地址 (`host:port`) ;当部署模式选为 Sentinel 或 Cluster,您需在此提供所有相关 Redis 服务器的地址,不同地址之间以 `,` 分隔,格式为 `host1:port1,host2:port2,...`
53+
54+
- **Sentinel 名字**(仅需在**部署模式**设置为 **Sentinel** 时设置):指定 Redis Sentinel 配置需要的[主服务器名称](https://redis.io/docs/manual/sentinel/#configuring-sentinel)
55+
56+
- **数据库**:整数,用于指定 Redis 数据库的 Index。
57+
58+
- **用户名**:指定用于连接 Redis 的用户名。如果您的 Redis 实例启用了 [Redis ACL](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/#create-and-edit-user-acls-with-the-acl-setuser-command)(在 Redis 6.0 引入)进行身份验证,则此字段为必填项。如果您的 Redis 使用默认用户(未启用或未强制使用 ACL),则可以留空此字段。
59+
60+
::: tip 提示
61+
62+
`username` 字段从 EMQX 5.2.0 版本开始支持。请确保您的部署版本为 5.2.0 或更高,以使用 Redis ACL 功能。
63+
64+
:::
65+
66+
- **密码**:指定用于连接 Redis 的用户密码。若 Redis 实例启用了身份验证,该字段为必填项。
67+
68+
- 如果填写了用户名,则此密码必须与 Redis ACL 配置中的凭据匹配。
69+
- 如果未填写用户名,则此密码将用于以 Redis 的 `default` 用户身份进行身份验证(前提是默认用户已启用)。
5570

5671
- 认证加密算法相关的配置:
5772

@@ -73,7 +88,20 @@ Redis 认证器支持使用 [Redis hashes](https://redis.io/docs/manual/data-typ
7388

7489
- **启用 TLS**:如果要启用TLS,请打开切换按钮。有关启用 TLS 的更多信息,请参见[网络和 TLS](../../network/overview.md)
7590

76-
- **命令**:Redis 查询命令。
91+
- **密码加密方式**:选择应用于明文密码的哈希算法,在将结果存储到数据库之前对密码进行加密。可选算法包括 `plain``md5``sha``sha256``sha512``bcrypt``pbkdf2`。具体配置取决于所选择的算法:
92+
- 选择 `md5``sha``sha256``sha512` 算法,需配置:
93+
- **加盐方式**:用于指定盐和密码的组合方式,可选值:`suffix`(在密码尾部加盐)、`prefix`(在密码头部加盐)、`disable`(不启用)。如果您不需要将用户凭据从外部存储迁移到 EMQX 内置数据库,可以保持默认值。
94+
- 生成的哈希值以十六进制字符串表示,并与存储的凭据进行不区分大小写的比对。
95+
- 选择 `plain`
96+
- **加盐值方式**:应设置为 `disable`
97+
- 选择 `bcrypt` 算法,需配置:
98+
- **Salt Rounds**:指定散列需要的计算次数(2^Salt Rounds),也称成本因子。默认值:`10`,可选值:`5``10`;数值越高,加密的安全性越高,因此建议采用较大的值,但相应的用户验证的耗时也会增加,您可根据业务需求进行配置。
99+
- 选择 `pbkdf2` 算法,需配置:
100+
- **伪随机函数**:指定生成密钥使用的散列函数,如 `sha256` 等。
101+
- **迭代次数**:指定散列次数,默认值:`4096`<!--后续补充取值范围-->
102+
- **密钥长度**(可选):指定希望得到的密钥长度。如不指定,密钥长度将由**伪随机函数**确定。
103+
- 生成的哈希值以十六进制字符串表示,并与存储的凭据进行不区分大小写的比对。
104+
- **命令**:Redis 查询命令。
77105

78106
- **高级设置**:在此部分设置并发连接。
79107
- **连接池大小**(可选):填入一个整数用于指定从 EMQX 节点到 Redis 数据库的并发连接数;默认值:`8`
102 KB
Loading

0 commit comments

Comments
 (0)