← 返回 Skills 市场
lolaopenclaw

Canary Deploy

作者 lolaopenclaw · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
360
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install canary-deploy
功能描述
Safe system changes with automatic baseline capture, canary testing, and rollback for critical infrastructure modifications. Use when making changes to SSH c...
使用说明 (SKILL.md)

Canary Deploy

Safe system changes with pre-flight checks, validation, and automatic rollback.

The Problem

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.

Quick Start

Before any critical change

# 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

For automated changes

# 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"

Protocol A+B (Manual Workflow)

For interactive sessions where you want human-in-the-loop:

Protocol A: Test interactively

  1. Tell the human: "Open a second SSH session as backup"
  2. Apply change in the first session
  3. Ask: "Test connectivity from the second session"
  4. If it works → confirm
  5. If it fails → rollback from the backup session

Protocol B: Backup first

  1. Run bash scripts/canary-test.sh baseline
  2. Verify backup is valid
  3. Apply change
  4. Run bash scripts/canary-test.sh validate
  5. If validation fails → bash scripts/canary-test.sh rollback

Always use both A + B together for maximum safety.

What Gets Checked

Baseline capture

  • SSH connectivity (local + remote)
  • Open ports (ss -tlnp)
  • Running services (systemctl)
  • Firewall rules (ufw/iptables)
  • Network routes
  • DNS resolution
  • Config file checksums

Validation

  • All baseline checks re-run
  • Diff against baseline
  • Any regression = FAIL

Critical Change Categories

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

References

See references/incident-report.md for the real incident that inspired this skill.

安全使用建议
This skill appears to implement what it claims, but review and do not run it blindly on production machines. Before using: (1) Inspect the two scripts yourself — they run arbitrary shell commands you supply (critical-update.sh uses eval) and use sudo for restore/firewall checks; avoid passing untrusted input to --command or --validate. (2) Ensure required utilities are present (ssh, ss, systemctl, jq, host, md5sum, ufw if used) and install them deliberately. (3) Test in an isolated VM or staging environment and use the --dry-run flag first. (4) Consider changing CANARY_DIR from /tmp to a secure location if you need persistent backups, and ensure backup files are protected. (5) Confirm the referenced config paths and service names match your system (remove or adapt openclaw-gateway entry if irrelevant). If you need lower risk, replace eval usage with explicit command execution or a safer wrapper that validates inputs before running.
功能分析
Type: OpenClaw Skill Name: canary-deploy Version: 1.0.0 The `scripts/critical-update.sh` file uses `eval` to execute user-provided `--command` and `--validate` arguments. This constitutes a direct Remote Code Execution (RCE) vulnerability, allowing arbitrary shell commands to be executed with the privileges of the script. While the skill's stated purpose is to apply system changes, this method of execution is inherently high-risk and could be exploited if the agent or user provides malicious input, even though there is no clear evidence of intentional malicious behavior (e.g., data exfiltration or persistence) within the skill's design itself.
能力评估
Purpose & Capability
The skill claims to perform safe canary deployments and included scripts implement baseline capture, validation, backup and rollback — this matches the description. However the registry metadata declares no required binaries or env vars while the scripts call many system utilities (ssh, ss, systemctl, sudo, ufw, host, md5sum, jq, awk, sed, grep, cp, etc.). The omission of those runtime requirements is an inconsistency the operator should be aware of.
Instruction Scope
SKILL.md tells users to run the included scripts which primarily inspect local system state and restore local backups — that is in-scope. Concerns: critical-update.sh uses eval to execute the provided --command and --validate strings (arbitrary shell execution), and the scripts call sudo for actions (ufw status, cp during rollback) which will run privileged operations. The scripts also reference platform-specific service names (openclaw-gateway) and specific config paths (/etc/ssh/sshd_config, /etc/ufw/user.rules) — expected but worth reviewing for your environment. There are no external network exfiltration endpoints.
Install Mechanism
No install spec (instruction-only plus included scripts). This is the lowest install risk — nothing is downloaded or automatically written somewhere during installation.
Credentials
The skill declares no required env vars and only optionally respects CANARY_DIR to override /tmp/canary-deploy. That is reasonable. However the scripts implicitly depend on local sudo privileges and on tools (jq, host, ss, systemctl, md5sum). These are not declared in metadata and some (sudo/writable backups) require elevated rights — make sure the operator understands and restricts who runs the scripts.
Persistence & Privilege
The skill does not request permanent platform presence (always:false). It writes baseline and backups by default to /tmp/canary-deploy and logs to $CANARY_DIR/changelog.log. It performs privileged operations via sudo when restoring or querying firewall/state. This is expected for a system-change helper but increases blast radius if run by an untrusted agent or user.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install canary-deploy
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /canary-deploy 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: canary-test.sh + critical-update.sh for safe system changes with baseline capture, validation, and automatic rollback
元数据
Slug canary-deploy
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Canary Deploy 是什么?

Safe system changes with automatic baseline capture, canary testing, and rollback for critical infrastructure modifications. Use when making changes to SSH c... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 360 次。

如何安装 Canary Deploy?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install canary-deploy」即可一键安装,无需额外配置。

Canary Deploy 是免费的吗?

是的,Canary Deploy 完全免费(开源免费),可自由下载、安装和使用。

Canary Deploy 支持哪些平台?

Canary Deploy 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Canary Deploy?

由 lolaopenclaw(@lolaopenclaw)开发并维护,当前版本 v1.0.0。

💬 留言讨论