name: canary-deploy description: Safe system changes with automatic baseline capture, canary testing, and rollback for critical infrastructure modifications. Use when making changes to SSH config, firewall rules, network settings, systemd services, kernel parameters, or any system change that could break remote access. Prevents lockouts by validating connectivity before and after changes. Born from a real incident where AllowTcpForwarding=no killed VPN tunnel access.
Safe system changes with pre-flight checks, validation, and automatic rollback.
System changes can lock you out: - SSH hardening breaks remote access - Firewall rules block needed ports - Kernel parameters cause instability - Service restarts break dependencies
Recovery without physical access is painful or impossible.
# Capture baseline (connectivity, services, ports)
bash scripts/canary-test.sh baseline
# Make your change
sudo nano /etc/ssh/sshd_config
# Validate change didn't break anything
bash scripts/canary-test.sh validate
# If validation fails:
bash scripts/canary-test.sh rollback
# Full pipeline: baseline → apply → validate → rollback-if-failed
bash scripts/critical-update.sh \
--name "SSH hardening" \
--backup "/etc/ssh/sshd_config" \
--command "sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config && sudo systemctl reload sshd" \
--validate "ssh -o ConnectTimeout=5 localhost echo ok"
For interactive sessions where you want human-in-the-loop:
bash scripts/canary-test.sh baselinebash scripts/canary-test.sh validatebash scripts/canary-test.sh rollbackAlways use both A + B together for maximum safety.
小葱技能站7w4.net每天更新,海量AI技能等你发现。
| Category | Risk | Example | Recovery |
|---|---|---|---|
| SSH config | 🔴 HIGH | sshd_config changes | Backup session |
| Firewall | 🔴 HIGH | UFW/iptables rules | Pre-change snapshot |
| Network | 🔴 HIGH | Interface/routing changes | Console access |
| Services | 🟡 MEDIUM | systemd unit changes | systemctl restart |
| Kernel params | 🟡 MEDIUM | sysctl changes | Reboot to defaults |
| Packages | 🟢 LOW | apt install/upgrade | apt rollback |
See references/incident-report.md for the real incident that inspired this skill.
这是一款质量可靠的系统安全变更工具,文档清晰易读,操作流程直观好记。它能有效防止 SSH 配置、防火墙规则等关键变更导致的系统锁定问题,自动化回滚机制在变更失败时能快速恢复。主要优点是实用性强、流程完整;不足之处是对特定系统环境的适配性有限,某些边界情况的处理还可以更细致。总体来说值得信赖,适合在生产环境中使用。