Skip to content

Centralize sensitive-path masking across runtimes - #9220

Merged
lpcox merged 3 commits into
mainfrom
copilot/design-central-sensitive-path-registry
Sep 29, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/design-central-sensitive-path-registry

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive /tmp/gh-aw paths were masked independently per runtime, allowing protections to drift. This change establishes a shared registry and records the resolved masks for each supported runtime.

  • Registry and Docker: Declare each path’s rationale and runtime applicability once; derive Docker tmpfs mounts and /host variants from it.
  • Cloud Hypervisor: Derive export masks from the registry and verify them through mountinfo before virtiofsd starts. Warn on unclassified top-level children.
  • Audit and exemption: Record resolved masks in sensitive-paths.json. Document /tmp/gh-aw/mcp-payloads as intentionally readable.
{
  path: '/tmp/gh-aw/mcp-logs',
  reason: 'mcpg logs contain pre-filter tool-call payloads',
  exposure: 'read',
  appliesTo: ['docker', 'cloud-hypervisor', 'nvx'],
}

NVX applicability is declared in the registry; its enforcement remains deferred.

Copilot AI changed the title [WIP] Design central sensitive-path registry for /tmp/gh-aw Centralize sensitive-path masking across runtimes Sep 29, 2026
Copilot AI requested a review from lpcox September 29, 2026 22:46
@lpcox
lpcox marked this pull request as ready for review September 29, 2026 22:48
Copilot AI balanced review requested due to automatic review settings September 29, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Missing paths can evade Cloud Hypervisor masking, and NVX runs omit the promised audit artifact.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Centralizes sensitive-path masking and auditing across Docker and Cloud Hypervisor, while declaring future NVX applicability.

Changes:

  • Adds a shared sensitive-path registry and audit artifact.
  • Derives Docker and Cloud Hypervisor masks from the registry.
  • Adds runtime parity, masking, classification, and audit tests.
File Description
src/​sensitive-paths.ts Defines paths, exemptions, resolution, and Docker masks.
src/​sensitive-paths.test.ts Tests registry behavior.
src/​sensitive-path-audit.ts Writes the audit artifact.
src/​config-writer.ts Records Docker mask audits.
src/​config-writer.test.ts Verifies Docker audit output.
src/​services/​agent-service.ts Uses registry-derived Docker tmpfs mounts.
src/​services/​agent-security-config.test.ts Tests generated security configuration.
src/​services/​agent-volumes-security.test.ts Tests compose-level masks.
src/​cloud-hypervisor/​filesystem-write-enforcement.ts Plans Cloud Hypervisor masks and classifications.
src/​cloud-hypervisor/​filesystem-write-enforcement.test.ts Tests masking and classification.
src/​cloud-hypervisor/​runtime-boot-loop.ts Writes Cloud Hypervisor audits and warnings.
src/​cloud-hypervisor-runtime-backend.test.ts Verifies runtime integration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +152 to +153
.filter((entry): entry is { export: CloudHypervisorDirectoryExport; mask: ResolvedSensitivePath } =>
entry !== undefined && isExistingRealDirectory(entry.mask.path));
Comment thread src/config-writer.ts Outdated
JSON.stringify(policyManifest, null, 2)
);

if (!config.cloudHypervisor && !config.nvx) {
@lpcox

lpcox commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed both review findings in commit 3c2f6cb: missing Cloud Hypervisor sensitive paths are securely created and masked, and NVX now emits an audit artifact marking enforcement as deferred.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 92.70% 92.71% ➡️ +0.01%
Statements 91.20% 91.22% 📈 +0.02%
Functions 89.21% 89.29% 📈 +0.08%
Branches 84.34% 84.32% 📉 -0.02%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/filesystem-write-enforcement.ts 100.0% → 96.6% (-3.41%) 100.0% → 95.9% (-4.09%)
src/nvx/one-shot-adapter.ts 83.5% → 82.9% (-0.60%) 80.3% → 79.8% (-0.56%)
src/cloud-hypervisor/runtime-boot-loop.ts 96.3% → 96.5% (+0.30%) 96.3% → 96.6% (+0.30%)
src/config-writer.ts 89.5% → 89.9% (+0.37%) 89.1% → 89.6% (+0.47%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (2 files)
  • src/sensitive-path-audit.ts: 100.0% lines
  • src/sensitive-paths.ts: 100.0% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • clients2.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "clients2.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9220

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Claude failed

Generated by Smoke Claude for #9220

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@lpcox
lpcox enabled auto-merge (squash) September 29, 2026 23:15
@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): blocked (TLS error, self-signed cert)
    Overall: PASS (cc @lpcox)

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot: PASS

  • ✅ GitHub MCP: "Add NVX read-exposure masking for future exports"
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read

PR: "Centralize sensitive-path masking across runtimes" — @Copilot (author); assignees @lpcox @Copilot

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot Smoke Test

  1. List merged PRs (github MCP): PASS — retrieved PR list successfully.
  2. curl https://github.com: FAIL — sandbox denied curl execution ("Permission denied and could not request permission from user"); could not observe HTTP code.
  3. Write/read unique temp file: PASS — wrote and read back /tmp/gh-aw/agent/smoke-cloud-hypervisor-36643946542.txt.
  4. curl (example.com/redacted) (expect blocked): FAIL — same sandbox denial as check 2, so blocked status (000/403) could not be confirmed via curl output.

Overall: 2 PASS, 2 FAIL. Curl invocations were blocked at the tool-permission layer rather than returning an HTTP status, so network checks are inconclusive rather than confirmed-blocked.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Services smoke test:

  • Redis PING: ✅ PONG
  • pg_isready: ✅ accepting connections
  • psql SELECT 1: ✅ 1

Overall: PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke OTEL tracing (pre-step outputs unavailable; verified directly)

  • ✅ S1 Module loading: otel.js exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled (+ internals)
  • ✅ S2 Tests: 3 suites, 68 tests passed
  • ✅ S3 Env forwarding: trace ID/parent span ID forwarded in env-passthrough.ts and api-proxy-env-config.ts
  • ✅ S4 Token tracker: onUsage callback present in token-tracker-http.js
  • ✅ S5 Diagnostics: /tmp/gh-aw/otel.jsonl exists (1 line); no api-proxy spans checked

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: Not all tests passed (Node.js version mismatch), so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ❌ N/A ❌ FAIL
Bun hono ❌ N/A ❌ FAIL
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak ❌ N/A ❌ FAIL
Deno std ❌ N/A ❌ FAIL
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ all ok ✅ PASS
Go env ✅ all ok ✅ PASS
Go uuid ✅ all ok ✅ PASS
Java gson ❌ N/A ❌ FAIL
Java caffeine ❌ N/A ❌ FAIL
Node.js clsx ✅ all passed ✅ PASS
Node.js execa ✅ all passed ✅ PASS
Node.js p-limit ✅ all passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 5/8 ecosystems passed — FAIL

Failures:

  • Bun / Deno: Install commands (curl ... | bash/sh) were blocked with "Permission denied and could not request permission from user", so the tools were never installed. Neither is preinstalled on the runner.
  • Java: Maven failed with LocalRepositoryNotAccessibleException on both projects (local repository not accessible).

Generated by Build Test Suite for #9220 · copilot · auto · 25.7 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

Test Results:

All checks passed.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 9e7b085 into main Sep 29, 2026
127 of 136 checks passed
@lpcox
lpcox deleted the copilot/design-central-sensitive-path-registry branch September 29, 2026 23:26

This branch was previously deployed

1 inactive deployment
aoai-model — 3c2f6cba Deployed Sep 29, 2026 by lpcox via conclusion #1828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design: central sensitive-path registry for /tmp/gh-aw with runtime exposure audit

3 participants