Skip to content

Commit cf106fb

Browse files
authored
Merge pull request #18 from dash14/docs/refine-readme
Refine docs
2 parents c1dcc9e + 145413d commit cf106fb

File tree

13 files changed

+60
-69
lines changed

13 files changed

+60
-69
lines changed

.github/workflows/example-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Start buildcage builder
13+
- name: Start Buildcage builder
1414
id: buildcage
1515
uses: dash14/buildcage/setup@v1
1616
with:

.github/workflows/example-restrict.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Start buildcage builder
13+
- name: Start Buildcage builder
1414
id: buildcage
1515
uses: dash14/buildcage/setup@v1
1616
with:

README.md

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# buildcage
1+
# Buildcage
22

3-
![buildcage](./assets/banner.png)
3+
![Buildcage](./assets/banner.png)
44

55
[![GitHub](https://img.shields.io/badge/GitHub-dash14%2Fbuildcage-blue?logo=github)](https://github.com/dash14/buildcage)
66
![version](https://img.shields.io/github/v/release/dash14/buildcage
@@ -13,18 +13,18 @@
1313

1414
**Secure your Docker builds against supply chain attacks — restrict outbound network access to only the domains you allow.**
1515

16-
When you run `RUN npm install` or `RUN apt-get install` in a Dockerfile, those commands can reach any server on the internet — and you have no visibility or control over where they connect. A compromised dependency could silently exfiltrate your build secrets or phone home to an attacker's server.
16+
When you run `RUN npm install` or `RUN pip install` in a Dockerfile, those commands can execute arbitrary code and make outbound connections to any server on the internet — without visibility or control. A compromised dependency could silently exfiltrate your build secrets or phone home to an attacker's server.
1717

18-
buildcage prevents this. You define a list of allowed domains, and only those connections are permitted during builds. Everything else is blocked.
18+
Buildcage prevents this. You define a list of allowed domains, and only those connections are permitted during builds. Everything else is blocked.
1919

20-
No Dockerfile changes required. No certificates to install. Works with any language or package manager.
20+
No Dockerfile changes required. No proxy configuration needed. No certificates to install. Works with any language or package manager.
2121

2222

2323
## How It Works
2424

25-
buildcage runs as a [remote driver](https://docs.docker.com/build/builders/drivers/remote/) for Docker Buildx. All `RUN` step containers are placed on an isolated network, and outbound traffic is routed through a proxy that enforces your allowlist.
25+
Buildcage runs as a [remote driver](https://docs.docker.com/build/builders/drivers/remote/) for Docker Buildx. All `RUN` step containers are placed on an isolated network, and outbound traffic is routed through a proxy that enforces your allowlist.
2626

27-
<img src="assets/diagram-overview.png" alt="How buildcage works" width="544" height="328">
27+
<img src="assets/diagram-overview.png" alt="How Buildcage works" width="544" height="328">
2828

2929
- HTTPS: SNI (Server Name Indication) for domain matching — TLS is not terminated
3030
- HTTP: Host header for domain matching
@@ -40,9 +40,9 @@ buildcage runs as a [remote driver](https://docs.docker.com/build/builders/drive
4040

4141
### Recommended for:
4242

43-
- **CI/CD pipelines pulling from public registries** — if your builds download packages from npm, PyPI, RubyGems, or other public sources, buildcage limits the blast radius of compromised packages
44-
- **Builds that handle secrets** — if your Dockerfiles use build secrets, tokens, or credentials, buildcage prevents them from being exfiltrated to unauthorized servers
45-
- **Teams that need network visibility** — if you need to know exactly which external services your builds contact, buildcage logs every outbound connection and can enforce an allowlist
43+
- **CI/CD pipelines pulling from public registries** — if your builds download packages from npm, PyPI, RubyGems, or other public sources, Buildcage limits the blast radius of compromised packages
44+
- **Builds that handle secrets** — if your Dockerfiles use build secrets, tokens, or credentials, Buildcage prevents them from being exfiltrated to unauthorized servers
45+
- **Teams that need network visibility** — if you need to know exactly which external services your builds contact, Buildcage logs every outbound connection and can enforce an allowlist
4646

4747
### May not be necessary for:
4848

@@ -70,10 +70,10 @@ buildcage runs as a [remote driver](https://docs.docker.com/build/builders/drive
7070

7171
### First-Time Setup (Recommended Workflow)
7272

73-
Using buildcage in GitHub Actions involves three workflow steps:
73+
Using Buildcage in GitHub Actions involves three workflow steps:
7474

75-
1. Start the buildcage container (runs BuildKit inside a network-controlled environment)
76-
2. Configure Docker Buildx to use the buildcage container as a remote builder
75+
1. Start the Buildcage container (runs BuildKit inside a network-controlled environment)
76+
2. Configure Docker Buildx to use the Buildcage container as a remote builder
7777
3. Run your build as usual — your Dockerfile and build commands stay the same
7878

7979
#### Step 1: Discover what domains your build needs (Audit Mode)
@@ -89,7 +89,7 @@ jobs:
8989
steps:
9090
- uses: actions/checkout@v4
9191

92-
- name: Start buildcage in audit mode
92+
- name: Start Buildcage in audit mode
9393
id: buildcage
9494
uses: dash14/buildcage/setup@v1
9595
with:
@@ -107,7 +107,7 @@ jobs:
107107
context: .
108108
push: false # Set to true to push the built image
109109

110-
- name: Show buildcage report
110+
- name: Show Buildcage report
111111
if: always()
112112
uses: dash14/buildcage/report@v1
113113
with:
@@ -137,7 +137,7 @@ jobs:
137137
steps:
138138
- uses: actions/checkout@v4
139139
140-
- name: Start buildcage in restrict mode
140+
- name: Start Buildcage in restrict mode
141141
id: buildcage
142142
uses: dash14/buildcage/setup@v1
143143
with:
@@ -158,7 +158,7 @@ jobs:
158158
context: .
159159
push: false # Set to true to push the built image
160160
161-
- name: Show buildcage report
161+
- name: Show Buildcage report
162162
if: always()
163163
uses: dash14/buildcage/report@v1
164164
# Build fails if any unexpected connections were blocked
@@ -172,10 +172,10 @@ Your builds are now protected. Any unexpected connections will be blocked and re
172172

173173
### Setup Action (`dash14/buildcage/setup`)
174174

175-
Starts the buildcage builder container.
175+
Starts the Buildcage builder container.
176176

177177
```yaml
178-
- name: Start buildcage builder
178+
- name: Start Buildcage builder
179179
id: buildcage
180180
uses: dash14/buildcage/setup@v1
181181
with:
@@ -216,7 +216,7 @@ For detailed syntax, see [Rule Syntax](./docs/rules.md).
216216
|------|-------------|
217217
| `port` | BuildKit endpoint port |
218218

219-
Pass this port to [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action) to use buildcage as a remote builder:
219+
Pass this port to [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action) to use Buildcage as a remote builder:
220220

221221
```yaml
222222
- name: Set up Docker Buildx
@@ -294,7 +294,7 @@ In restrict mode, the report step fails if blocked connections are detected, cau
294294

295295
### For Technical Users
296296

297-
buildcage creates a controlled network environment for your Docker builds:
297+
Buildcage creates a controlled network environment for your Docker builds:
298298

299299
1. **BuildKit RUN steps run in isolated containers** connected to a private network (CNI)
300300
2. **All DNS queries return the proxy IP** (172.20.0.1), forcing traffic through the proxy
@@ -314,15 +314,15 @@ buildcage creates a controlled network environment for your Docker builds:
314314

315315
### Architecture Diagram
316316

317-
<img src="assets/diagram-architecture.png" alt="buildcage architecture" width="611" height="544">
317+
<img src="assets/diagram-architecture.png" alt="Buildcage architecture" width="611" height="544">
318318

319319
All containers spawned by BuildKit `RUN` steps are placed on an isolated network (CNI). DNS queries are redirected to the proxy IP, and the proxy checks each request's SNI (HTTPS) or Host header (HTTP) against the allowlist before forwarding or blocking.
320320

321321
---
322322

323323
## Trust & Self-Hosting
324324

325-
buildcage is a security tool — so it's fair to ask: *how do you trust buildcage itself?*
325+
Buildcage is a security tool — so it's fair to ask: *how do you trust Buildcage itself?*
326326

327327
A pre-built image from a third party could be modified or rebuilt at any time without your knowledge. For a tool that sits in your build pipeline, that's a risk worth addressing.
328328

@@ -344,21 +344,21 @@ If you don't need that level of control, you can use the image published from th
344344

345345
## Security Considerations
346346

347-
> **Important:** buildcage controls *where* your builds can connect, not *what code* they run. If a malicious package is delivered through a legitimate repository (e.g., a compromised npm package hosted on `registry.npmjs.org`), buildcage cannot detect or prevent it — the connection goes to an allowed domain.
347+
> **Important:** Buildcage controls *where* your builds can connect, not *what code* they run. If a malicious package is delivered through a legitimate repository (e.g., a compromised npm package hosted on `registry.npmjs.org`), Buildcage cannot detect or prevent it — the connection goes to an allowed domain.
348348
>
349-
> Do not rely on buildcage as your sole supply chain security measure. Use it as one layer in a defense-in-depth strategy — a last line of defense that limits the blast radius of compromised dependencies by restricting their ability to communicate with external servers.
349+
> Do not rely on Buildcage as your sole supply chain security measure. Use it as one layer in a defense-in-depth strategy — a last line of defense. If something slips through your other measures, at least it can't call home.
350350

351-
### What buildcage protects against
351+
### What Buildcage protects against
352352

353-
buildcage blocks outbound connections to domains not on your allowlist during Docker builds. This helps mitigate scenarios such as:
353+
Buildcage blocks outbound connections to domains not on your allowlist during Docker builds. This helps mitigate scenarios such as:
354354

355355
- **Data exfiltration** — prevents build secrets (e.g., environment variables, tokens) from being sent to external servers
356356
- **Command-and-control (C2) communication** — blocks compromised dependencies from phoning home to attacker-controlled servers
357357
- **Unexpected telemetry** — stops analytics, tracking, or other undisclosed network calls that packages may make during installation
358358

359359
### Security mechanisms and attack resistance
360360

361-
buildcage enforces network isolation through DNS-level control, HTTP/HTTPS proxy filtering, iptables rules, and CNI network isolation. These mechanisms defend against SNI spoofing, ECH bypass, DNS tunneling, non-TCP protocol tunneling, IPv6 bypass, and alternative DNS transports (DoH/DoT).
361+
Buildcage enforces network isolation through DNS-level control, HTTP/HTTPS proxy filtering, iptables rules, and CNI network isolation. These mechanisms defend against SNI spoofing, ECH bypass, DNS tunneling, non-TCP protocol tunneling, IPv6 bypass, and alternative DNS transports (DoH/DoT).
362362

363363
For full technical details, see the [Security Details](./docs/security.md) document.
364364

@@ -368,7 +368,7 @@ The only known bypass is **domain fronting** — a technique where an attacker s
368368

369369
## FAQ
370370

371-
- **Can I host buildcage in my own private repository?**
371+
- **Can I host Buildcage in my own private repository?**
372372

373373
Yes. See [Trust & Self-Hosting](#trust--self-hosting) for details.
374374

@@ -378,7 +378,7 @@ The only known bypass is **domain fronting** — a technique where an attacker s
378378

379379
- **Can I use this with multi-stage builds?**
380380

381-
Yes. buildcage works seamlessly with multi-stage Dockerfiles.
381+
Yes. Buildcage works seamlessly with multi-stage Dockerfiles.
382382

383383
- **Does this work with private package registries?**
384384

@@ -388,7 +388,7 @@ The only known bypass is **domain fronting** — a technique where an attacker s
388388

389389
In restrict mode, the build will fail with a clear error message. Run in audit mode first to discover all required domains.
390390

391-
- **Do I need to clean up the buildcage container?**
391+
- **Do I need to clean up the Buildcage container?**
392392

393393
No. The container is automatically removed when the GitHub Actions job completes.
394394

@@ -398,7 +398,7 @@ The only known bypass is **domain fronting** — a technique where an attacker s
398398

399399
- **Does this protect against malicious code execution?**
400400

401-
No. buildcage only controls network access. It doesn't prevent malicious code from running—it prevents that code from communicating with external servers.
401+
No. Buildcage only controls network access. It doesn't prevent malicious code from running—it prevents that code from communicating with external servers.
402402

403403
## Troubleshooting
404404

@@ -433,22 +433,13 @@ Contributions are welcome! Please feel free to submit issues or pull requests at
433433
## Show Your Support
434434

435435
Knowing that this project is useful to others gives me the motivation to keep working on it.
436-
If you find buildcage helpful, please consider giving it a star ⭐ on GitHub!
436+
If you find Buildcage helpful, please consider giving it a star ⭐ on GitHub!
437437

438438
## Disclaimer
439439

440440
This software is provided "as is", without warranty of any kind, express or implied. The authors and contributors are not liable for any damages, losses, or security incidents arising from the use of this software. Use at your own risk.
441441

442442
## License
443-
The buildcage source code is licensed under the MIT License. See [LICENSE](./LICENSE) file for details.
443+
The Buildcage source code is licensed under the MIT License. See [LICENSE](./LICENSE) file for details.
444444

445-
The Docker image includes third-party components under their own licenses (GPL, Apache 2.0, ISC, etc.). See [THIRD_PARTY_LICENSES](./THIRD_PARTY_LICENSES) for the full list.
446-
447-
## Acknowledgments
448-
449-
buildcage is built on top of:
450-
- [BuildKit](https://github.com/moby/buildkit) - Modern build toolkit
451-
- [CNI](https://github.com/containernetworking/cni) - Container network interface
452-
- [HAProxy](https://www.haproxy.org/) - TCP/HTTP proxy
453-
- [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html) - DNS server
454-
- [s6-overlay](https://github.com/just-containers/s6-overlay) - Process supervisor
445+
The Docker image includes third-party components under their own licenses (GPL, Apache 2.0, ISC, etc.). See [THIRD_PARTY_LICENSES](./THIRD_PARTY_LICENSES) for the full list.

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
I welcome reports about:
66

7-
- **Proxy bypass** — ways to make network connections from `RUN` steps that evade the buildcage proxy (other than the [known domain fronting limitation](./README.md#known-limitations))
7+
- **Proxy bypass** — ways to make network connections from `RUN` steps that evade the Buildcage proxy (other than the [known domain fronting limitation](./README.md#known-limitations))
88
- **Network isolation escape** — bypassing CNI isolation or iptables rules to reach the internet directly
99
- **GitHub Actions setup** — vulnerabilities in the `setup` or `report` actions (e.g., injection, credential leak)
1010
- **DNS filtering bypass** — bypassing the DNS redirect mechanism

THIRD_PARTY_LICENSES

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Third-Party Licenses
22
====================
33

4-
The buildcage Docker image includes the following third-party software.
5-
Each component retains its original license. The buildcage source code
4+
The Buildcage Docker image includes the following third-party software.
5+
Each component retains its original license. The Buildcage source code
66
itself is licensed under the MIT License (see LICENSE file).
77

88
------------------------------------------------------------------------------
@@ -59,7 +59,7 @@ repository. Their source code is available through:
5959
2. Alpine Linux source packages:
6060
https://pkgs.alpinelinux.org/packages
6161

62-
The buildcage source code (MIT License) is not derived from, linked to,
62+
The Buildcage source code (MIT License) is not derived from, linked to,
6363
or combined with the GPL-licensed components. They are independent programs
6464
distributed together in a Docker image as an aggregate work, consistent
6565
with GPL v2 Section 2.

assets/diagram-architecture.png

-4.34 KB
Loading

assets/report-restrict-mode.png

-1.76 KB
Loading

docker/files/THIRD_PARTY_LICENSES

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Third-Party Licenses
22
====================
33

4-
The buildcage Docker image includes the following third-party software.
5-
Each component retains its original license. The buildcage source code
4+
The Buildcage Docker image includes the following third-party software.
5+
Each component retains its original license. The Buildcage source code
66
itself is licensed under the MIT License (see LICENSE file).
77

88
------------------------------------------------------------------------------
@@ -59,7 +59,7 @@ repository. Their source code is available through:
5959
2. Alpine Linux source packages:
6060
https://pkgs.alpinelinux.org/packages
6161

62-
The buildcage source code (MIT License) is not derived from, linked to,
62+
The Buildcage source code (MIT License) is not derived from, linked to,
6363
or combined with the GPL-licensed components. They are independent programs
6464
distributed together in a Docker image as an aggregate work, consistent
6565
with GPL v2 Section 2.

docs/development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Development Guide
22

3-
This document covers local development, testing, and the project structure of buildcage.
3+
This document covers local development, testing, and the project structure of Buildcage.
44

55
## Local Usage
66

7-
You can run buildcage locally without GitHub Actions using Docker Compose and Make.
7+
You can run Buildcage locally without GitHub Actions using Docker Compose and Make.
88

99
> GitHub Actions inputs use lowercase names (e.g., `proxy_mode`), while environment variables for local usage use uppercase (e.g., `PROXY_MODE`).
1010
@@ -31,7 +31,7 @@ ALLOWED_HTTPS_RULES="github.com:443 npmjs.org:443 example.com:443" make run_rest
3131
### End-to-End Workflow
3232

3333
```bash
34-
# 1. Start buildcage
34+
# 1. Start Buildcage
3535
make run_audit_mode
3636

3737
# 2. Build

docs/rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rule Syntax
22

3-
buildcage uses `allowed_https_rules`, `allowed_http_rules`, and `allowed_ip_rules` to control which destinations are accessible during Docker builds.
3+
Buildcage uses `allowed_https_rules`, `allowed_http_rules`, and `allowed_ip_rules` to control which destinations are accessible during Docker builds.
44

55
## Delimiters
66

@@ -66,7 +66,7 @@ Since the regex is tested against the `domain:port` string, include a port patte
6666
## Examples
6767

6868
```yaml
69-
- name: Start buildcage
69+
- name: Start Buildcage
7070
uses: dash14/buildcage/setup@v1
7171
with:
7272
proxy_mode: restrict

0 commit comments

Comments
 (0)