Understanding A Ship In A Bottle
A Ship In A Bottle is an open-source framework designed to simulate cyber attacks against containerized environments. It was originally built by researchers at Cisco Talos to help security teams test their defenses against threats targeting Docker and Kubernetes deployments. The tool works by creating intentionally vulnerable container setups that attackers can exploit, then it provides a way to observe and measure how those attacks play out in your environment. What makes it useful is that it gives you something you can't easily get elsewhere: a controlled, repeatable way to test whether your container security actually holds up when someone is trying to break in. You spin up the vulnerable containers, run attacks, and watch what happens. It's basically a gym for your security team to train with realistic threat scenarios.
How A Ship In A Bottle Actually Works
The framework runs entirely inside Docker containers. You pull the images, fire them up, and the tool generates attack scenarios based on real-world techniques from the MITRE ATT&CK framework. Each scenario has a specific goal, like escalating privileges inside a container or moving laterally across containers in a cluster. Here's the part most people miss though. The tool doesn't just run exploits and show you a pass or fail. It captures network traffic, system logs, and process activity during each attack, then compiles a report showing what the attacker was able to do and where your controls failed. That report is what you bring to your security meetings. I set one up recently for a client who was convinced their Kubernetes cluster was locked down tight. We ran A Ship In A Bottle through their environment and found three paths to cluster-admin that none of their policies actually blocked. One of them was a misconfigured service account that had been there since the cluster was first deployed two years prior. The other two involved container runtime settings they hadn't audited since the upgrade.
Getting It Running
You need Docker installed, obviously, and a working internet connection to pull the images. The basic setup takes about ten minutes if you're not fighting network issues. Clone the repository from GitHub, navigate into the directory, and run the setup script. It'll download the necessary images and build out the scenarios. Here's what the command flow looks like: First, clone the repo. Then check the README for any platform-specific notes because the Linux setup is slightly different from macOS. Run the initialization command to pull images. After that, you select which scenarios you want to run. The default set covers the most common attack patterns, but you can also pick individual scenarios if you want to focus on something specific like privilege escalation or credential theft.
Get the Full Details

One thing that trips people up is that some scenarios require a target environment to point at. If you're just running it locally with the sample containers, you're fine. But if you want to test against your own Kubernetes cluster, you need to configure the tool to connect to it properly, and that means your kubeconfig needs to be accessible from wherever you're running A Ship In A Bottle. I ran into a permissions issue once where the tool couldn't write its output because of how the Docker socket was mounted in our CI environment. The fix was straightforward but not obvious: we had to run the container with elevated privileges and point the output directory to a volume that had write access. Took about five minutes once I figured out what was wrong.
Running a Real Test
Start with the sample containers. Don't jump straight into your production environment. Run through the default scenarios and read the reports so you understand the output format. The tool generates HTML reports and also dumps raw data you can query if you need to dig deeper. When you're ready to test your own infrastructure, make sure you have approval to run attack simulations. This is offensive security tooling, and while the attacks are contained within your environment, running them without authorization creates problems regardless of intent. Get it in writing. Point A Ship In A Bottle at your test cluster or staging environment first. Watch how long the scenarios take. The full default set on a modern machine runs in roughly forty-five minutes to an hour. Individual scenarios vary. Privilege escalation ones are fast. Lateral movement scenarios take longer because they have to traverse multiple containers and often simulate network discovery first.
What the Reports Actually Tell You
Each scenario report breaks down the attack chain step by step. You'll see the initial access method, what credentials were obtained, how the attacker moved through the environment, and what level of access they ultimately achieved. The summary section gives you a high-level view, but the detailed breakdown is where you find the actual gaps in your defenses. Pay attention to the remediation recommendations. The tool includes them based on the specific techniques that succeeded. If the report says a particular container image had a known vulnerability and the attacker exploited it, you need to update that image. Not maybe. Not when you get around to it. Fix it before the next run. One counter-intuitive thing I learned from using this regularly is that the scenarios where you think you'll fail the hardest are often the ones you pass because of existing controls. The ones that surprise you are the simple misconfigurations that nobody documented and everyone assumed were handled. A dropped permission here, an overprovisioned service account there, a default password left in a config file that got committed to version control. Those are the things A Ship In A Bottle finds consistently.

Limitations You Should Know About
This tool isn't perfect and it won't replace a full penetration test. It's narrow by design. It focuses on container-specific attack paths and doesn't cover every angle a real attacker would use. If your exposure includes exposed APIs, weak authentication on management interfaces, or supply chain compromises, this tool won't find most of those. Another limitation is that it assumes a certain level of container orchestration knowledge. If you're running bare Docker without Kubernetes, some scenarios are irrelevant. If you're on a managed Kubernetes service with restricted API access, you may not have the permissions the tool needs to demonstrate certain attacks, which means you'll get false negatives where the tool appears to fail but the actual attack path would work with different permissions. There's also the question of how representative these scenarios are. They're based on documented techniques and real attacks, but they don't cover novel or custom exploit chains. A determined adversary with access to zero-days or bespoke tooling will find paths that A Ship In A Bottle doesn't even attempt to simulate.
Use this as part of a broader security program. It's good for container-specific validation, not a comprehensive security assessment. Pair it with regular vulnerability scanning, configuration reviews, and actual penetration testing if you want real confidence in your defenses. If you want to look at the project itself, it's available on GitHub under the name ship-in-a-bottle. The documentation covers installation details, scenario descriptions, and configuration options for connecting to different environments. Read through it before you start running tests because the configuration section has details about network setup and permission requirements that matter if you plan to integrate this into an ongoing security workflow.