Skip to main content

Log analyzer to discover anomalies

Project description

https://travis-ci.org/dbaio/loganom.svg?branch=master

loganom is a tool that checks log files in search for anomalies. Many small and medium companies that have only local users (in the same country) can use loganom.

The first processor check postfix sasl authentication.

Usually when an account is compromised, attackers use several machines from their botnets to send emails (spam/virus/phishing/etc) with that credential.

This can be observed when a user that usually connects from the same country, suddenly send emails from all around the world.

This is an experimental program.

Installation

Install using pip:

pip install loganom

Sources are available at <https://github.com/dbaio/loganom>.

Usage

Command line usage:

loganom postfix-sasl -c config.ini -l logfile

Debugging:

LOGLEVEL=DEBUG loganom postfix-sasl -c config.ini -l logfile

Sample execution:

LOGLEVEL=DEBUG loganom postfix-sasl -c config.ini -l logfile
DEBUG:      Starting validating configuration file...
[postfix-sasl]
DEBUG:      Starting "postfix-sasl"
DEBUG:      Log file: logfile
DEBUG:      Start log reading...
DEBUG:      user@domain - 92.36.X.Y
DEBUG:      user@domain - 176.63.X.Y
[...]
DEBUG:      user@domain - 188.69.X.Y
DEBUG:      End log reading...
DEBUG:      Start processing the dictionary...
DEBUG:      user@domain (6)
DEBUG:      Start processing email: user@domain
DEBUG:        IP: 209.85.218.52 - Reverse: mail-ej1-f52.google.com.
DEBUG:          mail-ej1-f52.google.com. skipped by google
DEBUG:        IP: 52.125.129.21 - Reverse: unknown
DEBUG:      Starting new HTTP connection (1): ipinfo.io:80
DEBUG:        Contry: US
DEBUG:          AS8075 Microsoft Corporation skipped by AS8075
[...]

E-mail address: user@domain
  92.36.X.Y - BA - Bihać - unknown - AS9146 BH Telecom d.d. Sarajevo
  176.63.X.Y - HU - Maklár - catv-176-63-195-207.catv.broadband.hu. - AS6830 Liberty Global B.V.
  195.242.X.Y - UA - Chernihiv - unknown - AS34355 Chernigivtelecom LLC
  188.76.X.Y - ES - Collado-Villalba - 119.17.76.188.dynamic.jazztel.es. - AS12479 Orange Espagne SA
  87.116.X.Y - RS - Belgrade - unknown - AS31042 Serbia BroadBand-Srpske Kablovske mreze d.o.o.
  188.69.X.Y - LT - Vilnius - md-188-69-195-171.omni.lt. - AS8764 Telia Lietuva, AB

Configuration:

[GENERAL]
# Check if the ip address can be ignored, based on a list of name patterns
pattern_ip = amazonaws.com
  google
  .net.br
  .com.br

# Check if the ip address can be ignored based on it's ASN
pattern_org = AS8075
  AS36351
# AS8075   Microsoft Corporation
# AS36351  SoftLayer Technologies Inc

# country_ignore can be a list
country_ignore = BR

ipinfo_token = XXXXXXXX

[SMTP]
enabled = False
from = your_mail@from
to = your_mail@to
host = localhost
port = 587
ssl = False
user = username
pass = password
subject = SMTP authentication, anomalies found...

[MATTERMOST]
enabled = False
url =

Ideas

  • Use a database

  • Send alert to users

  • API to block/unblock users

  • Read logs in realtime

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loganom-0.0.4.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

loganom-0.0.4-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file loganom-0.0.4.tar.gz.

File metadata

  • Download URL: loganom-0.0.4.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/18.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for loganom-0.0.4.tar.gz
Algorithm Hash digest
SHA256 90bbe272cbadd3f93c8eb9a755ea13ca60bb981d4c9d2025e724564981a67c6d
MD5 85ebea47cff03040246d7f06c2526e37
BLAKE2b-256 127bc99818f2d68f4181c471604d1ac04a9cc546b822df02e0294e4428a095e1

See more details on using hashes here.

File details

Details for the file loganom-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: loganom-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/18.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for loganom-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 75c497a0666bfcdb9a0ca15d157360b9c92b88616d493a05f7e45d2fb43ed5c7
MD5 a603b931e2474961de7337bc27d3d14c
BLAKE2b-256 cd9a520b20461f2460b380bf5ac1bf3b2f8b440964735720e4bbd35217707f4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page