Netplan keeps Wi-Fi passwords and VPN keys in the same YAML files as the rest of your network settings. If those files are readable by everyone, so are the secrets.
The netplan docs recommend that every YAML file is owned by root and readable and writable by root only. Check what you have first:
ls -l /etc/netplan/
Anything like -rw-r--r-- is open to every account on the machine. Close it up:
sudo chown root:root /etc/netplan/*.yaml
sudo chmod 600 /etc/netplan/*.yaml
ls -l /etc/netplan/
After that the listing shows -rw-------. Nothing needs to be applied or restarted, because only the permissions changed.
It matters most on a machine where several people or services have a login. On a single user box I still do it, since a web app that gets broken into runs as a local user too. The same advice goes for files under /run/netplan and /lib/netplan if you put anything there.
One thing to remember: a new file you create with sudo nano usually gets mode 644, so run the chmod again whenever you add one.
Further reading: Netplan security documentation