Urgent.News

What's breaking now, across thousands of outlets.

Tech

Blast radius is the unit of trust

The permission is never the problem. The permission that outlived the task is the problem. Three things crossed my feed this week with the same shape: an agent that dropped a production database, an automation that ran until the money ran out, a mirror that got flattened by something that didn't know when to stop. Different stacks, different countries, one root cause. A credential, a mount, or a…

The core issue at hand is when permissions outlast the task for which they were intended. This occurs when a credential, mount, or network route is issued for one job and never revoked. The root cause is not tied to a poorly written prompt, but rather the failure to restrict access to resources after their intended use. A reporter has experienced this firsthand, granting an agent shell access to their host and spending a weekend troubleshooting the unauthorized file modifications.

The solution lies in minimizing the blast radius, which refers to the potential damage caused by a mistake. By employing a single container per task, disabling host mounts, and keeping network routes off by default, the reporter has found that a mistake becomes negligible. Each container self-destructs when the task concludes, eliminating any accumulated permissions or lingering access.

Instead of using a single agent process that holds onto resources for an extended period, the task-oriented approach ensures that each task has its own isolated environment, with permissions and access tightly controlled. Containerization plays a crucial role in achieving this granularity. The reporter uses Docker to create containers with specific configurations, such as being removed automatically after use (--rm), having network connections disabled (--network none), possessing read-only filesystems (--read-only), and operating with minimal privileges (--user, --cap-drop ALL, --security-opt no-new-privileges).

By implementing these measures, the reporter has managed to contain potential security breaches to the duration of a single task, effectively eliminating the risk of long-term damage. The reporter also emphasizes the importance of handling inputs and outputs securely, using separate mechanisms like docker cp to transfer data without granting the agent access to sensitive host directories.

Additionally, they recommend implementing a proxy sidecar with an allowlist for tasks that require network access, further limiting the sandbox's exposure. Another key aspect discussed is the expiration of credentials, which should be shorter than the container's lifetime. By minting tokens at the task's initiation, setting a shorter TTL, and validating outputs on the host, the reporter ensures that long-lived tokens are avoided.

This approach helps prevent secrets from being exposed through logs, crash dumps, or even intercepted communications. The reporter cites Docker's upcoming Sandboxes product as a promising development, aiming to provide disposable and isolated environments for agents. However, they stress that the principles outlined in their account are not exclusive to Docker and can be applied to any platform or framework.

The reporter concludes by sharing a simple cron job that periodically checks for containers exceeding their TTL (time-to-live) label, terminating them if necessary. This small script has proven effective in preventing unauthorized access and maintaining a secure environment. In summary, the reporter's account highlights the critical importance of minimizing the blast radius by employing containerized, task-oriented, and time-limited approaches to managing permissions and access.

By doing so, the risk of unauthorized actions, data breaches, and other security incidents can be significantly reduced.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Tuesday 6 October →