A tool to sync (dynamic) IPs by their hostnames with ufw firewall ports.
-
Download the artifact from the github actions page or checkout the code and run locally.
-
Create a config file with the following content (/my/path/to/config/sweetUFW.conf.json):
{
"22": ["biersoeckli.ch"]
}
- The property name of the object is the port where incoming TCP connections are allowed (here 22).
- Value ["biersoeckli.ch"] => allowed hostnames for accessing the defined port (property name).
- Start the tool with the filepath of the config (step 2) as argument
./SweetUfw /my/path/to/config/sweetUFW.conf.json
- Create a crontab job running the command above. The tool syncs the IP adresses behind the hostnames an their allowed ports with the UFW firewall.