Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.7 KB

README.md

File metadata and controls

28 lines (23 loc) · 1.7 KB

Scripts for devices affected by balena's VPN sunsetting

There are two scripts in this project to get:

  • The endpoint configured in every active device
  • The deactivated devices which last os_version resported is affected

Requirements

get_all_os_versions_and_vpn.py

Script to ssh into every active the devices and retrieve the VPN endpoint that is configured. Obviously, this will only work for devices that are online, so if you are unsure, please execute this script regularly

The steps performed by the script are:

  • Retrieves all the devices associated to the org using the API, or uses an input file to narrow the search (one UUID per line)
  • Check if the OS version is affected
  • ssh into each of the affected devices
  • grep the contents of /etc/openvpn/openvpn.conf
  • returns the first entry with 'remote'. Eg. remote vpn.balena-cloud.com
  • prints the result: [uuid, os version, VPN endpoint]
  • if device is offline (is_online==false), indicate it in the endpoint field

If the VPN Endpoint is "Not available", a possible reason is that the SSH keys are not set correcly. Check https://docs.balena.io/learn/manage/ssh-access/#add-an-ssh-key-to-balenacloud

get_old_deactivated_devices.py

Script to query the API to retrieve all the deactivated devices, and print those that are affected by the os version.