[GH-ISSUE #5985] Emit reverse-proxy access events to container stdout (or file) #12616

Open
opened 2026-08-05 02:06:17 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @speedbirdone on GitHub (Apr 24, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5985

Use Case

Self-hosted deployments using netbird-proxy for public service exposure
want to integrate HTTP-layer intrusion detection (e.g., CrowdSec) based
on access events.

Today, the netbird-proxy container emits only connection-level logs
(TLS handshake errors, ICE warnings). The detailed per-request HTTP
events (source_ip, path, method, status_code, duration) are pushed via
gRPC to the management server and stored in events.db, accessible
only via the REST API (GET /api/events/proxy) or dashboard UI.

This makes standard log-based security tooling (CrowdSec, Fail2Ban,
Traefik-log parsers, SIEM forwarders) unable to detect attacks at the
HTTP layer without polling the API — which requires custom scripting
and API-schema tracking.

Proposal

Add a configuration flag to netbird-proxy that emits each HTTP request
as a structured JSON log line to stdout, compatible with common log
formats (Traefik-style preferred, as it enables reuse of existing
CrowdSec parsers).

Suggested flag: --access-log-format=json-traefik or
NB_PROXY_ACCESS_LOG_STDOUT=true

Benefits

  1. Direct integration with CrowdSec via crowdsecurity/traefik-logs parser
  2. Enables SIEM forwarding (Grafana Loki, Splunk, Elastic)
  3. Fail2Ban support for simpler setups
  4. Removes dependency on API polling from external tools

Current Workaround

Users today build custom collectors that poll GET /api/events/proxy
and transform events into Traefik-compatible JSON log files. This
works but creates technical debt tied to API schema stability.

Originally created by @speedbirdone on GitHub (Apr 24, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5985 ## Use Case Self-hosted deployments using netbird-proxy for public service exposure want to integrate HTTP-layer intrusion detection (e.g., CrowdSec) based on access events. Today, the netbird-proxy container emits only connection-level logs (TLS handshake errors, ICE warnings). The detailed per-request HTTP events (source_ip, path, method, status_code, duration) are pushed via gRPC to the management server and stored in `events.db`, accessible only via the REST API (`GET /api/events/proxy`) or dashboard UI. This makes standard log-based security tooling (CrowdSec, Fail2Ban, Traefik-log parsers, SIEM forwarders) unable to detect attacks at the HTTP layer without polling the API — which requires custom scripting and API-schema tracking. ## Proposal Add a configuration flag to netbird-proxy that emits each HTTP request as a structured JSON log line to stdout, compatible with common log formats (Traefik-style preferred, as it enables reuse of existing CrowdSec parsers). Suggested flag: `--access-log-format=json-traefik` or `NB_PROXY_ACCESS_LOG_STDOUT=true` ## Benefits 1. Direct integration with CrowdSec via `crowdsecurity/traefik-logs` parser 2. Enables SIEM forwarding (Grafana Loki, Splunk, Elastic) 3. Fail2Ban support for simpler setups 4. Removes dependency on API polling from external tools ## Current Workaround Users today build custom collectors that poll `GET /api/events/proxy` and transform events into Traefik-compatible JSON log files. This works but creates technical debt tied to API schema stability.
saavagebueno added the feature-request label 2026-08-05 02:06:17 -04:00
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12616