# Декларативное описание клиентского доступа и политик NetBird. # Применяется задачей rus-central/netbird (tasks/access.yml → sync_access.py). # # Секреты setup-ключей сохраняются в Infisical (/services/netbird) автоматически # и не попадают в Git или логи CI. # Управляемые группы пиров client_groups: - exit-clients - remnawave - exit-ger-nod-02 - homelab-routers # Выходные шлюзы (Exit Nodes) exit_nodes: - network_id: exit-ger-nod-02 description: "Exit Node DE (0.0.0.0/0 via ger-nod-02)" peer: ger-nod-02 peer_group: exit-ger-nod-02 client_groups: - exit-clients metric: 9999 masquerade: true keep_route: false skip_auto_apply: false enabled: true # DNS для клиентских групп dns_nameservers: - name: exit-dns description: "Public DNS for Exit Node clients" servers: - "1.1.1.1" - "8.8.8.8" groups: - exit-clients primary: true enabled: false # Ключи подключения клиентов (секреты сохраняются в Infisical /services/netbird). setup_keys: - name: exit-clients-key secret: NETBIRD_EXIT_CLIENTS_SETUP_KEY type: reusable expires_in: 31536000 usage_limit: 0 ephemeral: false groups: - exit-clients enabled: true # Управление подключёнными пирами (жёсткое разделение: внешние ноды не входят в remnawave). peers: - name: "A55 пользователя Vacheslav" groups: - exit-clients state: present - name: "core-net" groups: - remnawave state: present - name: "ger-nod-02" groups: - exit-ger-nod-02 state: present # Zero-Trust политики доступа (заменяют дефолтную политику Default All <-> All). # Инициировать соединения в сторону внешних нод могут только панель (core-net) и клиенты (exit-clients). # Сами внешние ноды не могут открыть ни одного соединения внутрь домашней сети или к пирам. policies: - name: "remnawave-panel-to-exit-nodes" description: "One-way access from Remnawave panel (core-net) to Exit Nodes (NODE_PORT + metrics)" enabled: true rules: - name: "panel-to-node-tcp" description: "Allow TCP 2222 (remnanode), 9100 (node-exporter), 9101 (cAdvisor) from core-net" enabled: true action: accept protocol: tcp bidirectional: false ports: - "2222" - "9100" - "9101" sources: - remnawave destinations: - exit-ger-nod-02 - name: "exit-clients-to-exit-nodes" description: "One-way traffic from Exit Node clients to Exit Nodes" enabled: true rules: - name: "exit-clients-tcp" description: "Allow outbound TCP from exit-clients via exit node" enabled: true action: accept protocol: tcp bidirectional: false sources: - exit-clients destinations: - exit-ger-nod-02 - name: "exit-clients-udp" description: "Allow outbound UDP from exit-clients via exit node" enabled: true action: accept protocol: udp bidirectional: false sources: - exit-clients destinations: - exit-ger-nod-02 - name: "exit-clients-icmp" description: "Allow ICMP for exit-clients via exit node" enabled: true action: accept protocol: icmp bidirectional: true sources: - exit-clients destinations: - exit-ger-nod-02 - name: "exit-clients-to-homelab" description: "Allow BirdSocks/NetBird clients to reach homelab LAN (via OPNsense) and core-net" enabled: true rules: - name: "exit-clients-homelab-tcp-udp" description: "Allow TCP/UDP from exit-clients to homelab-routers and remnawave" enabled: true action: accept protocol: all bidirectional: false sources: - exit-clients destinations: - homelab-routers - remnawave