Skip to content

A tool to sync (dynamic) IPs by their hostnames with ufw firewall ports.

License

Notifications You must be signed in to change notification settings

biersoeckli/sweetUFW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sweetUFW

A tool to sync (dynamic) IPs by their hostnames with ufw firewall ports.

how it works

  1. Download the artifact from the github actions page or checkout the code and run locally.

  2. 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).
  1. Start the tool with the filepath of the config (step 2) as argument
./SweetUfw /my/path/to/config/sweetUFW.conf.json
  1. 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.