[log] Add debug logging to mount policy validation paths - #12070
[log] Add debug logging to mount policy validation paths#12070github-actions[bot] wants to merge 1 commit into
Conversation
Log mount validation outcomes (allowed/rejected) in ValidateMount and container option rejections in ValidateContainerArgs to aid debugging of mount policy enforcement failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
π’ Approval recommended
The logging is correctly scoped, uses the existing logger, and does not alter validation behavior.
Pull request overview
Adds targeted debug logging for mount-policy validation decisions.
Changes:
- Logs mount allow/reject decisions and matched roots.
- Logs rejected container options that could bypass mount policy.
File summaries
| File | Description |
|---|---|
internal/launcher/mount_policy.go |
Adds debug logs to mount and container-argument validation paths. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
π mcpg Read-Only Stress β defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes succeeded or leaked. No artifact was created. References: Β§33220361567
|
π mcpg Read-Only Stress β gVisor (
|
| Part | Surface | Op | Result | Expected | Status |
|---|---|---|---|---|---|
| A | MCP | reads (list_issues, list_pulls, get_file, list_commits) | data returned | ALLOWED | β |
| B | MCP | writes (reaction/star/issue/comment/branch/file/PR) | tool not found (absent from catalog) | BLOCKED | |
| C | CLI | reads (list_issues, get_file_contents) | data returned | ALLOWED | β |
| D | CLI | REST writes (reaction/star/issue/comment/file) | gh unauthenticated |
BLOCKED | |
| E | CLI | GraphQL mutations (addReaction/addStar/createIssue) | gh unauthenticated |
BLOCKED |
Overall: INCONCLUSIVE
- Part B: All 7 write tools absent from MCP catalog (backend runs with
GITHUB_READ_ONLY=1). This confirms gh-aw's defense-in-depth guarantee. Gateway-level DIFC/guard enforcement could not be independently confirmed via this surface (structural limitation of this test harness β write tools never registered). No writes leaked. - Parts D & E:
ghCLI is not authenticated in this environment (GH_TOKENnot set). Token-scope boundary cannot be validated in this run. No writes attempted. - No write succeeded; the overall result is INCONCLUSIVE (not FAIL) because the gaps are methodology limitations, not enforcement failures.
References: Β§33220361569
π mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime
π mcpg Read-Only Stress β docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No FAIL condition.
|
Summary
Adds targeted debug logging to
internal/launcher/mount_policy.goin the security-critical mount validation code paths (ValidateMountandValidateContainerArgs). Previously these functions had no logging on their reject/allow decisions, making it hard to troubleshoot why a container-backed MCP server's mount request was denied.Changes
logMountPolicylogger (logger.ForFile(), namespacelauncher:mount_policy) β no new logger declared.ValidateMount:ValidateContainerArgs:--privileged,--mount) is rejected.No log arguments compute anything or cause side effects; all values are already-computed local variables.
Validation
go build ./...β succeedsgo vet ./internal/launcher/...β cleango test ./internal/launcher/...β passes (ok)(Note: local Go toolchain was 1.24.13 vs
go.mod's required 1.26.4; usedGOTOOLCHAIN=autoto let Go auto-fetch the required toolchain for validation.)