Skip to content

soniyaritgithub/AI-SOC-Analyst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ AI SOC Analyst

Enterprise Security Operations Center Platform

AI SOC Analyst is a full-stack cybersecurity platform designed to simulate a modern Security Operations Center (SOC) environment.

The platform provides centralized security monitoring, incident management, security analytics, role-based access control, audit logging, real-time communication capabilities, and production-ready REST APIs through a responsive SOC dashboard.

The project is built with a production-oriented architecture using React, TypeScript, Django REST Framework, PostgreSQL, Redis, Celery, Django Channels, Docker, and JWT authentication.


🌐 Live Application

Frontend

Live Demo:
https://ai-soc-analyst-eosin.vercel.app

Backend API

Backend:
https://ai-soc-backend-iqpx.onrender.com

Swagger API Documentation

Interactive Swagger UI:
https://ai-soc-backend-iqpx.onrender.com/api/docs/

OpenAPI Schema

https://ai-soc-backend-iqpx.onrender.com/api/schema/

Health Check

https://ai-soc-backend-iqpx.onrender.com/healthz

Note: The backend is currently hosted on a free Render instance. The first request after inactivity may take approximately 50 seconds or more while the service wakes up.


πŸ“Œ Project Overview

Modern Security Operations Centers process large volumes of security alerts and incidents.

AI SOC Analyst provides a centralized platform where security teams can:

  • Monitor security incidents
  • Analyze incident severity and trends
  • Track incident status
  • Assign incidents to SOC analysts
  • Manage incident response workflows
  • Monitor SOC analytics
  • Maintain audit logs
  • Generate security reports
  • Authenticate users securely using JWT
  • Apply role-based access control
  • Receive real-time security updates
  • Access documented REST APIs

The architecture is designed to support additional enterprise SIEM capabilities such as Elasticsearch, IOC management, threat intelligence, alert correlation, observability, and automated CI/CD.


✨ Key Features

πŸ” Authentication & Security

  • JWT-based authentication
  • Access and refresh token support
  • Automatic access-token refresh
  • Refresh-token rotation
  • Refresh-token blacklisting
  • Secure logout
  • Protected API endpoints
  • Role-Based Access Control (RBAC)
  • Secure password handling through Django
  • CORS configuration
  • CSRF trusted-origin configuration
  • HTTP security headers

Supported Roles

Role Purpose
Admin Administrative and privileged SOC operations
Manager SOC management and monitoring
SOC Analyst Incident investigation and response

🚨 Incident Management

The incident management module provides a structured workflow for security incidents.

Features include:

  • Incident listing
  • Incident details
  • Incident creation
  • Incident updates
  • Incident deletion
  • Analyst assignment
  • Incident status updates
  • Severity filtering
  • Status filtering
  • Search
  • Pagination
  • Analyst performance data
  • Incident statistics
  • Incident trend analysis

πŸ“Š SOC Dashboard

The security dashboard provides centralized visibility into SOC activity.

Dashboard capabilities include:

  • Security overview
  • Incident statistics
  • Severity distribution
  • Status distribution
  • Incident trends
  • Latest security incidents
  • SOC activity monitoring
  • Dashboard data aggregation
  • CSV dashboard export
  • Real-time monitoring architecture

πŸ“ˆ Security Analytics

The analytics module helps SOC teams understand incident patterns and operational trends.

Analytics include:

  • Incident statistics
  • Severity distribution
  • Status distribution
  • Incident trends
  • SOC analyst performance
  • Security metrics visualization

Charts and analytics are rendered using Recharts.


πŸ“ Audit Logging

Security-sensitive operations can be tracked through the audit logging system.

The module supports:

  • Audit log listing
  • Audit log details
  • Audit statistics
  • Audit dashboard
  • Authentication protection
  • Role-based authorization

This provides a foundation for accountability and security investigation workflows.


πŸ“„ Security Reports

The reporting module provides infrastructure for SOC reporting and security data exports.

The architecture supports:

  • Security report generation
  • Incident reporting
  • Dashboard exports
  • Security analytics reporting

⚑ Real-Time Architecture

The project includes asynchronous and real-time infrastructure using:

  • Django Channels
  • ASGI
  • Daphne
  • Redis
  • WebSockets
  • Celery

This architecture enables real-time SOC features and background security processing.


πŸ—οΈ System Architecture

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚        End User         β”‚
                         β”‚   SOC Analyst / Admin   β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                    HTTPS
                                      β”‚
                                      β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚      React Frontend     β”‚
                         β”‚  TypeScript + Vite UI   β”‚
                         β”‚         Vercel          β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                               REST API / JWT
                                      β”‚
                                      β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚       Django REST Backend       β”‚
                    β”‚          Django + DRF           β”‚
                    β”‚          Daphne / ASGI          β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚                     β”‚                     β”‚
              β–Ό                     β–Ό                     β–Ό
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ PostgreSQL   β”‚      β”‚    Redis     β”‚      β”‚    Celery    β”‚
      β”‚   Database   β”‚      β”‚ Cache/Channelβ”‚      β”‚ Background   β”‚
      β”‚              β”‚      β”‚    Layer     β”‚      β”‚    Tasks     β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                           β”‚  WebSockets  β”‚
                           β”‚   Channels   β”‚
                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Frontend

Technology Purpose
React Frontend UI
TypeScript Type-safe frontend development
Vite Frontend build tooling
Tailwind CSS Responsive styling
React Router Client-side routing
Axios API communication
Recharts Security analytics visualization
Lucide React Dashboard icons

Backend

Technology Purpose
Python Backend programming language
Django Backend framework
Django REST Framework REST API development
SimpleJWT JWT authentication
drf-spectacular OpenAPI / Swagger documentation
Django Channels WebSocket support
Daphne ASGI server
Celery Background task processing
django-filter API filtering

Data & Infrastructure

Technology Purpose
PostgreSQL Primary relational database
Redis Cache, Channels and Celery infrastructure
Docker Backend containerization
WhiteNoise Django static-file handling

Deployment

Service Purpose
Vercel React frontend deployment
Render Django backend deployment
GitHub Source control and repository hosting

πŸ“‚ Project Structure

AI-SOC-Analyst/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ accounts/
β”‚   β”œβ”€β”€ audit_logs/
β”‚   β”œβ”€β”€ common/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ detection/
β”‚   β”œβ”€β”€ incidents/
β”‚   β”œβ”€β”€ notifications/
β”‚   β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ system/
β”‚   β”‚
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ manage.py
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── utils/
β”‚   β”‚
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── vercel.json
β”‚
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

πŸ”Œ REST API

The backend exposes documented REST APIs for authentication, incidents, analytics, audit logs, reports, and system functionality.

API Documentation

Swagger provides an interactive interface for exploring and testing the REST API.

Swagger UI

https://ai-soc-backend-iqpx.onrender.com/api/docs/


Important API Routes

/api/accounts/
/api/incidents/
/api/audit-logs/
/api/reports/
/api/dashboard/
/api/system/
/api/schema/
/api/docs/

Incident Analytics

GET /api/incidents/
GET /api/incidents/stats/
GET /api/incidents/severity/
GET /api/incidents/status/
GET /api/incidents/trends/
GET /api/incidents/analysts/
GET /api/incidents/dashboard/

Incident Operations

GET    /api/incidents/<uuid>/
POST   /api/incidents/create/
PATCH  /api/incidents/<uuid>/update/
DELETE /api/incidents/<uuid>/delete/
PATCH  /api/incidents/<uuid>/assign/
PATCH  /api/incidents/<uuid>/status/

Protected endpoints require a valid JWT access token and may additionally enforce role-based permissions.


πŸ” Authentication Flow

User Login
    β”‚
    β–Ό
Django Authentication
    β”‚
    β–Ό
Access Token + Refresh Token
    β”‚
    β–Ό
Frontend Token Service
    β”‚
    β–Ό
Authorization: Bearer <access_token>
    β”‚
    β–Ό
Protected REST API
    β”‚
    β”œβ”€β”€ Valid Token ───────► API Response
    β”‚
    └── Expired Token
             β”‚
             β–Ό
        Refresh Token
             β”‚
             β–Ό
       New Access Token
             β”‚
             β–Ό
        Retry Request

βš™οΈ Local Development

1. Clone Repository

git clone https://github.com/soniyaritgithub/AI-SOC-Analyst.git

cd AI-SOC-Analyst

Backend Setup

2. Create Virtual Environment

Windows:

cd backend

python -m venv venv

venv\Scripts\activate

macOS / Linux:

cd backend

python3 -m venv venv

source venv/bin/activate

3. Install Backend Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create the required backend environment configuration using the provided .env.example as a reference.

Typical configuration includes:

SECRET_KEY=your-secret-key
DEBUG=True

DB_NAME=your_database
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_HOST=localhost
DB_PORT=5432

REDIS_URL=redis://127.0.0.1:6379/0

ALLOWED_HOSTS=127.0.0.1,localhost

CORS_ALLOWED_ORIGINS=http://localhost:5173
CSRF_TRUSTED_ORIGINS=http://localhost:5173

Email-related environment variables may also be required depending on the configured backend environment.

Never commit real secrets or production credentials to GitHub.


5. Run Database Migrations

python manage.py migrate

6. Validate Django Configuration

python manage.py check

Expected result:

System check identified no issues (0 silenced).

7. Run Backend Tests

python manage.py test

8. Start Django Backend

python manage.py runserver

Backend:

http://127.0.0.1:8000

Swagger:

http://127.0.0.1:8000/api/docs/

Frontend Setup

Open another terminal:

cd frontend

npm install

Create/configure the frontend environment file:

VITE_API_BASE_URL=http://127.0.0.1:8000

Then run:

npm run dev

Frontend:

http://localhost:5173

πŸ§ͺ Production Validation

Backend

cd backend

python manage.py check

python manage.py test

Frontend

cd frontend

npm run lint

npm run build

A successful production build generates the optimized frontend bundle in:

frontend/dist/

πŸ›‘οΈ Security Engineering

Security controls implemented in the project include:

  • JWT authentication
  • Refresh-token rotation
  • Token blacklisting
  • Role-Based Access Control
  • Protected REST endpoints
  • Secure Django password hashing
  • CORS restrictions
  • CSRF trusted origins
  • HTTPOnly session configuration
  • MIME sniffing protection
  • Clickjacking protection
  • Strict referrer policy
  • Environment-based secret management
  • API authorization
  • Audit logging

πŸš€ Deployment Architecture

GitHub Repository
       β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                         β”‚
       β–Ό                         β–Ό
    Vercel                     Render
       β”‚                         β”‚
       β–Ό                         β–Ό
React + Vite              Django REST API
Frontend                   Docker / ASGI
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                         β–Ό
               PostgreSQL                  Redis

The frontend and backend are independently deployable and communicate through secured REST APIs.


πŸ—ΊοΈ Enterprise SOC Roadmap

The next development phase expands the project toward more advanced SIEM and SOC capabilities.

Phase Enterprise Feature Status
7.1 Elasticsearch πŸ”œ Planned
7.2 SIEM Search πŸ”œ Planned
7.3 Alert Correlation Engine πŸ”œ Planned
7.4 IOC Management & Upload πŸ”œ Planned
7.5 Threat Intelligence Integration πŸ”œ Planned
7.6 API Rate Limiting πŸ”œ Planned
7.7 Prometheus Metrics πŸ”œ Planned
7.8 Grafana Dashboard πŸ”œ Planned
7.9 Sentry Monitoring πŸ”œ Planned
7.10 CI/CD Pipeline πŸ”œ Planned

🎯 Engineering Goals

This project demonstrates practical experience with:

  • Full-stack application architecture
  • Cybersecurity-focused application development
  • SOC workflow design
  • REST API development
  • JWT authentication
  • Role-Based Access Control
  • PostgreSQL data modeling
  • Redis infrastructure
  • Asynchronous processing
  • WebSocket architecture
  • Responsive React dashboards
  • TypeScript
  • API documentation
  • Docker containerization
  • Production deployment
  • Backend testing
  • Frontend production builds

πŸ“Έ Application Modules

The user interface includes:

  • Secure Login
  • User Registration
  • SOC Dashboard
  • Incident Management
  • Security Analytics
  • User Profile
  • Settings
  • Audit Logs
  • Reporting infrastructure

πŸ‘©β€πŸ’» Author

Sunidhi Shinde

B.Tech β€” Computer Science & Engineering

Areas of Interest:

  • Cybersecurity
  • Security Operations
  • SOC Analysis
  • Full-Stack Development
  • Backend Engineering
  • AI-powered Security Systems

Connect

LinkedIn:
https://www.linkedin.com/in/sunidhishinde/

GitHub:
https://github.com/soniyaritgithub


πŸ“œ License

This project is licensed under the MIT License.

See the LICENSE file for details.


⭐ Support

If you find this project useful or interesting, consider giving the repository a ⭐.


AI SOC Analyst
Enterprise Security Monitoring β€’ Incident Response β€’ Security Analytics

Releases

Packages

Contributors

Languages