• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

How to update firewall with cron?

B

belvin

Guest
How to update firewall with cron?

I have access to a set of iptables rules that block spam originating from Asia.
This set of rules is updated frequently and I would like my server firewall to use the updated data.

Bringing the new rules on my server with cron is easy.

I know Plesk's rules are stored in a database, but to implement its firewall, it seems that Plesk creates a script called firewall-active.sh

Questions
If I open the script firewall-active.sh, inject my special anti-spam rules in it (via cron), then run the script (via cron), will this update my firewall properly?

Is there any other shell command that needs to be done to refresh the iptables firewall, besides running the script firewall-active.sh ?

Thanks
 
Could I suggest you use APF instead of the Plesk Firewall? Much easier to configure and it would be much easier for your script. All you would need to do is edit the /etc/apf/deny_hosts.rules file and then issue
#apf -r
 
Back
Top