Careful Company: File-Transfer Egress
careful_company_running_windows.transfer
Blocks outbound file transfer: scp/pscp/sftp/psftp/WinSCP to a remote destination, scripted FTP and `tftp put`, rsync to a remote, rclone to a remote, cloud-storage uploads (`aws s3 cp` local->s3://, `s3api put-object`, `az storage blob upload`, azcopy, `gsutil cp`->gs://, b2/s3cmd/mc/wrangler r2/supabase), peer-to-peer senders (croc/wormhole/ffsend/Taildrop), WebDAV mounts, and copy LOLBins (`esentutl /y`, `print /D:`, `diantz`). Package publishes and git remote-URL changes warn.
- 21blocking rules
- 6safe patterns
- 15High
- 6Medium
[packs]
enabled = ["careful_company_running_windows.transfer"]Evaluated when a command contains scp, SCP, Scp, pscp, PSCP, sftp, SFTP, psftp, winscp, WinSCP.
Blocking rules
Each rule ID is careful_company_running_windows.transfer:<name>. Use it in allowlists and [policy.rules].
Highaws-s3-api-uploads3api put-object uploads a local file to S3.
Explanation
`aws s3api put-object --body C:\data.zip` uploads without the `s3 cp` shape, so a rule keyed on operand order would miss it. (`create-multipart-upload` only reserves an upload id and moves no bytes, so it is deliberately not matched.) Safer alternatives: - `aws s3api get-object` / `list-objects` for the read direction - Use an internal artifact store for outbound copies
Highaws-s3-uploadaws s3 cp/sync/mv from a local path to s3:// uploads data to S3.
Explanation
The operand order decides the direction: a local source followed by an `s3://` destination is an upload. The reverse (`aws s3 cp s3://bucket/key .`) is a download and is not matched. Safer alternatives: - Reverse the operands if the intent was to fetch - Use an internal artifact store for outbound copies
Highazure-blob-uploadaz storage blob upload / azcopy sends local files to Azure Storage.
Explanation
`az storage blob upload -f C:\data.zip` and `azcopy copy "C:\repo" "https://acct.blob.core.windows.net/c?<SAS>"` upload to a storage account, frequently authenticated by a SAS token embedded in the URL rather than by a managed identity. Safer alternatives: - `az storage blob download` for the read direction - Confirm the storage account belongs to the organization
Highcopy-lolbin-to-remoteesentutl /y, diantz, and print /D: copy files to a remote share while posing as other tools.
Explanation
`esentutl /y source /d \\host\share\out` copies files that are *locked* by another process — live databases, credential stores — which an ordinary copy cannot touch. `diantz` writes a cab straight to a UNC path and `print /D:\\host\share` copies a file while claiming to print it. None of these is a normal way to move data. Safer alternatives: - Use `Copy-Item`/`robocopy` for legitimate copies (this pack does not match those) - Stop the process holding the file rather than copying it while locked
Highgcs-uploadgsutil/gcloud storage cp from a local path to gs:// uploads data to Cloud Storage.
Explanation
As with S3, the operand order decides direction; a local source with a `gs://` destination is an upload. Safer alternatives: - Reverse the operands to fetch instead - Use an internal artifact store
Highobject-store-cli-uploadb2/s3cmd/mc/wrangler r2/supabase upload local files to object storage.
Explanation
`b2 upload-file`, `s3cmd put`, and `wrangler r2 object put` are upload verbs by name. `mc cp`, `s3cmd sync`, and `supabase storage cp` take a direction, so those require a local source with a remote alias destination — the reverse order is a download and is not matched. Safer alternatives: - Use the corresponding download/list verb to inspect - Confirm the bucket belongs to the organization
Highpeer-to-peer-file-sendcroc/magic-wormhole/ffsend/Taildrop send files directly to another party.
Explanation
These tools exist to hand a file to someone else across the internet, usually via a relay and a short code. There is no read-only mode and no organizational control point in the path. Safer alternatives: - Use the company's file-sharing system so the transfer is logged
Highrclone-stream-or-publishrclone rcat/link/serve streams data out, mints a public URL, or exposes a local directory.
Explanation
`rclone rcat remote:file` writes standard input straight to a remote with no local path on the command line; `rclone link` mints a shareable public URL for an object; `rclone serve http|webdav|ftp` publishes a local directory as a network service. Safer alternatives: - Use an internal share for anything that needs to be reachable - `rclone ls`/`lsd` to inspect without exposing
Highrclone-to-remoterclone copying to a configured remote sends data to that provider.
Explanation
`rclone copy C:\repo remote:path` uploads to whatever cloud provider `remote:` is configured for. A remote name needs at least two characters, so a Windows drive letter (`D:`) is never mistaken for one and purely local copies are unaffected. Safer alternatives: - `rclone copy remote:path C:\local` (the download direction) is not matched - `rclone lsd` / `rclone about` to inspect a remote without moving data
Highrsync-to-remotersync with a remote destination copies local files off this machine.
Explanation
As with scp, the remote endpoint in the final position means data is leaving. `rsync src user@host:/dst`, `rsync src rsync://host/mod`, and `rsync src host::mod` are all the outbound direction. Safer alternatives: - Sync to an internal host - Reverse the operands if the intent was to pull data in
Highscp-destination-unverifiedscp/pscp has a runtime-dependent or malformed destination whose perimeter cannot be verified.
Explanation
The final transfer target is supplied through shell expansion or malformed remote syntax, so dcg cannot prove that it remains on this workstation or inside the organization. Use a literal local path or reviewed internal host before retrying.
Highscp-to-remotescp with a remote destination copies local files off this machine.
Explanation
In `scp SOURCE DEST`, a `user@host:path` in the final position means the file is going out. The reverse order (`scp user@host:/data/f .`) is a download and is not matched, and copies to internal hosts are whitelisted. Safer alternatives: - Copy to an internal host (RFC1918, *.internal/*.corp, or a bare intranet name) - Ask the operator to perform the transfer
Hightftp-puttftp put uploads a local file to a remote host.
Explanation
`tftp -i host put C:\data.bin` uploads over an unauthenticated, unencrypted protocol. `get` is the download direction and is not matched. Safer alternatives: - Use an authenticated internal transfer path
Hightransfer-script-with-visible-putAn sftp/WinSCP command with a visible put uploads the named file.
Explanation
When the `put` (or WinSCP `/upload`) is on the command line, the direction is not in doubt: a local file is going to the remote side. `echo put secrets.zip | sftp -b - user@host` is the same operation with the command supplied on standard input. Safer alternatives: - Use `get` if the intent was to fetch - Transfer to an internal host instead
Highwebdav-remote-mountMounting a WebDAV/HTTP location as a drive creates a file-copy channel over the web.
Explanation
`New-PSDrive -Root \\host@SSL\DavWWWRoot\path` and `net use Z: http://host/dav` mount an internet location as a drive letter. Once mounted, an ordinary `copy` moves data out with nothing suspicious on the command line — the `@SSL` and `DavWWWRoot` markers are the only tell. Safer alternatives: - Map internal SMB shares (`\\fileserver\share`), which this pack does not match - Use the approved file-transfer path
Mediumaws-s3-presignaws s3 presign mints a URL that anyone holding it can fetch.
Explanation
`aws s3 presign s3://bucket/key --expires-in 604800` transfers nothing itself, but it produces a link that grants unauthenticated access to the object for up to a week — egress by reference. It warns rather than blocks because sharing a time-limited link is also a legitimate way to hand a large file to a reviewed recipient. Safer alternatives: - Grant access through IAM rather than a bearer URL - Shorten `--expires-in` and confirm who will receive the link
Mediumgit-push-explicit-urlPushing to a URL instead of a named remote sends the repository to an ad-hoc destination.
Explanation
`git push https://host/repo.git HEAD:main` needs no configured remote at all, so the destination never appears in `git remote -v` and leaves no trace in the repository config. Credentials embedded in the URL are a further signal. Ordinary `git push origin main` is not matched. Safer alternatives: - Push to a configured remote by name - Confirm the URL's host is organization-controlled
Mediumgit-remote-url-changeAdding or repointing a git remote changes where a later push sends the repository.
Explanation
`git remote set-url origin <url>` is subtler than adding a remote: every subsequent `git push` looks completely routine while going somewhere new. `git config remote.origin.url` does the same without the `git remote` wording. Warned rather than blocked because repointing a remote is also ordinary maintenance. Safer alternatives: - `git remote -v` to see the current remotes before changing them - Confirm the new host is organization-controlled
Mediumopaque-transfer-scriptA scripted sftp/ftp/WinSCP session runs transfer commands that are not visible here.
Explanation
`sftp -b batch.txt host`, `ftp -n -s:cmds.txt host`, and `winscp /script=file` read their operations from a file, so whether this is an upload or a download cannot be determined from the command line. Warned rather than blocked precisely because the direction is unproven — the same standard applied everywhere else in this preset. A visible `put` on the line raises it to the blocking rule above. The stdin form (`sftp -b -`) is excluded from this warning so the whole pipeline remains visible to that higher-confidence rule. Safer alternatives: - Print the batch/script file first so the operations are reviewable - Transfer to an internal host instead
Mediumpackage-publish-to-registryPublishing a package uploads the project's contents to a registry.
Explanation
`npm publish`, `cargo publish`, `twine upload`, `nuget push`, and friends upload the built package — which for many projects includes the source — to a registry that is usually public and, once published, effectively permanent. Warned rather than blocked because releasing is legitimate work; publishing to a local path or an internal registry is whitelisted. Safer alternatives: - `npm publish --dry-run` / `cargo publish --dry-run` to check without uploading - Publish to the internal registry (`--registry`/`--source` pointing at an internal host)
Mediumsftp-remote-sessionAn sftp session to an external host is an interactive transfer channel.
Explanation
An interactive `sftp` session can `put` any readable file, and nothing about which files appears on the command line. This warns rather than blocks because the same session is equally often used to fetch something. Safer alternatives: - Use an explicit one-shot copy so the transfer is visible - Connect to an internal host
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
read-only-data-contextdcg-self-inspectioninternal-ssh-targetinternal-sftp-sessioninternal-registry-publishpackage-publish-dry-run