• 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.

iptables and plesk

T

tantrileft

Guest
i want to block a LOT of country with ip tables.

i have to insert something like 3000 lines of iptables commands.

i tried manually with a bash script and iptables crashed. (even if it would have not crashed it would have been unuseful because plesk would have then overwritten the tables).

i have seen that plesk store in mysql db all the datas about the iptables rules.

may i have a SQL script to insert in the mysql psa db the rules i want (3000 of them) without having iptables crash and without any problem?

is there not a way to use iptables-save/restore with plesk iptables?

thanks

stefano
 
Id just turn the psa firewall off then. Its really just a web gui on the same thing, and cant really do anything particularly powerful with netfilter. I'm running around 30,000 rules on my systems, so I can definitely say it can handle that many (and more, all documented in my book)

Quick and dirty script to do what you want here:

1) make a file, list the networks or hosts you want to block. One per line. Call it: shunlist, put it in /etc/rc.d

2) The script, or function to add to your firewall script:

#!/bin/sh
SHUNLIST=/etc/rc.d/shunlist

for i in `cat $SHUNLIST`; do
iptables -A INPUT -s $i -j DROP
done

And thats it
 
by "turning off" psa firewall you mean to remove the firewall module?
would this have no effects on the iptables standar standard (not psa) on the machine?

thanks!!!

Originally posted by atomicturtle
Id just turn the psa firewall off then. Its really just a web gui on the same thing, and cant really do anything particularly powerful with netfilter. I'm running around 30,000 rules on my systems, so I can definitely say it can handle that many (and more, all documented in my book)

Quick and dirty script to do what you want here:

1) make a file, list the networks or hosts you want to block. One per line. Call it: shunlist, put it in /etc/rc.d

2) The script, or function to add to your firewall script:

#!/bin/sh
SHUNLIST=/etc/rc.d/shunlist

for i in `cat $SHUNLIST`; do
iptables -A INPUT -s $i -j DROP
done

And thats it
 
thanks.. i was also thinking about another solution. inserting directly the rules in the psa database. but i see that the rules seem encrypted...

INSERT INTO `module_firewall_rules` (`id`, `configuration_id`, `direction`, `priority`, `object`) VALUES
(19, 1, 0, 0, 0x613a343a7b733a343a2274797065223b733a383a226361746368616c6c223b733a353a22636c617373223b733a383a226361746368616c6c223b733a393a22646972656374696f6e223b733a353a22696e707574223b733a363a22616374696f6e223b733a353a22616c6c6f77223b7d),


is it "object" the rule? how to encrypt it like that?
 
Back
Top