Project

General

Profile

Bug #10332

PFBlockerNG loading GeoLite2-Country.mmdb

Added by John Clark 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
pfBlockerNG
Target version:
-
Start date:
03/10/2020
Due date:
% Done:

0%

Estimated time:
Affected Version:
2.4.5
Affected Architecture:
SG-3100

Description

Running pfsense 2.4.5.r.20200305.1800 with pfBlockerNG-devel 2.2.5_29

After downloading GeoLite2-Country.tar.gz, pfb extracts the mime type from the download using the "file" command.
The file command returns "application/gzip" for GeoLite2-Country.tar.gz
PFB then uses the mime type to determine how to handle the download. The default is to rename the download to the target name.
The application/gzip type is not one of the handled types, so GeoLite2-Country.tar.gz is renamed to GeoLite2-Country.mmdb
When mmdblookup tries to lookup the country info from filter logs during report generation, it receives the error:

Can't open /usr/local/share/GeoIP/GeoLite2-Country.mmdb - The MaxMind DB file contains invalid metadata

The GeoIP info in pfb reports is then listed and "Unk"

In the pfb_download function, changing :

if ($file_type  'application/x-gzip') {

to:

if ($file_type  'application/x-gzip' || $file_type == 'application/gzip') {

appears to solve the problem.

History

#1 Updated by Jim Pingle 3 months ago

  • Category set to pfBlockerNG

Also available in: Atom PDF