devops-platform-patterns
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDevOps Platform Patterns
DevOps平台模式
Platform-specific verification checklists for infrastructure code.
针对基础设施代码的云平台专属验证检查清单。
DigitalOcean
DigitalOcean
| Check | Pass | Fail |
|---|---|---|
| VPC used for private networking | Private network configured | Public networking only |
| Reserved IPs for production | Static IPs assigned | Ephemeral IPs for critical services |
| Managed database in same region | Co-located DB | Cross-region latency |
| Spaces for state backend | Remote state in Spaces | Local state only |
| Firewall attached to all droplets | Firewall rules applied | No firewall |
Best Practices:
- Use for internal communication
digitalocean_vpc - Attach firewalls via with inbound rules
digitalocean_firewall - Store Terraform state in DigitalOcean Spaces with versioning
| 检查项 | 合格 | 不合格 |
|---|---|---|
| 使用VPC进行私有网络通信 | 已配置私有网络 | 仅使用公网 |
| 生产环境使用预留IP | 已分配静态IP | 关键服务使用临时IP |
| 托管数据库与服务同区域 | 数据库与服务同区域部署 | 跨区域部署导致延迟 |
| 使用Spaces作为状态后端 | 远程状态存储在Spaces中 | 仅使用本地状态 |
| 所有Droplets均关联防火墙 | 已应用防火墙规则 | 未配置防火墙 |
最佳实践:
- 使用进行内部通信
digitalocean_vpc - 通过关联防火墙并配置入站规则
digitalocean_firewall - 将Terraform状态存储在开启版本控制的DigitalOcean Spaces中
Hetzner
Hetzner
| Check | Pass | Fail |
|---|---|---|
| Private network configured | Network created | No private networking |
| Firewall rules defined | Rules restrict access | Open to internet |
| SSH keys managed via resource | | Keys in user_data only |
| Placement groups for HA | Servers distributed | Single point of failure |
Best Practices:
- Use +
hcloud_networkfor internal traffichcloud_network_subnet - Apply to all servers
hcloud_firewall - Use placement groups with type for critical workloads
spread
| 检查项 | 合格 | 不合格 |
|---|---|---|
| 已配置私有网络 | 已创建私有网络 | 未配置私有网络 |
| 已定义防火墙规则 | 规则限制访问范围 | 完全开放至互联网 |
| 通过资源管理SSH密钥 | 使用 | 仅在user_data中配置密钥 |
| 使用放置组实现高可用 | 服务器分布式部署 | 存在单点故障 |
最佳实践:
- 使用+
hcloud_network处理内部流量hcloud_network_subnet - 为所有服务器应用
hcloud_firewall - 针对关键工作负载使用类型的放置组
spread
AWS
AWS
| Check | Pass | Fail |
|---|---|---|
| VPC with private subnets | Multi-AZ VPC | Default VPC usage |
| Security groups least-privilege | Specific ports/IPs | 0.0.0.0/0 ingress |
| IAM roles over access keys | Instance profiles | Hardcoded credentials |
| KMS encryption for data | Customer-managed keys | No encryption |
| CloudTrail enabled | Audit logging on | No audit trail |
Best Practices:
- Never use default VPC for production
- Prefer with instance profiles over access keys
aws_iam_role - Enable S3 bucket versioning and encryption by default
- Use for sensitive data encryption
aws_kms_key
| 检查项 | 合格 | 不合格 |
|---|---|---|
| VPC配置私有子网 | 多可用区VPC | 使用默认VPC |
| 安全组遵循最小权限原则 | 仅开放特定端口/IP | 入站规则允许0.0.0.0/0 |
| 使用IAM角色而非访问密钥 | 使用实例配置文件 | 硬编码凭证 |
| 使用KMS加密数据 | 使用客户管理密钥 | 未加密 |
| 已启用CloudTrail | 审计日志已开启 | 无审计追踪 |
最佳实践:
- 生产环境绝不使用默认VPC
- 优先使用带实例配置文件的而非访问密钥
aws_iam_role - 默认启用S3存储桶版本控制与加密
- 使用加密敏感数据
aws_kms_key
Cloudflare
Cloudflare
| Check | Pass | Fail |
|---|---|---|
| API tokens over global key | Scoped tokens | Global API key |
| WAF rules configured | Protection enabled | No WAF |
| SSL mode is strict | Full (strict) mode | Flexible SSL |
| Rate limiting on endpoints | Rules applied | No rate limiting |
Best Practices:
- Create scoped API tokens per environment/purpose
- Set SSL mode to for origin protection
strict - Apply rate limiting to authentication endpoints
- Enable Bot Management if available
| 检查项 | 合格 | 不合格 |
|---|---|---|
| 使用API令牌而非全局密钥 | 使用范围限定的令牌 | 使用全局API密钥 |
| 已配置WAF规则 | 已启用防护 | 未配置WAF |
| SSL模式为严格模式 | 全(严格)模式 | 灵活SSL模式 |
| 端点已配置速率限制 | 已应用规则 | 未配置速率限制 |
最佳实践:
- 为每个环境/用途创建范围限定的API令牌
- 将SSL模式设置为以保护源站
strict - 为认证端点应用速率限制
- 若可用则启用Bot Management
Cross-Platform Checks
跨平台检查项
| Check | Applies To | Verification |
|---|---|---|
| Private networking | All | Internal services not exposed |
| Firewall/security groups | All | Explicit allow rules only |
| State backend remote | All | Not in local tfstate |
| Encryption at rest | All | Data encrypted |
| Audit logging | AWS, Cloudflare | Activity tracked |
| 检查项 | 适用平台 | 验证标准 |
|---|---|---|
| 私有网络通信 | 所有平台 | 内部服务不暴露至公网 |
| 防火墙/安全组配置 | 所有平台 | 仅配置明确的允许规则 |
| 远程状态后端 | 所有平台 | 不使用本地tfstate |
| 静态数据加密 | 所有平台 | 数据已加密 |
| 审计日志 | AWS、Cloudflare | 活动已被追踪 |