Skip to content

feat: outbound connection audit for agent sessions (#51) - #85

Merged
itscooleric merged 2 commits into
devfrom
feat/outbound-audit-51
Mar 16, 2026
Merged

itscooleric merged 2 commits into
devfrom
feat/outbound-audit-51

Conversation

@itscooleric

Copy link
Copy Markdown
Owner

Summary

New egress-audit.sh daemon monitors /proc/net/tcp and logs all outbound connections to .clide/logs/egress.jsonl:

{"event": "egress_connection", "ts": "2026-03-16T23:18:36Z",
 "remote_ip": "160.79.104.10", "remote_host": "api.anthropic.com",
 "remote_port": 443, "local_port": 35464, "uid": 1001, "verdict": "allow"}
  • Opt-in: CLIDE_EGRESS_AUDIT=1 in .env
  • Starts automatically from firewall.sh
  • Filters private/Docker IPs (only logs public internet connections)
  • Deduplicates connections (logs each unique connection once)
  • Reverse-resolves IPs to hostnames (best-effort, cached)
  • Polls every 5s (configurable via CLIDE_EGRESS_INTERVAL)

Closes #51

Test plan

  • Deployed on forge-edge, captured Claude API connection to api.anthropic.com
  • Docker-internal traffic filtered out
  • CI checks pass

🤖 Generated with Claude Code

itscooleric and others added 2 commits March 16, 2026 23:17
New egress-audit.sh daemon monitors /proc/net/tcp and logs all
outbound connections to .clide/logs/egress.jsonl with:
- Remote IP, hostname, port
- Local port, UID
- Timestamp, verdict (allow/reject)

Opt-in via CLIDE_EGRESS_AUDIT=1 in .env. Starts automatically
from firewall.sh when enabled.

Closes #51

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only log public internet connections — skip 127.x, 172.x, 10.x, 192.168.x

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@itscooleric
itscooleric merged commit 011c3f2 into dev Mar 16, 2026
4 checks passed
@itscooleric
itscooleric deleted the feat/outbound-audit-51 branch March 16, 2026 23:30
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.

1 participant