Grizzelbee / ioBroker.wireguard

A ioBroker adapter to monitor WireGuard hosts
MIT License
5 stars 4 forks source link
iobroker monitoring wireguard

Logo

ioBroker.wireguard

Logo

NPM version Downloads Number of Installations Current version in stable repository Test and Release CodeQL NPM

wireguard adapter for ioBroker

Connect to WireGuard hosts and grab connection information on peers. This adapter is intended to be a monitoring instance for your WireGuard hosts. It supports plain installations and docker as well.

If you like this adapter and consider supporting me
Donate with payPal

Prerequisites

Installation steps

Config options

Since WireGuard internally only uses the public keys to identify peers, but they are pretty inconvenient to read and recognize for humans the translation page was added. Feel free to add public keys and Names to it to get the names integrated into the object tree.

executed command line depends on checkboxes:

If you use WireGuard in a docker container, I assume you are familiar enough with both technologies and security concepts to configure your system to execute the shown commands in a way that doesn't ask for any password.

Docker

Basically everything said about regular installations also applies for docker and works the same way. Except the needed checkboxes to get the proper command executed and the needed sudoers line. If you use WireGuard inside a docker container you may need sudoers lines similar to this:

<wg-monitoring-user> ALL=NOPASSWD:/usr/bin/docker exec -it wireguard /usr/bin/wg show all dump
<wg-monitoring-user> ALL=NOPASSWD:/usr/bin/docker exec -it wireguard /usr/bin/wg set * peer * remove
<wg-monitoring-user> ALL=NOPASSWD:/usr/bin/docker exec -it wireguard /usr/bin/wg set * peer * allowed-ips *
<wg-monitoring-user> ALL=NOPASSWD:/usr/bin/docker exec -it wireguard /usr/bin/wg syncconf * * 

This adapter expects the name wireguard for your WireGuard container and the wg command in /usr/bin/inside the container. These values currently can't be customized.

How it works

Security hints

I highly recommend the use of sudoers under Linux!

These security hints rely mainly on linux since it's security system is more complex than the windows one. On a Windows server you'll simply need to use an administrative user. Since the wg command (which is executed to grab the state of WireGuard) requires administrative permissions, think well of what you are doing here and how you configure the user you place in config. To protect these credentials as well as possible both - username and password - are encrypted.

Basically there are three ways to execute the command:

known issues

Changelog

WORK IN PROGRESS

1.7.0 (2024-10-01)

1.6.4 (2024-05-08)

1.6.3 (2024-04-16)

1.6.2 (2024-03-26)

1.6.1 (2023-09-14)

1.5.11 (2023-08-30)

1.5.10 (2023-08-17)

1.5.9 (2023-08-12)

1.5.8 (2023-08-11)

1.5.7 (2023-08-10)

1.5.2 (2023-08-09)

1.5.1 (2023-08-08)

1.5.0 (2023-06-27)

1.4.1 (2022-10-26)

1.4.0 (2022-09-09)

1.3.2 (2022-09-07)

1.3.1 (2022-06-26)

1.3.0 (2022-06-25)

1.2.1 (2022-04-24)

1.2.0 (2022-04-21)

1.1.3 (2022-03-31)

1.1.2 (2022-03-17)

1.1.1 (2022-03-13)

1.1.0 (2022-03-06)

1.0.0 (2022-02-25)

v0.9.5 (2022-02-22)

v0.9.2 (2022-02-20)

v0.9.1 (2022-02-19)

v0.9.0 (2022-02-18)

v0.8.0 (2022-02-17)

v0.2.0 (2022-02-16)

v0.1.0 (2022-02-14)

v0.0.1

sentry.io

This adapter uses sentry.io to collect details on crashes and report it automated to the author. The ioBroker.sentry plugin is used for it. Please refer to the plugin homepage for detailed information on what the plugin does, which information is collected and how to disable it, if you don't like to support the author with you're information on crashes.

Disclaimer

This project is not related to WireGuard in any way. The name WireGuard and the WireGuard logo are only used to refer to this project and are the property of their owners. They are not part of this project.

License

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright

Copyright (c) 2024 grizzelbee open.source@hingsen.de