Skip to content

[FEATURE] Add examples/netbird-peers to secure daemon-to-daemon teleports with NetBird #1664

Description

@edenreich

Summary

Add a runnable example that secures the peer-to-peer link between two infer daemons with NetBird, and teleports a session from one to the other.

Two daemons on different machines reach each other as a kind: daemon workspace. #1635 removed SPIFFE so that identity between machines comes from a VPN instead, and docs/daemon.md ("Daemons on other machines") only shows that for Tailscale, with no example to run. NetBird gives the same building blocks, self-hostable:

  • a WireGuard tunnel between the peers
  • peers joined with setup keys
  • access-control policies that decide which peers reach the binding port

The example runs two daemons, laptop and workstation, as NetBird peers in containers. It uses a self-hosted NetBird stack in compose so no account is needed, or NetBird Cloud with a setup key. It uses the mock gateway, so no API key is needed either.

The workstation's binding listens only on its NetBird address. The daemon terminates TLS itself (ca or files) and requires the binding token, so forward_env keeps working: a teleport seals credentials to a key the daemon holds.

Acceptance Criteria

  • examples/netbird-peers/ holds a README, a Taskfile and compose files laid out like the other examples, and docs/examples.md lists it
  • Two daemons join one NetBird network as peers with setup keys, against a self-hosted stack, with NetBird Cloud as a documented alternative
  • The workstation's binding listens only on its NetBird address, and a NetBird policy lets only the laptop peer reach its port
  • The laptop's daemon.yaml registers the workstation as kind: daemon by its NetBird name or address, with a token and the daemon's own TLS (ca or files)
  • The README walks through:
    • infer daemon workspaces showing the peer reachable
    • infer daemon teleport <id> --to workstation
    • a turn with infer daemon run
    • the teleport back
  • The README shows that a peer outside the policy cannot reach the binding
  • A forward_env variable reaches the workstation's workers sealed, never in plain text on the wire
  • task cleanup removes everything the example created
  • docs/daemon.md "Daemons on other machines" links the example

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions