fix(19.3): add security trade-off note for cAdvisor privileged: true

The cAdvisor compose examples in 19.3.3 use `privileged: true`, which
contradicts the minimum-privilege / cap_drop=all guidance in chapter 18.
Add an explicit trade-off note before the first cAdvisor snippet
explaining the inconsistency and pointing to 18.4 for capability-based
hardening alternatives (cap_add: [SYS_ADMIN] + device_cgroup_rules
instead of full privileged mode).

This addresses the Round 1 review finding about pedagogical conflict
between the monitoring and security chapters.
This commit is contained in:
yeasy
2026-05-20 00:18:37 -07:00
parent 58504e9316
commit 4f92b3aa70
@@ -100,6 +100,8 @@ done
cAdvisor Google 开发的容器监控工具提供比 `docker stats` 更详细的性能数据 cAdvisor Google 开发的容器监控工具提供比 `docker stats` 更详细的性能数据
> ** 安全权衡提示**下面的示例为简化部署使用了 `privileged: true` [ 18 ](../18_security/README.md) "最小权限 / `cap_drop=all`"的原则相冲突生产环境建议改为按需授予能力 `cap_add: [SYS_ADMIN]` `device_cgroup_rules` 与精确的 `devices``volumes` 挂载并将 cAdvisor 部署在独立的监控网络中如何选择请参考 [18.4 ](../18_security/18.4_kernel_capability.md) 关于内核能力capabilities的细化授权
**Docker Compose 部署 cAdvisor** **Docker Compose 部署 cAdvisor**
```yaml ```yaml