Skip to content

Commit 9253b61

Browse files
authored
Merge pull request #12 from rustfs/overtrue/docs-secure-credential-placeholders
docs: fill-in credential placeholders + secure-credential hints
2 parents 5bdc040 + aa784f0 commit 9253b61

11 files changed

Lines changed: 64 additions & 46 deletions

File tree

docs/developer/sdk/java.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public class RustfsS3Example {
6767
.region(Region.US_EAST_1) // 可写死,RustFS 不校验 region
6868
.credentialsProvider(
6969
StaticCredentialsProvider.create(
70-
AwsBasicCredentials.create("rustfsadmin", "change-your-password")
70+
// 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
71+
AwsBasicCredentials.create("<your-access-key>", "<your-secret-key>")
7172
)
7273
)
7374
.forcePathStyle(true) // 关键配置!RustFS 需启用 Path-Style
@@ -171,7 +172,8 @@ S3Presigner presigner = S3Presigner.builder()
171172
.region(Region.US_EAST_1)
172173
.credentialsProvider(
173174
StaticCredentialsProvider.create(
174-
AwsBasicCredentials.create("rustfsadmin", "change-your-password")
175+
// 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
176+
AwsBasicCredentials.create("<your-access-key>", "<your-secret-key>")
175177
)
176178
)
177179
.build();

docs/developer/sdk/javascript.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner
2727

2828
```
2929
Endpoint: http://192.168.1.100:9000
30-
Access Key: rustfsadmin
31-
Secret Key: change-your-password
30+
Access Key: <your-access-key>
31+
Secret Key: <your-secret-key>
3232
```
3333

3434
---
@@ -43,8 +43,9 @@ const s3 = new S3Client({
4343
endpoint: "http://192.168.1.100:9000", // RustFS endpoint
4444
region: "us-east-1", // 可随意填写
4545
credentials: {
46-
accessKeyId: "rustfsadmin",
47-
secretAccessKey: "change-your-password",
46+
// 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
47+
accessKeyId: "<your-access-key>",
48+
secretAccessKey: "<your-secret-key>",
4849
},
4950
forcePathStyle: true, // 必须启用 Path-style 以兼容 RustFS
5051
requestHandler: new NodeHttpHandler({

docs/developer/sdk/python.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ RustFS 是一款兼容 Amazon S3 协议的对象存储服务,支持通过 Pyth
3131

3232
```
3333
Endpoint: http://192.168.1.100:9000
34-
AccessKey: rustfsadmin
35-
SecretKey: change-your-password
34+
AccessKey: <your-access-key>
35+
SecretKey: <your-secret-key>
3636
```
3737

3838
### 2.2 安装 Boto3
@@ -58,8 +58,9 @@ from botocore.client import Config
5858
s3 = boto3.client(
5959
's3',
6060
endpoint_url='http://192.168.1.100:9000',
61-
aws_access_key_id='rustfsadmin',
62-
aws_secret_access_key='change-your-password',
61+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
62+
aws_access_key_id='<your-access-key>',
63+
aws_secret_access_key='<your-secret-key>',
6364
config=Config(signature_version='s3v4'),
6465
region_name='us-east-1'
6566
)

docs/installation/checklists/security-checklists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: "RustFS 安全检查清单(面向企业部署者),RustFS 是
3232
## 3. 环境变量与凭证保护
3333

3434
- **更改默认凭证**
35-
RustFS 初始化时如使用示例账号(如用户名 `rustfsadmin`),必须在部署后将密码更改为随机复杂密码
35+
切勿在生产环境保留示例占位符(`<your-access-key>` / `<your-secret-key>`)。初始化后应立即设置唯一的 access key 和强随机 secret(可用如 `openssl rand -base64 24` 生成)
3636

3737
- **安全存储凭证**
3838
不要将明文密码硬编码在脚本、镜像或日志中。使用环境变量或 Kubernetes Secret 管理密码。

docs/installation/cloud-native/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RustFS 提供了官方和 [Helm Chart](https://github.com/rustfs/rustfs/tree/mai
1515
| `replicaCount` | 集群的节点数量 | `4`(目前 16 节点正在测试中) |
1616
| `image.repository` | 镜像仓库 | `rustfs/rustfs` |
1717
| `image.tag` | 镜像 tag | `latest` |
18-
| `secret.rustfs.access_key` | RustFS access key | `rustfsadmin` |
19-
| `secret.rustfs.secret_key` | RustFS secret key | `change-your-password` |
18+
| `secret.rustfs.access_key` | RustFS access key | `<your-access-key>` |
19+
| `secret.rustfs.secret_key` | RustFS secret key | `<your-secret-key>` |
2020
| `storageclass.name` | StorageClass 的名称 | `local-path` |
2121
| `storageclass.size` | PVC 大小 | `256Mi`**一定根据自身需求设置好大小**|
2222
| `requests.cpu` | 请求的 CPU 大小 | `100m`**一定根据自身需求设置好大小**|
@@ -60,7 +60,7 @@ NAME CLASS HOSTS ADDRESS PORTS AGE
6060
rustfs nginx your.rustfs.com 10.43.237.152 80, 443 29m
6161
```
6262

63-
使用 `https://your.rustfs.com` 并用上面配置的用户名和密码(本文示例为 `rustfsadmin` / `change-your-password`)登陆安装好的 RustFS 实例。请务必将密码替换为你自己的强密码
63+
使用 `https://your.rustfs.com` 并用上面配置的用户名和密码(`<your-access-key>` / `<your-secret-key>` 占位符)登陆安装好的 RustFS 实例。请用如 `openssl rand -base64 24` 生成强密码,切勿把占位符原样带到生产环境
6464

6565

6666
## 卸载

docs/installation/docker/index.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,41 +65,44 @@ RustFS SNSD Docker 运行方式,结合上述镜像与配置,执行:
6565
### 完整参数配置示例
6666

6767
```bash
68+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
6869
docker run -d \
6970
--name rustfs_container \
7071
-p 9000:9000 \
7172
-p 9001:9001 \
7273
-v /mnt/rustfs/data:/data \
73-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
74-
-e RUSTFS_SECRET_KEY=change-your-password \
74+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
75+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
7576
-e RUSTFS_CONSOLE_ENABLE=true \
7677
-e RUSTFS_SERVER_DOMAINS=example.com \
7778
rustfs/rustfs:latest \
7879
--address :9000 \
7980
--console-enable \
8081
--server-domains example.com \
81-
--access-key rustfsadmin \
82-
--secret-key change-your-password \
82+
--access-key "<your-access-key>" \
83+
--secret-key "<your-secret-key>" \
8384
/data
8485
```
8586

8687
### 参数说明与对应方法
8788

8889
1. **环境变量方式** (推荐):
8990
```bash
91+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
9092
-e RUSTFS_ADDRESS=:9000 \
9193
-e RUSTFS_SERVER_DOMAINS=example.com \
92-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
93-
-e RUSTFS_SECRET_KEY=change-your-password \
94+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
95+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
9496
-e RUSTFS_CONSOLE_ENABLE=true \
9597
```
9698

9799
2. **命令行参数方式**:
98100
```
101+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
99102
--address :9000 \
100103
--server-domains example.com \
101-
--access-key rustfsadmin \
102-
--secret-key change-your-password \
104+
--access-key "<your-access-key>" \
105+
--secret-key "<your-secret-key>" \
103106
--console-enable \
104107
```
105108

@@ -132,15 +135,16 @@ docker run -d \
132135

133136
3. **自定义认证密钥**:
134137
```bash
138+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
135139
docker run -d \
136140
-p 9000:9000 \
137141
-p 9001:9001 \
138142
-v /mnt/data:/data \
139-
-e RUSTFS_ACCESS_KEY=rustfsadmin \
140-
-e RUSTFS_SECRET_KEY=change-your-password \
143+
-e RUSTFS_ACCESS_KEY="<your-access-key>" \
144+
-e RUSTFS_SECRET_KEY="<your-secret-key>" \
141145
rustfs/rustfs:latest \
142-
--access-key rustfsadmin \
143-
--secret-key change-your-password \
146+
--access-key "<your-access-key>" \
147+
--secret-key "<your-secret-key>" \
144148
/data
145149
```
146150

@@ -207,7 +211,7 @@ CONTAINER ID IMAGE COMMAND
207211
e07121ecdd39 rustfs/rustfs:latest "/entrypoint.sh rust…" 2 seconds ago Up 1 second (health: starting) 0.0.0.0:9000-9001->9000-9001/tcp, :::9000-9001->9000-9001/tcp rustfs-server
208212
```
209213

210-
不管是单独启动 `rustfs-server` 还是和可观测性的服务一起启动,对于 RustFS 实例的访问都是通过 `http://localhost:9000`,并使用上面配置的 access key 和 secret key 登录(本文示例为用户名 `rustfsadmin`、密码 `change-your-password`)。请务必将密码替换为你自己的强密码
214+
不管是单独启动 `rustfs-server` 还是和可观测性的服务一起启动,对于 RustFS 实例的访问都是通过 `http://localhost:9000`,并使用上面配置的 access key 和 secret key 登录(`<your-access-key>` / `<your-secret-key>` 占位符)。请用如 `openssl rand -base64 24` 生成强密码,切勿把占位符原样带到生产环境
211215

212216
### 部署示例
213217

@@ -249,8 +253,9 @@ services:
249253
- RUSTFS_CORS_ALLOWED_ORIGINS=*
250254
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
251255
# 访问密钥(生产环境请修改为强密码)
252-
- RUSTFS_ACCESS_KEY=rustfsadmin
253-
- RUSTFS_SECRET_KEY=change-your-password
256+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
257+
- RUSTFS_ACCESS_KEY=<your-access-key>
258+
- RUSTFS_SECRET_KEY=<your-secret-key>
254259
# 日志级别
255260
- RUSTFS_OBS_LOGGER_LEVEL=info
256261

@@ -435,12 +440,13 @@ nginx -t && nginx -s reload
435440
```
436441
https://console.example.com
437442
```
438-
使用账号密码登录(本文示例为用户名 `rustfsadmin`、密码 `change-your-password`
443+
使用账号密码登录(`<your-access-key>` / `<your-secret-key>` 占位符,请替换为你自己的值
439444

440445
2. **测试 S3 API**
441446
```bash
447+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
442448
# 使用 mc 客户端
443-
mc alias set myrustfs https://s3.example.com rustfsadmin change-your-password
449+
mc alias set myrustfs https://s3.example.com "<your-access-key>" "<your-secret-key>"
444450
mc mb myrustfs/test-bucket
445451
mc ls myrustfs
446452
```
@@ -481,7 +487,8 @@ nginx -t && nginx -s reload
481487
使用 `mc` 或其他 S3 客户端:
482488

483489
```bash
484-
mc alias set rustfs http://localhost:9000 rustfsadmin change-your-password
490+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
491+
mc alias set rustfs http://localhost:9000 "<your-access-key>" "<your-secret-key>"
485492
mc mb rustfs/mybucket
486493
mc ls rustfs
487494
```

docs/installation/linux/multiple-node-multiple-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ mv rustfs /usr/local/bin/
249249
```bash
250250
# 多机多盘模式
251251
sudo tee /etc/default/rustfs <<EOF
252-
RUSTFS_ACCESS_KEY=rustfsadmin
253-
RUSTFS_SECRET_KEY=change-your-password
252+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
253+
RUSTFS_ACCESS_KEY=<your-access-key>
254+
RUSTFS_SECRET_KEY=<your-secret-key>
254255
RUSTFS_VOLUMES="http://node{1...4}:9000/data/rustfs{0...3}"
255256
RUSTFS_ADDRESS=":9000"
256257
RUSTFS_CONSOLE_ENABLE=true

docs/installation/linux/single-node-multiple-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,9 @@ mv rustfs /usr/local/bin/
225225
```bash
226226
# 单机多盘模式
227227
sudo tee /etc/default/rustfs <<EOF
228-
RUSTFS_ACCESS_KEY=rustfsadmin
229-
RUSTFS_SECRET_KEY=change-your-password
228+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
229+
RUSTFS_ACCESS_KEY=<your-access-key>
230+
RUSTFS_SECRET_KEY=<your-secret-key>
230231
RUSTFS_VOLUMES="/data/rustfs{0...3}"
231232
RUSTFS_ADDRESS=":9000"
232233
RUSTFS_CONSOLE_ENABLE=true

docs/installation/linux/single-node-single-disk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ mv rustfs /usr/local/bin/
220220
```bash
221221
# 单机单盘模式
222222
sudo tee /etc/default/rustfs <<EOF
223-
RUSTFS_ACCESS_KEY=rustfsadmin
224-
RUSTFS_SECRET_KEY=change-your-password
223+
# 请替换下面的占位符;可用如 openssl rand -base64 24 生成强密码
224+
RUSTFS_ACCESS_KEY=<your-access-key>
225+
RUSTFS_SECRET_KEY=<your-secret-key>
225226
RUSTFS_VOLUMES="/data/rustfs0"
226227
RUSTFS_ADDRESS=":9000"
227228
RUSTFS_CONSOLE_ENABLE=true

docs/integration/milvus.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ Milvus 官方提供 [`docker-compose.yml`](https://github.com/milvus-io/milvus/b
3838
- RUSTFS_EXTERNAL_ADDRESS=:9000
3939
- RUSTFS_CORS_ALLOWED_ORIGINS=*
4040
- RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
41-
- RUSTFS_ACCESS_KEY=rustfsadmin
42-
- RUSTFS_SECRET_KEY=change-your-password
41+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
42+
- RUSTFS_ACCESS_KEY=<your-access-key>
43+
- RUSTFS_SECRET_KEY=<your-secret-key>
4344
ports:
4445
- "9000:9000" # S3 API port
4546
- "9001:9001" # Console port
@@ -95,8 +96,9 @@ minio 的信息(包括地址、access_key、access_secret 等)都写在 [`mi
9596
rustfs:
9697
address: localhost:9000
9798
port: 9000
98-
accessKeyID: rustfsadmin
99-
secretAccessKey: change-your-password
99+
# 使用独立的 access key 和强随机 secret(可用如 openssl rand -base64 24 生成)
100+
accessKeyID: <your-access-key>
101+
secretAccessKey: <your-secret-key>
100102
useSSL: false
101103
bucketName: "rustfs-bucket"
102104
```

0 commit comments

Comments
 (0)