Skip to content

feat: add redacted access audit for Docker tasks and URL/time search - #596

Draft
renaesop wants to merge 1 commit into
BaaRai:mainfrom
renaesop:codex/access-audit-search-20261127
Draft

renaesop wants to merge 1 commit into
BaaRai:mainfrom
renaesop:codex/access-audit-search-20261127

Conversation

@renaesop

@renaesop renaesop commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Operators can search retained access observations by URL/path, exact hostname, task, source and time in Traffic → Access audit, including Bash traffic in main's default Docker task mode while full traffic capture is off.

Rebased onto main at 8f91643b786eadbdd160a6298e13215b8943b9c8 as one commit (9896538a949bcc801f56522613cd6230a2c01f8b). There is no PostgreSQL migration; main's 0024_task_scope_egress is unchanged. Audit data and collection cursors use the separate SQLite index.

Default Docker task path

  • Each existing task egress proxy observes HTTP and decrypts HTTPS with its own persistent CA. Only the public CA bundle is mounted read-only into the worker. Upstream certificate verification, per-request scope checks and DNS pinning remain enabled; there is no direct or opaque HTTPS fallback.
  • HTTP and SOCKS5 require a persistent random credential belonging to that task. A task cannot borrow another task's proxy or audit attribution merely because an approved CIDR includes both proxies. Credentials are removed before forwarding and are never part of the URL index.
  • The proxy writes bounded, redacted metadata to its private spool. The authenticated runner supplies task identity; the panel imports observations and cursors transactionally with retry deduplication. Worker/run/Bash-call attribution stays unknown where it cannot be proven. The UI shows collection failures and detected gaps.
  • Runner requires the newly started proxy's initialization proof before starting a worker; old images fail explicitly. Pre-audit workers are recreated to install the trust mount, preserving their workspace. Deploy matching panel, runner and egress-proxy images together.
  • Inherits main's merged fix(sandbox): remove workers on failed execs and task deletion #764 lifecycle, deletion, cancellation and timeout cleanup. Failed cleanup retains retryable state. Timeout or unproven exec completion removes the captured worker and terminates sibling execs; subsequent execution can recreate it with audit trust installed.
  • Preserves main's safe CA loading through both proxy constructors, including refusal of symlinked/hard-linked CA paths, while keeping audit upstream TLS verification enabled. Both constructors are covered by the CA path regressions.

The native HTTP/WebFetch, local execution proxy, recording proxy and externally reported HAR/extension sources remain. Main's sandbox routing and WebFetch policy checks are preserved. Full capture remains independently controlled; capture-off requests cannot start recording mid-flight or resume persistence after an off/on toggle. The rebase also fixes WebSocket request/response correlation and internal replay-header stripping. The existing confined Grep literal/cancellation improvements remain in this commit.

Audit never stores bodies, headers, credentials, query keys/values or fragments. URL paths can still be sensitive. Retention is 30 days / 500,000 observations. Imported rows retain producer timestamps, and event/cursor commits are atomic. The authenticated operator API returns no-store; URLs render as inert text. The frontend validates date ranges and preserves filters/time bounds across cursor pages, with all four translations covered.

Compatibility and remaining scope

HTTPS interception requires the task CA. Certificate-pinned clients, mutual-TLS clients and HTTP/2-only clients are not supported by this inspection path. Custom private origin roots belong in the proxy image's system trust store; client curl -k does not bypass proxy-side verification. SOCKS/raw TCP retain connection metadata only. Queue pressure, rotation and crashes can leave gaps. An allowed HTTP(S)/SOCKS channel can still carry a callback; this feature does not promise prompt-injection or reverse-shell immunity.

Keep Draft because the existing SSRF/RCE investigation requirement is incomplete. Direct HTTP(S) observations do not index secondary destinations embedded in query/body/script artifacts or link them to exact triggering actions and independent callback receipts. A remote server's second hop remains outside the worker proxy. This is a functional acceptance gap, not a request for additional permission or a claim that Docker collection is missing.

Validation of the rebased commit

  • On the requested cc01 Linux host, rebuilt worker and egress-proxy binaries from this tree and built isolated images from the repository's runtime Dockerfile stages. All three real Docker race tests passed: HTTPS URL audit/redirects and task isolation, scope/direct-egress containment, and timeout removal of a detached child. Test containers and networks were removed. All 1,422 tracked source-file hashes matched the committed local tree.
  • Complete sandbox, accessaudit and egress race suites passed (228 tests/subtests; the three opt-in Docker tests were exercised separately above). Focused traffic race regressions cover CA loading, audit identity, capture toggles, WebSockets and replay. Focused agent/server audit and sandbox HTTP scope checks passed; PostgreSQL-dependent fixtures were skipped in this isolated run.
  • go vet -p 1 ./... passed. Frontend access-audit and i18n tests (11 tests), TypeScript checking and scoped Biome checks passed; Biome reported existing warnings/informational diagnostics.
  • The attempted complete traffic race suite reached its 240-second package timeout in TestRecordExternalStoresLikeProxyTraffic, while SQLite FTS searched its 2 MiB repeated-text fixture. That test passed separately without race instrumentation in 11.3 seconds. The targeted traffic race suite is the completed race validation for this rebase; a complete all-package run was not repeated. Earlier full regression results apply to the previous base, not this commit.

See docs/access-audit.md for collection, trust deployment, coverage, retention and the remaining investigation fixtures. No production ARTEX service was replaced.

@BaaRai

BaaRai commented Dec 1, 2026

Copy link
Copy Markdown
Owner

This is a useful operator feature. The branch conflicts with main; please rebase and re-run CI, and state which parts add schema migrations (0024 is taken by task_scope_egress). I will review the access audit after that.

@renaesop
renaesop force-pushed the codex/access-audit-search-20261127 branch from f849b14 to 203185f Compare December 1, 2026 18:47
@renaesop renaesop changed the title feat: add redacted access audit and URL/time search feat: add redacted access audit for Docker tasks and URL/time search Dec 1, 2026
@renaesop
renaesop force-pushed the codex/access-audit-search-20261127 branch 3 times, most recently from 2d584a6 to 9896538 Compare December 2, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants