Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
fluent-plugin-filter-geo
Advanced tools
This is a Fluentd filter plugin for adding GeoIP data to record. Supports the new Maxmind v2 database formats.
Add this line to your application's Gemfile:
gem 'fluent-plugin-filter-geo'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-plugin-filter-geo
If true, enable to download GeoIP2 database autometically (default: true).
enable_auto_download true
GeoIP2 MD5 checksum URL (default: http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5)
md5_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5
GeoIP2 database download URL (default: http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz).
download_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
GeoIP2 MD5 checksum path. (default: ./geoip/database/GeoLite2-City.md5)
md5_path ./geoip/database/GeoLite2-City.md5
GeoIP2 database path. (default: ./geoip/database/GeoLite2-City.md5)
database_path ./geoip/database/GeoLite2-City.mmdb
Specify the field name that IP address is stored (default: ip).
lookup_field host
Specify the field name that store the result (default: geoip).
output_field geoip
Specify the field delimiter (default .).
field_delimiter .
If true, to flatten the result using field_delimiter (default: true).
flatten true
If true, If true, to geohidden geoname_id,metro_code the result using geohidden (default: false).
geohidden false
Get the data for the specified locale (default: en).
locale en
If true, to get continent information (default: true).
continent true
If true, to get country information (default: true).
country true
If true, to get city information (default: true).
city true
If true, to get location information (default: true).
location true
If true, to get postal information (default: true).
postal true
If true, to get registered country information (default: true).
registered_country true
If true, to get represented country information (default: true).
represented_country true
If true, to get subdivisions information (default: true).
subdivisions true
If true, to get traits information (default: true).
traits true
If true, to get connection type information (default: true).
connection_type true
<filter tail.log>
@type geo
enable_auto_download true
md5_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5
download_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
md5_path ./geoip/database/GeoLite2-City.md5
database_path ./geoip/database/GeoLite2-City.mmdb
lookup_field host
output_field geoip
field_delimiter .
flatten true
geohidden false
locale en
continent true
country true
city true
location true
postal true
registered_country true
represented_country true
subdivisions true
traits true
connection_type true
</filter>
Assuming following inputs are coming:
{
"host":"180.195.25.228",
"user":"-",
"method":"GET",
"path":"/category/giftcards?from=20",
"code":"200",
"size":"63",
"referer":"-",
"agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
}
then output bocomes as belows:
{
"host":"180.195.25.228",
"user":"-",
"method":"GET",
"path":"/category/giftcards?from=20",
"code":"200",
"size":"63",
"referer":"-",
"agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1",
"geoip.continent.code":"AS",
"geoip.continent.geoname_id":6255147,
"geoip.continent.name":"Asia",
"geoip.country.geoname_id":1694008,
"geoip.country.iso_code":"PH",
"geoip.country.name":"Philippines",
"geoip.city.geoname_id":1728893,
"geoip.city.name":"Bagumbayan",
"geoip.location.latitude":13.45,
"geoip.location.longitude":123.6667,
"geoip.location.time_zone":"Asia/Manila",
"geoip.postal.code":"4513",
"geoip.registered_country.geoname_id":1694008,
"geoip.registered_country.iso_code":"PH",
"geoip.registered_country.name":"Philippines",
"geoip.subdivisions.0.geoname_id":7521310,
"geoip.subdivisions.0.iso_code":"05",
"geoip.subdivisions.0.name":"Bicol",
"geoip.subdivisions.1.geoname_id":1731616,
"geoip.subdivisions.1.iso_code":"ALB",
"geoip.subdivisions.1.name":"Province of Albay",
}
then output bocomes as belows (geohidden false):
{
"host":"180.195.25.228",
"user":"-",
"method":"GET",
"path":"/category/giftcards?from=20",
"code":"200",
"size":"63",
"referer":"-",
"agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1",
"geoip.continent.code":"AS",
"geoip.continent.name":"Asia",
"geoip.country.iso_code":"PH",
"geoip.country.name":"Philippines",
"geoip.city.name":"Bagumbayan",
"geoip.location.latitude":13.45,
"geoip.location.longitude":123.6667,
"geoip.location.time_zone":"Asia/Manila",
"geoip.postal.code":"4513",
"geoip.registered_country.iso_code":"PH",
"geoip.registered_country.name":"Philippines",
"geoip.subdivisions.0.iso_code":"05",
"geoip.subdivisions.0.name":"Bicol",
"geoip.subdivisions.1.iso_code":"ALB",
"geoip.subdivisions.1.name":"Province of Albay",
}
After checking out the repo, run bundle install
to install dependencies. Then, run rake test
to run the tests.
Bug reports and pull requests are welcome on GitHub at https://github.com/mosuka/fluent-plugin-filter-geoip.
FAQs
Unknown package
We found that fluent-plugin-filter-geo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.