Skip to content

Egress reject audit logging (LOG target before REJECT) #40

Closed

Description

@itscooleric

Problem

firewall.sh silently rejects outbound traffic that doesn't match the allowlist. There's no record of what was blocked — we can't audit agent network behavior or detect unexpected egress attempts.

Fix

Add an iptables LOG target immediately before the existing REJECT rule in firewall.sh:

_ipt -A OUTPUT -j LOG --log-prefix "CLIDE-REJECT: " --log-level 4
_ipt -A OUTPUT -j REJECT --reject-with icmp-port-unreachable

Same for ip6tables.

Logs go to the kernel ring buffer (dmesg / /var/log/kern.log). For structured consumption, a future poller (v5) can tail these and write to egress_events.jsonl.

Size

XS — 15 minute change to firewall.sh.

Notes

Source: workspace/notes/research/clide_monitoring.md, final_observability_ticket_plan.md (C-2)

Activity

  1. itscooleric commented on Mar 7, 2026

    @itscooleric
    OwnerAuthor

    Copilot implementation note:

    The change is entirely in firewall.sh, section 6 (around line 101). Replace:

    ```bash

    6. Reject all other outbound traffic (REJECT gives immediate feedback vs DROP's timeout)

    _ipt -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
    _ip6 -A OUTPUT -j REJECT
    ```

    With:

    ```bash

    6. Log then reject all other outbound traffic

    _ipt -A OUTPUT -m limit --limit 10/min -j LOG --log-prefix "CLIDE-REJECT: " --log-level 4
    _ip6 -A OUTPUT -m limit --limit 10/min -j LOG --log-prefix "CLIDE-REJECT: " --log-level 4
    _ipt -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
    _ip6 -A OUTPUT -j REJECT
    ```

    Notes:

    • Rate-limit the LOG rule to 10/min to prevent log flooding from a looping agent.
    • Logs appear in dmesg / /var/log/kern.log inside the container.
    • No other files need to change.
    • Use prefix "CLIDE-REJECT: " (not CLIDE-DROP — the rule is REJECT).

    Testing: After applying, run a command that hits a non-allowlisted host (e.g. curl https://example.com) and verify you see a CLIDE-REJECT: line in dmesg output.

  2. added a commit that references this issue on Mar 7, 2026
    c646558
  3. added a commit that references this issue on Apr 23, 2026
    6d8bac0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions