mgmt/security
Houzhong Xu 1eafce7290
Deploy Nomad Configurations / deploy-nomad (push) Failing after 29s Details
Infrastructure CI/CD / Validate Infrastructure (push) Failing after 11s Details
Simple Test / test (push) Successful in 1s Details
Infrastructure CI/CD / Plan Infrastructure (push) Has been skipped Details
Infrastructure CI/CD / Apply Infrastructure (push) Has been skipped Details
🎉 Complete Nomad monitoring infrastructure project
 Major Achievements:
- Deployed complete observability stack (Prometheus + Loki + Grafana)
- Established rapid troubleshooting capabilities (3-step process)
- Created heatmap dashboard for log correlation analysis
- Unified logging system (systemd-journald across all nodes)
- Configured API access with Service Account tokens

🧹 Project Cleanup:
- Intelligent cleanup based on Git modification frequency
- Organized files into proper directory structure
- Removed deprecated webhook deployment scripts
- Eliminated 70+ temporary/test files (43% reduction)

📊 Infrastructure Status:
- Prometheus: 13 nodes monitored
- Loki: 12 nodes logging
- Grafana: Heatmap dashboard + API access
- Promtail: Deployed to 12/13 nodes

🚀 Ready for Terraform transition (静默一周后切换)

Project Status: COMPLETED 
2025-10-12 09:15:21 +00:00
..
scripts 🎉 Complete Nomad monitoring infrastructure project 2025-10-12 09:15:21 +00:00
README.md 🎉 Complete Nomad monitoring infrastructure project 2025-10-12 09:15:21 +00:00
cf-tokens.txt Clean repository: organized structure and GitOps setup 2025-10-09 06:13:45 +00:00
grafana-api-credentials.md 🎉 Complete Nomad monitoring infrastructure project 2025-10-12 09:15:21 +00:00

README.md

Security 目录说明

目录结构

security/
├── secrets/          # 敏感配置文件
│   ├── vault-unseal-keys.txt    # Vault解封密钥
│   ├── vault-root-token.txt     # Vault根令牌
│   ├── vault-cluster-info.txt   # Vault集群信息
│   └── *.hcl                   # 其他配置文件
├── scripts/          # 批量部署脚本
├── templates/        # 配置模板
└── README.md         # 本文件

Vault密钥管理

密钥文件说明

  • vault-unseal-keys.txt: 包含5个Vault解封密钥需要至少3个才能解封Vault
  • vault-root-token.txt: Vault根令牌拥有完全管理权限
  • vault-cluster-info.txt: Vault集群的基本信息和配置

使用Vault密钥

# 解封Vault需要3个密钥
vault operator unseal -address=http://warden.tailnet-68f9.ts.net:8200 <key1>
vault operator unseal -address=http://warden.tailnet-68f9.ts.net:8200 <key2>
vault operator unseal -address=http://warden.tailnet-68f9.ts.net:8200 <key3>

# 使用根令牌认证
export VAULT_TOKEN=hvs.TftK5zfANuPWOc7EQEvjipCE
vault auth -address=http://warden.tailnet-68f9.ts.net:8200

安全注意事项

  1. 密钥保护: 所有Vault密钥文件权限设置为600仅所有者可读写
  2. 备份策略: 定期备份密钥文件到安全位置
  3. 访问控制: 限制对security目录的访问权限
  4. 版本控制: 不要将密钥文件提交到Git仓库

使用说明

1. 配置文件管理

  • 将需要上传的敏感配置文件放在 secrets/ 目录下
  • 文件名格式:{节点名}-{配置类型}.{扩展名}
  • 例如:ch4-nomad.hclash3c-consul.json

2. 批量部署脚本

使用 scripts/deploy-security-configs.sh 脚本批量部署:

# 部署所有配置
./scripts/deploy-security-configs.sh

# 部署特定节点
./scripts/deploy-security-configs.sh ch4

# 部署特定类型
./scripts/deploy-security-configs.sh all nomad

3. 配置模板

  • templates/ 目录存放配置模板
  • 支持变量替换
  • 使用 Jinja2 语法

安全注意事项

  1. 本地备份:所有配置文件在上传前都会在本地保存备份
  2. 权限控制确保配置文件权限正确600 或 644
  3. 敏感信息:不要在配置文件中硬编码密码或密钥
  4. 版本控制:使用 Git 跟踪配置变更,但排除密钥文件

部署流程

  1. 将配置文件放入 secrets/ 目录
  2. 检查配置文件格式和内容
  3. 运行批量部署脚本
  4. 验证部署结果
  5. 清理临时文件

故障恢复

如果部署失败:

  1. 检查 logs/ 目录下的错误日志
  2. 使用备份文件恢复
  3. 重新运行部署脚本

联系方式

如有问题,请联系系统管理员。