Sign inSign up

nbpub/beatlog

By nbpub

•Updated over 3 years ago

BeatLog parses NGINX reverse proxy and fail2ban logs into readable tables and reports.

Image
0

2.2K

nbpub/beatlog repository overview

⁠ BeatLog

BeatLog parses NGINX⁠ reverse proxy and fail2ban⁠ logs into readable tables and reports. Use BeatLog to assess server traffic and tailor fail2ban filters.

Visit the project repository⁠ to for up to date documentation and to learn more. Visitor Map and Report Demo page⁠

Stable release: alpha-0.1.7⁠

ArchitectureLatest TagsStable Tags
x86-64lateststable, alpha-0.1.7
arm64lateststable, alpha-0.1.7
armhf
arm32v7-stable, arm32v7-alpha-0.1.7
⁠Basic Docker Compose⁠ Example | Extra Options⁠
---
version: "2.1"
services:
  beatlog:
    image: nbpub/beatlog:latest
    container_name: beatlog
    user: 1000:1000 # optional	
    ports:
      - 5000:8000 # access from 5000 instead of 8000, for demonstration
    environment:
      - TZ=Pacific/Galapagos
      - db_host=<IP>
      - db_password=changeme	  
      - FLASK_SECRET_KEY=<secretkey>
      - check_IP=12
      - check_Log=3	  
    volumes:
      - /path_to/swag_config/log:/import/log # NGINX and fail2ban logs
      - /path_to/swag_config/fail2ban:/import/fail2ban # fail2ban jail.local
      - /path_to/swag_config/geoip2db:/import/geoip2db # MaxMindDB
    depends_on:
      - db
  db:
    image: postgres:15
    container_name: beatlog_db
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=beatlog
      - POSTGRES_PASSWORD=changeme
      - TZ=Pacific/Galapagos	  
    volumes:
      - /path_to/beatlog_conifg/db:/var/lib/postgresql/data # recommended
    restart: unless-stopped   	
⁠Compose Details
ParameterFunction
user
1000:1000Optional setting⁠ to change the user used for the docker container. See also⁠
ports
5000:8000Example of changing external access port. Internal port, 8000, should not be changed.
environment
TZ=Pacific/GalapagosTimezone should match log files. Defaults to UTC. time zone list⁠
db_host=<IP>IP address or host name of PostgreSQL database, defaults to localhost which should fail
db_password=changemePostgreSQL database password, should match POSTGRES_PASSWORD
db_port=Only needed if database port is changed, defaults to 5432
db_user=Only needed if POSTGRES_USER is changed, defaults to beatlog
db_database=Only needed if POSTGRES_USER is changed, defaults to beatlog
FLASK_SECRET_KEY=<secretkey>Generate a secret key⁠ for deployment. Default, dev, is not suitable
check_IP=12Interval (hours) for checking / updating the home IP address, 12 hr default. Specify as integer, or 0 to disable
check_Log=3Interval (hours) for checking / parsing the Log Files, 3 hr default. Specify as integer, or 0 to disable
volumes
/path/to/log_directory:
/path/in/container
Add log files, fail2ban jail, and MaxMindDB to container, to be read by BeatLog. See Data Sources below.
/swag_config/<subdirectory>:
/import/<subdirectory>
example for SWAG structure in setup guide⁠
. . .. . .
postgres db ports
5432:5432Default database port. If the external port is changed, then db_port must be specifed for the beatlog container
postgres db environment
POSTGRES_USER=beatlogIf changed from beatlog, db_user and db_database must be specified for the beatlog container
POSTGRES_PASSWORD=changemePostgreSQL database password, should match db_password
TZ=Pacific/GalapagosSee above
postgres db volumes
/path_to/beatlog_conifg/db:
/var/lib/postgresql/data
Recommended⁠: Store database files in a location of your choosing. Facilitates PostgreSQL updates.
⁠Data Sources

BeatLog reads the following files for the information described. See the Parsing⁠ and Processed Data⁠ sections of the Guide⁠ for more information.

  • NGINX reverse proxy
    • access.log - client requests to the server
    • error.log - client request errors and associated severity levels
  • fail2ban
    • fail2ban.log - all activity of fail2ban service, relevant information is parsed and the rest ignored
    • jail.local - fail2ban settings and activated filters, checks ignored IPs
  • MaxMindDB
    • GeoLite2-City.mmdb - database to match IP addressess to locations, updated twice monthly

Tag summary

Content type

Image

Digest

sha256:89d375477…

Size

50.8 MB

Last updated

over 3 years ago

docker pull nbpub/beatlog