Skip to content

ci: CI lane that builds and privileged-loads the real eBPF network-policy object #1663

Description

@hsinatfootprintai

Split out of #1660 (real two-org e2e coverage for the threat-detection fence-probe rules, umbrella #1645) after investigation found the actual blocker isn't a missing test — it's that this repo has no CI lane anywhere that loads real eBPF.

What exists today

  • .github/workflows/incus-create.yml ("Daemon Create() against real Incus on ZFS") is the only CI lane with real Incus+ZFS, but it's scoped to the storage/encryption create path (-tags=incus -run 'TestIntegrationIncus' against ./pkg/core/box/lxc/ ./pkg/core/incus/ ./internal/server/). It never touches internal/netbpf.
  • internal/netbpf/netpolicy.bpf.o is gitignored, built only via make build-bpf (needs clang + kernel UAPI headers, see Makefile:82), and only embedded into the daemon binary with -tags embed_bpf (internal/netbpf/embed_bpf.go). A normal go build/go test compiles the no-op embed_stub.go stand-in instead.
  • No workflow ever invokes make build-bpf. release.yml/proxyproto-e2e.yml only reference netbpf in a Windows cross-compile guard (must stay Linux-only), not as a loading test.

Scope

Stand up a CI lane (new workflow, or a new job in an existing one) that:

  1. Has a BPF toolchain available (clang + kernel UAPI headers) and successfully runs make build-bpf.
  2. Builds the daemon with -tags embed_bpf (or points CONTAINARIUM_NETWORK_POLICY_BPF_OBJECT at the freshly built object).
  3. Actually loads the object and attaches its TC hooks on a real veth interface — proving the load path works, not just that it compiles. This needs CAP_BPF/CAP_NET_ADMIN (or root); incus-create.yml already runs privileged for ZFS/Incus on a GitHub-hosted runner, so the same posture is likely workable here, but that's unproven and part of this issue's job to confirm.
  4. Reuses incus-create.yml's existing ZFS+Incus setup as a base rather than duplicating it, if practical.

Out of scope

Notes

This is new privileged-CI-execution surface (a runner loading a real kernel-attached eBPF program), not a small mechanical add — may be worth /architect:design input before implementation, given the security/operational surface of granting a CI job CAP_BPF/CAP_NET_ADMIN.

Confirmed not locally reproducible

Investigated in this dev sandbox too: incus/zfs/zpool binaries are present but non-functional here (no real device/daemon access — consistent with running nested in a container), and there is no clang toolchain available at all, so make build-bpf can't even be exercised locally in this environment. Whatever lane this issue builds will need to be validated in CI directly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ebpfeBPF / kernel datapath

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions