KovvalVeetil / web-traffic-anomaly-detector

The Web Traffic Anomaly Detector is a Ruby on Rails application designed to monitor web traffic logs and detect anomalies such as high traffic from a single IP address or unusual request patterns. The project aims to help identify potential issues like bot attacks, unauthorized access, or other irregular activities in web server traffic. WIP
3 stars 0 forks source link
apache postgresql redis ruby ruby-on-rails scripts sidekiq

Web Traffic Anomaly Detector - Backend

The Web Traffic Anomaly Detector is a Ruby on Rails application designed to monitor web traffic logs and detect anomalies such as high traffic from a single IP address or unusual request patterns. The project aims to help identify potential issues like bot attacks, unauthorized access, or other irregular activities in web server traffic.

Features

Technologies Used

Getting Started

Prerequisites

Installation

  1. Clone the Repository:

    git clone https://github.com/your-username/web-traffic-anomaly-detector.git
    cd web-traffic-anomaly-detector
  2. Install Dependencies:

    bundle install
  3. Set Up Database:

    Create and migrate the database:

    rails db:create
    rails db:migrate
  4. Configure Web Server:

    Set up Apache or Nginx on your local machine to generate logs. Ensure logs are accessible by your Rails application for ingestion.

  5. Start the Rails Server:

    rails server

Running Background Jobs

Setup Redis, Sidekiq

sudo apt update
sudo apt install redis-server

sudo systemctl start redis-server

sudo systemctl status redis-server

gem 'sidekiq'
bundle exec sidekiq

Configuration

config/initializers/sidekiq.rb
config/application.rb

Set Up Apache Web Server

sudo a2ensite web_server_test.conf
sudo systemctl reload apache2

Setup background jobs with sidekiq

rails generate job AnomalyDetection

bundle exec sidekiq

Alerts and Notifications

rails generate mailer AnomalyMailer