Enhancment: Add country of origin to the mail templates
Closed this issue · 3 comments
GoogleCodeExporter commented
Hi Thomas,
This is only a suggestion for the mail templates thats being used by HonSSH.
It would be nice to get the country of origin added to the templates as well.
- The current output looks like this:
2014-08-09 22:46:33 - Incoming connection from: 8.8.8.8:42316 -
SSH-2.0-libssh-0.4.8
2014-08-09 22:46:33 - Successful login - Username:root Password:root
- My suggestion is changing it to something like this:
2014-08-09 22:46:33 - Incoming connection from: 8.8.8.8:42316 - United States -
SSH-2.0-libssh-0.4.8
2014-08-09 22:46:33 - Successful login - Username:root Password:root
Maybe it would be possible to add it using something similar to this?
import GeoIP
def cname(ipv4_str):
"""Checks the ipv4_str against the GeoIP database. Returns the full country name of origin if
the IPv4 address is found in the database. Returns None if not found."""
geo = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
country = geo.country_name_by_addr(ipv4_str)
return country
//Are
Original issue reported on code.google.com by are@bifrozt.com
on 9 Aug 2014 at 9:25
GoogleCodeExporter commented
Original comment by tnn...@googlemail.com
on 9 Aug 2014 at 9:33
- Changed state: Accepted
GoogleCodeExporter commented
Original comment by tnn...@googlemail.com
on 2 Sep 2014 at 12:58
- Changed state: Started
GoogleCodeExporter commented
Original comment by tnn...@googlemail.com
on 5 Oct 2014 at 1:39
- Changed state: Fixed