scp
remote.scp
Protects against destructive SCP operations like overwrites to system paths.
- 10blocking rules
- 5safe patterns
- 5Critical
- 5High
[packs]
enabled = ["remote.scp"]Evaluated when a command contains scp, pscp.
Blocking rules
Each rule ID is remote.scp:<name>. Use it in allowlists and [policy.rules].
Criticalscp-recursive-rootscp -r to root (/) is extremely dangerous.
Explanation
Recursive copy to the root filesystem can overwrite critical system files, potentially rendering the system unbootable. This affects all system directories including /etc, /bin, /lib, and /boot. Safer alternatives: - Specify a target subdirectory instead of / - Use rsync with --dry-run to preview changes - Copy to /tmp first and move files individually
Criticalscp-to-binscp to /bin/ or /sbin/ can overwrite system binaries.
Explanation
The /bin and /sbin directories contain essential system binaries required for basic operation. Overwriting these can make the system unusable and require rescue mode recovery. Safer alternatives: - Install custom scripts to /usr/local/bin - Use package managers for system updates - Test binaries in user directories first
Criticalscp-to-bootscp to /boot/ can corrupt boot configuration.
Explanation
The /boot directory contains the kernel, initramfs, and bootloader configuration. Corrupting these files will prevent the system from booting, requiring rescue media to recover. Safer alternatives: - Use package manager for kernel updates - Keep backup kernels available - Test changes in a VM first
Criticalscp-to-libscp to /lib/ can overwrite system libraries.
Explanation
The /lib and /lib64 directories contain shared libraries required by system binaries. Overwriting these can cause immediate system instability and prevent commands from running. Safer alternatives: - Use package managers for library updates - Install custom libraries to /usr/local/lib - Use LD_LIBRARY_PATH for testing
Criticalscp-to-windows-systemscp/pscp targets a protected Windows system directory on the remote host.
Explanation
Copying into a remote drive root, Windows, Program Files, ProgramData, Boot, or EFI tree can overwrite operating-system files and make the destination host unusable. Stage the payload in a non-system directory and install it through a reviewed deployment mechanism.
Highscp-destination-unverifiedscp/pscp has a runtime-dependent or malformed destination that cannot be verified before execution.
Explanation
A shell variable, expression, malformed URI, or otherwise unverified final operand can resolve to a protected local path or an arbitrary remote host. Use a literal destination so dcg can determine direction and target before the transfer runs.
Highscp-relative-traversalscp/pscp uses parent-directory traversal in a remote relative destination.
Explanation
Remote relative paths and tilde paths are resolved by the remote account. A `..` component can escape the account's apparent home/staging directory and overwrite a protected system location. Resolve the remote absolute path first and use a traversal-free destination.
Highscp-to-etcscp to /etc/ can overwrite system configuration.
Explanation
The /etc directory contains critical system configuration files including passwd, shadow, fstab, and network settings. Overwriting these can lock you out of the system or cause services to fail. Safer alternatives: - Copy to a staging directory first - Back up existing files before overwriting - Use configuration management tools (Ansible, etc.)
Highscp-to-usrscp to /usr/ can overwrite system binaries.
Explanation
The /usr directory contains system binaries, libraries, and shared resources. Overwriting files here can break system utilities and installed applications. Safer alternatives: - Use /usr/local for custom installations - Use package managers for system updates - Install to user directories when possible
Highscp-to-varscp to /var/ can overwrite system data.
Explanation
The /var directory contains variable data including logs, databases, mail spools, and application state. Overwriting this data can cause data loss and service disruptions. Safer alternatives: - Use /var/tmp for temporary staging - Stop affected services before modifying their data - Back up existing data first
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
scp-helpscp-downloadscp-to-homescp-to-tmpscp-to-var-tmp