Bug 55533 - Initscript from univention-firewall can cause extreme delay
Initscript from univention-firewall can cause extreme delay
Status: NEW
Product: UCS
Classification: Unclassified
Component: Firewall (univention-firewall)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-06 13:44 CET by Christina Scheinig
Modified: 2023-01-30 11:30 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023010421000239
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2023-01-06 13:44:48 CET
During tests with UCS in an environment isolated from the Internet, it was noticed that the univention-firewall init script takes several minutes to run each time it is called. This is particularly noticeable during a package update, where the firewall is restarted again and again, for example.



The reason is that at the beginning of each action in the initscript (start, stop, restart, flush, etc) the current ruleset is queried via "iptables --wait -t filter -L". Unfortunately, iptables unnecessarily tries to convert each IP address into a DNS name, since the parameter "-n" was not specified. This leads to massive delay on a system with multiple external IPs in the firewall, since no external DNS is available for resolution. But even in environments with working DNS, there are moderate delays due to the name resolutions.

The solution here would be to change each call to "iptables --wait -t filter -L" in the initscript to "iptables --wait -t filter -L -n".

Even the iptables man page points to this:
 

       -L, --list [chain]

              List all rules in the selected chain.  If no chain is selected, all chains are listed. Like every other iptables command, it applies to the specified table (filter is the default), so NAT rules get listed by

               iptables -t nat -n -L

              Please note that it is often used with the -n option, in order to avoid long reverse DNS lookups.  It is legal to specify the -Z (zero) option as well, in which case the chain(s) will be atomically listed and zeroed.  The exact output is affected by the other arguments given.  The  exact  rules

              are suppressed until you use

               iptables -L -v

              or iptables-save(8).