Cutters

Modular Remediation Strategies

Cutters are pluggable modules that execute specific remediation actions. Each cutter implements the Cutter interface and is registered in the global registry.

DockerCutter

Manages Docker containers on the target node.

Actions

ActionDescription
docker_pause_allPause all running containers
docker_stop_allStop all running containers
docker_kill_allKill all running containers (SIGKILL)

Policy Example

strategies:
  - threshold: 0.70
    action: docker_pause_all
  - threshold: 0.85
    action: docker_stop_all

NetworkCutter

Executes arbitrary SSH commands for network isolation.

Actions

ActionDescription
ssh_isolate_networkRun custom command via SSH

Policy Example

strategies:
  - threshold: 0.90
    action: ssh_isolate_network
    command: "systemctl stop wireguard@wg0"
    critical: true

Common Commands

# Stop WireGuard tunnel
command: "systemctl stop wireguard@wg0"

# Full network isolation
command: "wg-quick down wg0 && iptables -P INPUT DROP && iptables -P OUTPUT DROP"

# Kill specific service
command: "systemctl stop nginx"

VBoxCutter

Controls VirtualBox VMs for snapshot-based recovery.

Actions

ActionDescription
vbox_revert_snapshotRevert VM to named snapshot
vbox_poweroffPower off VM immediately

Policy Example

strategies:
  - threshold: 0.95
    action: vbox_revert_snapshot
    snapshot_name: "LAST_ORDERED_STATE"
    critical: true

snapshot_name must match an existing VirtualBox snapshot. Use VBoxManage snapshot list to verify.

Cutter Interface

All cutters implement this Go interface:

type Cutter interface {
    Name() string
    CanHandle(action string) bool
    Execute(ctx context.Context, target string, params map[string]string) error
}

type CutResult struct {
    Target    string
    Action    string
    Success   bool
    Error     error
    LatencyMs int64
}

Cutter Registry

Cutters are registered at startup and selected based on action name:

func NewRegistry() *Registry {
    return &Registry{
        cutters: []Cutter{
            NewDockerCutter(),
            NewNetworkCutter(),
            NewVBoxCutter(),
        },
    }
}

func (r *Registry) FindCutter(action string) (Cutter, bool) {
    for _, c := range r.cutters {
        if c.CanHandle(action) {
            return c, true
        }
    }
    return nil, false
}

Action Summary

ActionCutterSeverity
docker_pause_allDockerLow
docker_stop_allDockerMedium
docker_kill_allDockerHigh
ssh_isolate_networkNetworkHigh
vbox_revert_snapshotVBoxCritical
vbox_poweroffVBoxCritical