Skip to content

feat(supervisor): program bypass firewall rules via nf_tables netlink instead of nft #3282

Description

@akram

Problem Statement

The proxy-mode bypass-detection firewall rules are installed by shelling out to the nft binary — 6 call sites (run_nft) in crates/openshell-supervisor-process/src/netns/mod.rs — resolved from the workload image (NFT_SEARCH_PATHS). A bare Alpine image ships no nftables, so rule installation cannot run without the community base image's tools.

Proposed Design

Program the nf_tables ruleset directly over netlink from the supervisor (e.g. rustables or nftnl-rs), producing the same table/chain/rule set the current nft invocations create, with no nft process spawned. Rule installation stays best-effort/non-fatal exactly as today (failures reported via OCSF).

Acceptance Criteria

  • Bypass-detection rules are programmed without invoking nft.
  • The resulting ruleset and enforcement behavior are equivalent to the current nft path.
  • Verified on Docker, rootless Podman, and Kubernetes.
  • No behavior change for images that already ship nftables.

Scope

In: the nft bypass-rule installation in netns/mod.rs.
Out: the ip/nsenter namespace setup (sibling issue) and dmesg→NFLOG bypass monitoring (#2382).

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions