Skip to content

jailoc audit — static configuration auditor #16

@thejoeejoee

Description

@thejoeejoee

config.Validate() catches broken configs but not dangerous ones. You can happily mount $HOME (exposing .ssh/, .aws/), leak OPENAI_API_KEY=sk-live-... through env, or allowlist a network that entrypoint.sh silently blocks — and jailoc won't say a word.

Idea

jailoc audit [workspace] — static checker that goes beyond validation and flags risky-but-valid configs.

What it'd catch

🔴 Errors (this won't work):

  • Paths/dockerfiles/build_contexts that don't exist on disk
  • allowed_networks overlapping the RFC 1918/link-local/CGNAT ranges that entrypoint.sh blocks (silently dead config)

🟡 Warnings (probably not what you want):

  • Overly broad mounts ($HOME, /) — agent sees way more than intended
  • Sensitive dirs (.ssh/, .gnupg/, .aws/) reachable under mounted paths
  • Secret-looking env values (sk-live-*, ghp_*, AKIA*, -----BEGIN) or suspicious keys (*_TOKEN, *_SECRET)
  • allowed_hosts that don't resolve

🔵 Info (just so you know):

  • No network access configured at all (might be intentional)
  • Empty workspace, default image

CLI sketch

jailoc audit [workspace]
jailoc audit --json
jailoc audit --level=warning

Exit: 0 clean, 1 warnings, 2 errors.

Implementation

  • internal/cmd/audit.go + internal/config/audit.go returning []Finding
  • Runs on top of config.Load() (validation first, audit second)
  • DNS checks with timeout (warning-only, DNS is flaky)
  • Network overlap uses same blocked CIDRs as entrypoint.sh
  • Sensitive dir scan: shallow walk (1 level) under mounted paths

Advisory only — doesn't block jailoc up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configConfiguration parsing, validation, auditfeatureNew functionalitysecuritySecurity hardening or vulnerabilityuxCLI usability, output formatting, error messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions