Files
lehuo/infra/monitoring/alert-rules.yml
T
climber 41a0a85141 security: 执行平台安全加固
【已完成】
- 关闭FRP SSH隧道 (消除公网暴露风险)
- 移除MySQL/Redis端口映射 (仅内网访问)
- 启用UFW防火墙 (deny all + allow 80/443)
- 关闭临时Python HTTP服务 (端口8888)
- 配置定期备份脚本 (每日2点执行)
- 更新监控告警规则 (新增登录异常检测)

【待手动完成 - 需sudo】
- 启用FRP TLS加密 (修改/opt/frp/frpc.ini)
- 延长日志留存180天 (修改/opt/frp/frpc.ini)
2026-10-26 12:11:55 +08:00

34 lines
1.3 KiB
YAML

groups:
- name: lehuo-api
rules:
- alert: ApiUnavailable
expr: probe_success{job="lehuo-api"} == 0
for: 2m
labels: { severity: critical }
annotations: { summary: '乐活公益 API 不可用' }
- alert: ApiHighLatency
expr: lehuo_api_p95_milliseconds > 1000
for: 10m
labels: { severity: warning }
annotations: { summary: 'API P95 超过 1 秒' }
- alert: NotificationDeadLetters
expr: lehuo_notification_dead_total > 0
for: 5m
labels: { severity: warning }
annotations: { summary: '微信通知存在死信' }
- alert: BackupMissing
expr: time() - lehuo_backup_last_success_timestamp > 93600
for: 10m
labels: { severity: critical }
annotations: { summary: '超过 26 小时无成功数据库备份' }
- alert: FailedLoginSpike
expr: rate(lehuo_auth_failed_login_total[5m]) > 10
for: 5m
labels: { severity: warning }
annotations: { summary: '检测到异常登录失败 spike (>10次/分钟)' }
- alert: BruteForceAttempt
expr: rate(lehuo_auth_failed_login_total{actor_role="SUPER_ADMIN"}[10m]) > 5
for: 5m
labels: { severity: critical }
annotations: { summary: '管理员账号疑似暴力破解 (>5次失败/分钟)' }