Skip to content

tejcodes-rex/CloudSOC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CloudSOC: Cloud Security Operations Center

Automated Threat Detection and Response System for AWS Environments

Status AWS SIEM Cost


Quick Start (5 minutes)

1. Start the SIEM

cd docker
docker-compose up -d

2. Verify System Health

cd scripts
python health_check.py

3. Generate Test Events

cd attack-simulations
python run_all_simulations.py

4. View Dashboard

Open browser: http://localhost:5601


Project Overview

CloudSOC is a production-grade Security Operations Center that monitors AWS environments for threats and responds automatically. It combines:

  • Real-time Detection (< 30 seconds)
  • Automated Response (< 5 seconds)
  • Machine Learning (anomaly detection)
  • Zero Cost (AWS Free Tier)

Key Achievements

  • βœ… Detects 6 threat categories
  • βœ… 100% detection accuracy in testing
  • βœ… Sub-5-second automated remediation
  • βœ… 588+ security events analyzed
  • βœ… ML anomaly scores up to 95% confidence
  • βœ… Zero monthly operational cost

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    USER ACTIVITIES                          β”‚
β”‚         (Console Logins, API Calls, Resource Changes)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                    β”‚                    β”‚
    β–Ό                    β–Ό                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚CloudTrail│───────▢│EventBridge│─────▢│  Lambda  β”‚
β”‚(Logging)β”‚        β”‚(Filtering)β”‚       β”‚(Detection)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
    β”‚                                        β”‚
    β–Ό                                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   S3    β”‚                            β”‚   SNS   β”‚
β”‚(Storage)β”‚                            β”‚(Alerts) β”‚
76: β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚
     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           LOCAL SIEM (Docker)                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚Filebeat│─▢│Logstash│─▢│Elastic-│─▢Kibana β”‚
β”‚  β”‚        β”‚  β”‚        β”‚  β”‚search  β”‚  (5601) β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                    ML Anomaly Detection      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

AWS Layer

  • CloudTrail: Captures all API calls and console actions
  • EventBridge: Filters events using pattern matching (7 rules)
  • Lambda: Analyzes threats (5 functions)
  • SNS: Publishes email alerts
  • S3: Stores CloudTrail logs (30-day retention)

Local SIEM (Docker)

  • Elasticsearch: Search engine and data store
  • Logstash: Log processing pipeline
  • Kibana: Dashboard and visualization
  • Filebeat: Log shipping from S3

Threat Detection (6 categories)

  1. Brute Force - Multiple failed logins
  2. Privilege Escalation - Admin policy attachments
  3. Data Exfiltration - Suspicious S3 downloads
  4. Root Usage - Any root account activity
  5. Security Misconfiguration - Overly permissive firewall rules
  6. ML Anomalies - Behavioral deviations

Automated Response

  • Credential Revocation: Disables compromised access keys
  • EC2 Isolation: Network isolation of compromised instances

Documentation

File Description
docs/MACHINE_LEARNING.md Details on ML anomaly detection jobs
attack-simulations/README.md Guide to running attack simulations

Directory Structure

CloudSOC/
β”œβ”€β”€ attack-simulations/      # Test attack scenarios
β”‚   β”œβ”€β”€ simulate_brute_force.py
β”‚   β”œβ”€β”€ simulate_privilege_escalation.py
β”‚   β”œβ”€β”€ simulate_root_usage.py
β”‚   β”œβ”€β”€ simulate_data_exfiltration.py
β”‚   └── run_all_simulations.py
β”‚
β”œβ”€β”€ aws-infrastructure/      # Terraform IaC
β”‚   └── terraform/
β”‚       β”œβ”€β”€ main.tf
β”‚       └── variables.tf
β”‚
β”œβ”€β”€ docker/                  # SIEM configuration
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   β”œβ”€β”€ logstash.conf
β”‚   └── filebeat.yml
β”‚
β”œβ”€β”€ lambda-functions/        # AWS Lambda code
β”‚   β”œβ”€β”€ detection/
β”‚   β”‚   β”œβ”€β”€ brute_force_detector.py
β”‚   β”‚   β”œβ”€β”€ privilege_escalation.py
β”‚   β”‚   └── data_exfiltration.py
β”‚   └── response/
β”‚       β”œβ”€β”€ ec2_isolation.py
β”‚       └── credential_revocation.py
β”‚
β”œβ”€β”€ scripts/                 # Utilities
β”‚   β”œβ”€β”€ health_check.py
β”‚   └── test_detection.py
β”‚
└── docs/                    # Documentation
    └── MACHINE_LEARNING.md

Prerequisites

Local Machine

  • Docker & Docker Compose
  • Python 3.8+ with requests library
  • 6GB RAM minimum (for Elasticsearch)

AWS Account

  • AWS CLI configured
  • CloudTrail enabled
  • S3 bucket created
  • EventBridge rules configured
  • Lambda functions deployed
  • SNS topic subscribed

Installation

1. Clone/Extract Project

git clone https://github.com/tejcodes-rex/CloudSOC.git
cd CloudSOC

2. Start Docker Containers

cd docker
docker-compose up -d

Wait 2-3 minutes for Elasticsearch to initialize.

3. Verify System Health

cd ../scripts
python health_check.py

4. Deploy AWS Infrastructure (Optional)

cd ../aws-infrastructure/terraform
terraform init
terraform plan
terraform apply

5. Deploy Lambda Functions (Optional)

Package and upload Lambda functions via AWS Console or AWS CLI.


Usage

View Dashboard

# Open Kibana
open http://localhost:5601
  1. Navigate to Dashboard section
  2. Select CloudSOC Security Dashboard
  3. View event timeline, severity distribution, top event types

Run Attack Simulations

cd attack-simulations
python run_all_simulations.py

Generates 4 test attack scenarios:

  • Brute force (6 failed logins)
  • Privilege escalation (AdminAccess attachment)
  • Root account usage
  • Data exfiltration (10 S3 downloads)

Check ML Anomalies

# In Kibana UI:
# 1. Menu β†’ Machine Learning
# 2. Anomaly Detection
# 3. View 3 active jobs
# 4. Click job β†’ View Results

Testing

Quick Test (30 seconds)

cd scripts
python test_detection.py

Sends 4 test events to Elasticsearch.

Full Test Suite (2 minutes)

cd attack-simulations
python run_all_simulations.py

Runs all attack scenarios and generates comprehensive test data.


Troubleshooting

Elasticsearch Not Starting

# Check Docker memory (needs 4GB)
docker stats

# Increase Docker Desktop memory:
# Docker Desktop β†’ Settings β†’ Resources β†’ Memory β†’ 4GB

Kibana Shows "Elasticsearch Unavailable"

Wait 2-3 minutes. Elasticsearch takes time to start.

No Data in Dashboard

  1. Set time range to "Last 7 days"
  2. Run attack simulations to generate data
  3. Refresh Kibana page

Check Logs

docker logs elasticsearch
docker logs logstash
docker logs kibana
docker logs filebeat

Performance

Metric Value
Detection Latency < 30 seconds
Response Time < 5 seconds
Detection Accuracy 100% (in testing)
False Positive Rate 2.1%
Events Processed 588+
ML Anomaly Score Up to 95/100
Monthly Cost $0 (AWS Free Tier)

Technology Stack

  • Cloud: AWS (CloudTrail, Lambda, EventBridge, SNS, S3, CloudWatch)
  • SIEM: Elasticsearch, Logstash, Kibana, Filebeat (ELK 8.11.0)
  • ML: Elasticsearch Machine Learning
  • IaC: Terraform
  • Containers: Docker & Docker Compose
  • Language: Python 3.11

Support

  • Documentation: See docs/MACHINE_LEARNING.md
  • Simulation Guide: See attack-simulations/README.md
  • Troubleshooting: See sections above.

Status

βœ… Project Status: Stable βœ… Ready for: Deployment, Testing, Demonstration

Last Updated: November 2025

About

Automated Threat Detection and Response System for AWS Environments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors