Skip to content

[wireguard] Add plugin for WireGuard VPN tunnels - #4426

Open
suraj-cmd wants to merge 1 commit into
sosreport:mainfrom
suraj-cmd:add-wireguard-plugin
Open

[wireguard] Add plugin for WireGuard VPN tunnels#4426
suraj-cmd wants to merge 1 commit into
sosreport:mainfrom
suraj-cmd:add-wireguard-plugin

Conversation

@suraj-cmd

Copy link
Copy Markdown
Contributor

WireGuard is in the mainline kernel and wireguard-tools is packaged for RHEL,
Fedora, Debian and Ubuntu, but sos has no plugin for it and no other plugin
references it. Neither the interface configuration nor the runtime tunnel state
reaches an sosreport.

The plugin collects /etc/wireguard/*.conf, the output of wg show all, and
the status and journal of the templated wg-quick@ unit.

wg showconf is deliberately not run: it prints the interface private key
verbatim. wg show masks private and preshared keys as (hidden) unless
WG_HIDE_KEYS=never is set in the environment, per masked_key() in
src/show.c, so its default output is safe.

The configuration files themselves hold the private key and any per-peer
preshared key in cleartext, so postproc() redacts both. Public keys,
endpoints and allowed IPs are left intact, since those are what a tunnel
problem is usually diagnosed from.

Example of the substitution:

PrivateKey = 8Gt...=    ->    PrivateKey = ********

Paths, unit name and key-masking behaviour are taken from upstream
wireguard-tools (src/show.c, src/config.c,
src/systemd/wg-quick@.service) rather than a running deployment. The
postproc() regex was tested against sample config lines: PrivateKey and
PresharedKey are redacted while PublicKey, Endpoint and AllowedIPs are
left intact.


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message

WireGuard is in the mainline kernel and wireguard-tools is
packaged for RHEL, Fedora, Debian and Ubuntu, but sos has no
plugin for it and no other plugin references it. Neither the
interface configuration nor the runtime tunnel state reaches an
sosreport.

The plugin collects /etc/wireguard/*.conf, the output of
"wg show all", and the status and journal of the templated
wg-quick@ unit.

"wg showconf" is deliberately not run: it prints the interface
private key verbatim. "wg show" masks private and preshared
keys as "(hidden)" unless WG_HIDE_KEYS=never is set in the
environment, per masked_key() in src/show.c, so its default
output is safe.

The configuration files themselves hold the private key and any
per-peer preshared key in cleartext, so postproc() redacts
both. Public keys, endpoints and allowed IPs are left intact,
since those are what a tunnel problem is usually diagnosed
from.

Example of the substitution:

  PrivateKey = 8Gt...=    ->    PrivateKey = ********

Signed-off-by: Suraj Patil <surajpatil522@gmail.com>
@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4426
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

1 similar comment
@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4426
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

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.

1 participant