extraNetFilterRules¶
extraNetFilterRules is where you add your own rules to the local firewall of the Mediation
Controller. The product applies a predefined set of rules, then reads this file.
| Property | Value |
|---|---|
| Component | Mediation Controller |
| Path | /etc/ipdiva/server/extraNetFilterRules |
| Owner and permissions | zope:ipdivasrv, 644 |
| Package | ipdiva-server (a configuration file kept on upgrade) |
| Format | shell script, sourced |
The file is only read in cluster mode
The filtering script of the product does nothing when the server is in standalone mode: it returns immediately, before applying any rule and before reading this file. On a Standalone Mediation Controller, writing rules here therefore has no effect at all, and nothing says so. The local firewall of a Standalone server is yours to manage, outside the product.
Structure¶
The file is sourced by a shell script, not parsed as a list of rules: you write commands, one
per line, usually iptables ones.
1 | |
It is delivered empty.
A command here runs as root, and its errors are silent
Anything a shell accepts is executed, not only iptables. A mistyped command fails where the
firewall is being built, without stopping it: you end up with a partial rule set. Test your
commands before putting them in the file.
Where your rules take place¶
The script builds the INPUT chain in this order:
- the default policy of
INPUTis set to DROP; - the loopback interface and
127.0.0.0/8are accepted; - TCP 22, TCP 80, the HTTPS port and the SSL Router port are accepted;
- ICMP is accepted;
- the addresses of the other node of the cluster, and the virtual addresses, are accepted;
- your rules are read here;
- finally, the established connections are accepted.
Two consequences:
- your rules are added after those of the product, so you cannot remove one of them by writing
a rule: an
ACCEPTplaced earlier by the product wins; - they are added before the rule on established connections, which is therefore never shadowed by yours.
Rules at shutdown
The file /etc/ipdiva/server/stopExtraNetFilterRules, delivered empty as well, is sourced when
the filtering is stopped. Put there what has to be undone, for instance a rule added in another chain.
Hardening guide
See Local firewall, recommendation R39.
Applying a change¶
The filtering script runs when the SSL Router starts, right after it, and
stopExtraNetFilterRules when it stops: a change only applies when the SSL Router is restarted.
1 | |
Restarting the SSL Router cuts the connections in progress
The SSL Router carries the connections of the Edge Gateways, of the clients and of the web accesses: those in progress are cut, and during the restart users can neither sign in to the portal nor launch an application. Plan the change outside working hours, and restart one node at a time.
Then check the result:
1 | |
Upgrade¶
The file is kept on upgrade. If you modified it, the upgrade asks whether to keep your version or
to install the new one: the version not chosen is kept next to it, as
extraNetFilterRules.dpkg-old (your former version) or extraNetFilterRules.dpkg-dist (the new
version).