[Intelmq-dev] GeoIP expert crashes with invalid database

Sebastian Wagner wagner at cert.at
Mon Jul 31 09:25:00 CEST 2017


Hi,

You are using this file:
https://github.com/certtools/intelmq/blob/develop/intelmq/bots/experts/maxmind_geoip/update-geoip-data

On 07/28/2017 10:00 AM, Thomas Hungenberg wrote:
> To avoid this, I think the updater should verify the downloaded database
> before overwriting the file.
The script already as `set -e`, so it should exit on errors -> for curl
everything was fine, we need to invoke the maxminddb:

python3 -c "import maxminddb; maxminddb.open_database('GeoLite2-City.mmdb')"

The non-zero exit code in case of en exception will then cause the abort
of the script.
> any parameters to "mv" which is probably not a good idea:
>
> # /usr/bin/update-geoip-data --help
> Usage: mv [OPTION]... [-T] SOURCE DEST
>   or:  mv [OPTION]... SOURCE... DIRECTORY
>   or:  mv [OPTION]... -t DIRECTORY SOURCE...
> Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
Reading the script, this seems to be intentional, as the first parameter
has to be the destination file. But we could catch -h and --help here to
print this instruction.

Thanks for raising this issue.

Sebastian

P.S.: for pyasn we use the pyasn's tools for download and conversion,
this is is probably not a problem there.

-- 
// Sebastian Wagner <wagner at cert.at> - T: +43 1 50564167201 
// CERT Austria - https://www.cert.at/
// Eine Initiative der nic.at GmbH - https://www.nic.at/
// Firmenbuchnummer 172568b, LG Salzburg


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 854 bytes
Desc: OpenPGP digital signature
URL: <http://lists.cert.at/pipermail/intelmq-dev/attachments/20170731/c49f63f6/attachment.sig>


More information about the Intelmq-dev mailing list