Skip to content

Network monitoring: add blocking mode for non-allowlisted destinations #25

@Brad-Edwards

Description

@Brad-Edwards

Problem

ebpf/owlbear_net.bpf.c kprobes on tcp_v4_connect and udp_sendmsg are observe-only. They emit events but never block connections. The daemon-side net_allowlist.c logs unknown destinations but has no enforcement path back to the kernel.

In enforce mode, a cheat exfiltrating game state over UDP (demonstrated by cheats/net_exfil.c) succeeds — the daemon sees it but can't stop it.

Proposal

Two-phase approach:

  1. BPF LSM hook on socket_connect — can return -EPERM to block connections to non-allowlisted IPs. Requires a BPF map populated with the allowlist from userspace.
  2. Populate allowlist map from daemon — extend owl_bpf_init to push net_allowlist entries into a shared BPF hash map at startup.

Observe mode: log only (current behavior). Enforce mode: block + log.

Acceptance

  • cheats/net_exfil.bin gets EPERM in enforce mode
  • Allowlisted IPs (127.0.0.1, configured game servers) still connect
  • Observe mode unchanged
  • E2E assertion in verify.sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions