Skip to content

Commit c9dfbee

Browse files
committed
refactor: remove echo wrappers from step4 4.3 CI example, use plain code block
1 parent af58df4 commit c9dfbee

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • vault-tutorial/ch2-dev-mode/step4

vault-tutorial/ch2-dev-mode/step4/text.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ echo "已还原 Dev 模式(http://)"
9797
Dev 模式在以下场景中是**完全合理**的选择:
9898

9999
```bash
100-
# 模拟 CI 环境中的使用方式
101-
cat << 'SCRIPT'
102100
#!/bin/bash
103101
# .github/workflows/test.yml 或 Makefile 中的 vault 集成测试片段
104102

@@ -123,12 +121,10 @@ vault kv put secret/config db_url="test://localhost/testdb"
123121
./run-integration-tests.sh
124122

125123
# 容器销毁时所有数据随之消失,无需清理
126-
SCRIPT
127-
128-
echo "以上是 CI pipeline 中安全使用 Dev 模式的标准模板"
129-
echo "关键要素:隔离容器 + 已知 Token + 测试结束即销毁"
130124
```
131125

126+
关键要素:**隔离容器 + 已知 Token + 测试结束即销毁**。三个条件缺一不可,缺少任何一个都会让上面分析过的风险重新成立。
127+
132128
## 4.4 生产 Vault 的正确初始化流程预览
133129

134130
Dev 模式"short-circuit"了生产环境中每一个有意义的安全步骤:

0 commit comments

Comments
 (0)