Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add client debug features #1884

Merged
merged 21 commits into from
Apr 26, 2024
Merged

Add client debug features #1884

merged 21 commits into from
Apr 26, 2024

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Apr 23, 2024

Describe your changes

  • Adds --anonymize flag to netbird status
$ netbird status -dA

$ ./netbird status -dA --filter-by-status connected
[...]
OS: linux/amd64
Daemon version: development
CLI version: development
Management: Connected to https://api.stage.anon-Fp8km.domain:443
Signal: Connected to https://signal.stage.anon-Fp8km.domain:443
Relays:
  [stun:api.stage.anon-Fp8km.domain:3478] is Available
  [turn:api.stage.anon-Fp8km.domain:3478?transport=udp] is Available
Nameservers:
  [8.8.8.8:53, 8.8.4.4:53] for [.] is Available
FQDN: vik-x1-1.anon-9I9nz.domain
NetBird IP: 100.89.32.208/16
Interface type: Kernel
Quantum resistance: false
Routes: -
Peers count: 3/3 Connected

  • Adds netbird debug bundle -A command to anonymize client logs and status output
$ netbird debug bundle -A
/tmp/netbird.debug.836717317.zip
  • Formats last handshake and last update in a human friendly way (similar to the wg command)
$ netbird status

Peers detail:
 test-vpc-cloud-centos.netbird.stage:
  NetBird IP: 100.89.60.171
  Public key: rexh6U7uWqsqUGERfMqpkJGAgLzx9SRwXHEcM7xink4=
  Status: Connected
  -- detail --
  Connection type: P2P
  Direct: true
  ICE candidate (Local/Remote): srflx/prflx
  ICE candidate endpoints (Local/Remote): 198.51.100.0:61412/198.51.100.1:51820
  Last connection update: 6 minutes, 10 seconds ago
  Last WireGuard handshake: 13 seconds ago
  Transfer status (received/sent) 904 B/780 B
  Quantum resistance: false
  Routes: 10.0.1.0/24
  Latency: 37.557992ms
[...]
  • Adds OS and ARCH to status output
$ netbird status -d

OS: linux/amd64
Daemon version: development
CLI version: development
[...]
  • Adds log level selector
$ netbird debug log level trace

Log level set successfully to trace
  • Adds debug bundle collector over time
$ netbird debug for 10s -A

Netbird down
Log level set to trace.
Netbird up
Remaining time: 00:00:01
Duration completed
Netbird down
Creating debug bundle...
/tmp/netbird.debug.3779269856.zip

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

client/cmd/debug.go Outdated Show resolved Hide resolved
util/anonymize/anonymize.go Outdated Show resolved Hide resolved
client/server/debug.go Outdated Show resolved Hide resolved
@lixmal lixmal merged commit 4424162 into main Apr 26, 2024
16 checks passed
@lixmal lixmal deleted the feature/client-debug branch April 26, 2024 15:20
Foosec pushed a commit to Foosec/netbird that referenced this pull request May 8, 2024
* Add status anonymization
* Add OS/arch to the status command
* Use human-friendly last-update status messages
* Add debug bundle command to collect (anonymized) logs
* Add debug log level command
* And debug for a certain time span command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants