Skip to content

Commit 92ec260

Browse files
authored
Update docker-build-context-abuse.md
1 parent 1c91bb9 commit 92ec260

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/pentesting-ci-cd/docker-build-context-abuse.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,6 @@ curl -s -X POST -H "Authorization: Bearer fm2_..." \
101101

102102
Captured requests often contain client credentials in headers, bodies, or query params.
103103

104-
## Detection ideas
105-
106-
- Flag suspicious build contexts ("..", absolute paths, or paths escaping the repo root).
107-
- Build logs showing COPY of non-repo paths or network egress during build (curl, wget) from Dockerfile RUN.
108-
- Control-plane audit anomalies (e.g., spikes in exec calls, package installs like apk add tcpdump).
109-
- Egress monitoring from builder hosts and hosted servers.
110-
111-
## Mitigations
112-
113-
- Canonicalize and constrain build contexts to the repository root (disallow ".." and absolute paths). Allow-list subpaths only.
114-
- Mount a minimal, read-only build context; run builds in ephemeral, sandboxed builders with least-privilege.
115-
- Separate credentials and scope them narrowly (registry vs control-plane). Prefer short-lived tokens and automatic rotation.
116-
- Restrict egress from build steps and from hosted servers; block unsolid outbound exfiltration.
117-
- Prefer OAuth with narrow scopes and short lifetimes for client-to-server authentication, reducing blast radius.
118-
119104
## References
120105

121106
- [Breaking MCP Server Hosting: Build-Context Path Traversal to Org-wide RCE and Secret Theft](https://blog.gitguardian.com/breaking-mcp-server-hosting/)

0 commit comments

Comments
 (0)