[Wishlist] Disable hostname lookup by default for logwatch service sshd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logwatch (Ubuntu) |
Fix Released
|
Wishlist
|
Unassigned | ||
Xenial |
Won't Fix
|
Wishlist
|
Unassigned | ||
Bionic |
Fix Released
|
Wishlist
|
Unassigned | ||
Focal |
Fix Released
|
Wishlist
|
Unassigned | ||
Groovy |
Fix Released
|
Wishlist
|
Unassigned | ||
Hirsute |
Fix Released
|
Wishlist
|
Unassigned | ||
Impish |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
[Impact]
Logwatch looks up hostnames of every reported IP address, which
increases runtime (and thus increases power and network bandwidth usage)
especially for high-traffic servers.
Secondly, the resultant URLs included in Logwatch's report emails can
trigger spam filters.
This change adds an option to turn off ip lookup.
[Test Case]
1. Log into an lxc container running groovy or earlier
2. Install logwatch
$ sudo debconf-
$ sudo debconf-
$ sudo apt-get install -y msmtp msmtp-mta logwatch
3. Force an initial logrotation
$ sudo /usr/sbin/logrotate -vf /etc/logrotate.conf
4. Run logwatch manually
$ sudo logwatch --detail Med --service sshd --range "between
On a system with sshd exposed to the internet that has been up for some
time, this may take a considerable amount of time to run
[Where Problems Could Occur]
Since logwatch filters logs for errors pertinent to administrators,
standard things to watch out for are undesired changes in this filtering
behavior, such as flagging or failing to flag issues differently than
before, other than the specific messages being filtered with this
change. This specific change deals with how IP addresses are translated into hostnames, so particular issues to watch for would be any logic dependent on having textual addresses rather than numerical ones.
[Original Report]
By default, logwatch performs a hostname lookup of every IP address reported in SSHD logs. This has two negative consequences:
1. If there are lots of IP addresses to lookup, this increases the run time of logwatch significantly.
2. If logwatch is set to email logs, some spam filters detect the hostnames as URLs and will flag the email as spam due to the apparently large number of links. See https:/
Following a request for help to disable hostname lookups in sshd...
https:/
a developer committed a change to support this feature...
https:/
This wishlist has two requests:
1. Backport the patch (which is very easy to apply) to logwatch packages in currently supported LTS versions of Ubuntu. The patch defaults to performing the IP lookup, so this would not change the behavior of any existing installations, but it would expose the ability to disable these lookups if needed.
2. For future Ubuntu distributions, set the config to disable SSHD IP lookups by default. This could be accomplished by introducing /usr/share/
$sshd_ip_lookup = No
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 69 lines (+47/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/allow-disabling-lookup.patch (+39/-0)
debian/patches/series (+1/-0)
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 70 lines (+48/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/allow-disabling-lookup.patch (+40/-0)
debian/patches/series (+1/-0)
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 70 lines (+48/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/allow-disabling-lookup.patch (+40/-0)
debian/patches/series (+1/-0)
description: | updated |
Changed in logwatch (Ubuntu): | |
importance: | Undecided → Wishlist |
Changed in logwatch (Ubuntu Xenial): | |
status: | New → Triaged |
Changed in logwatch (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in logwatch (Ubuntu Focal): | |
status: | New → Triaged |
Changed in logwatch (Ubuntu Groovy): | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Changed in logwatch (Ubuntu Focal): | |
importance: | Undecided → Wishlist |
Changed in logwatch (Ubuntu Bionic): | |
importance: | Undecided → Wishlist |
Changed in logwatch (Ubuntu Xenial): | |
importance: | Undecided → Wishlist |
Changed in logwatch (Ubuntu Hirsute): | |
status: | Triaged → Fix Released |
description: | updated |
description: | updated |
Hi Matthew,
First thank you for taking the time to file this bug and try to make Ubuntu better.
The upstream patch you provided is straightforward. I am tagging this bug as server-next to put it in our team's queue of work to be done.