- Real-Time Threat Streaming — WebSocket-powered live event feed to browser dashboards
- Threat Simulation Engine — Automated generation of realistic network attack patterns
- Z-Score Anomaly Detection — Rust CLI statistical analysis for identifying threat outliers
- Multi-Vector Attack Types — PortScan, BruteForce, SQLInjection, XSS, DDoS, MalwareC2
- Severity Classification — LOW / MEDIUM / HIGH / CRITICAL threat scoring system
- Containerized Deployment — Docker Compose orchestration for instant environment setup
- CI/CD Pipeline — GitHub Actions with Go + Rust + Docker build verification
git clone https://github.com/Raphasha27/cybershield_soc.git
cd cybershield_soc
docker-compose up --buildBackend available at http://localhost:8080.
Full architecture documentation: docs/ARCHITECTURE.md
┌──────────────────┐ WebSocket ┌──────────────────┐
│ │ ◄──────────────────► │ │
│ Client Dashboard│ │ Go Backend │
│ (Browser) │ │ WebSocket Hub │
│ │ │ REST API │
└──────────────────┘ └────────┬─────────┘
│
┌────────▼─────────┐
│ │
│ Threat Simulator│
│ (Go goroutine) │
│ │
└──────────────────┘
┌──────────────────┐ stdin (JSON) ┌──────────────────┐
│ │ ◄──────────────────► │ │
│ Threat Events │ │ Rust Analyzer │
│ (JSON lines) │ ──────────────────► │ Z-Score / Stats │
│ │ stdout (report) │ Anomaly Scoring │
└──────────────────┘ └──────────────────┘
Full API reference: docs/API.md · Swagger UI:
http://localhost:8080/swagger-ui.html
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Service health probe |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/metrics |
24h threat totals, severity breakdown |
| Protocol | Endpoint | Description |
|---|---|---|
| WebSocket | ws://localhost:8080/ws/events |
Real-time threat event stream |
| Component | Technology | Description |
|---|---|---|
| Backend | Go 1.22 | REST API + WebSocket hub (gorilla/websocket, gorilla/mux) |
| CLI Analyzer | Rust 2021 | Statistical anomaly detection (serde, serde_json) |
| Communication | WebSockets | Real-time bidirectional threat streaming |
| Container | Docker + Compose | Multi-service container orchestration |
| CI/CD | GitHub Actions | Automated build, test, and lint pipeline |
cybershield_soc/
├── .github/
│ └── workflows/
│ └── ci.yml # CI pipeline: Go + Docker + Rust
├── backend/
│ ├── cmd/server/
│ │ └── main.go # Application entrypoint
│ ├── internal/
│ │ ├── handlers/
│ │ │ ├── websocket.go # WebSocket hub & connection management
│ │ │ └── websocket_test.go
│ │ ├── models/
│ │ │ ├── threat.go # Threat & Metrics data models
│ │ │ └── threat_test.go
│ │ └── services/
│ │ ├── simulator.go # Threat simulation engine
│ │ └── simulator_test.go
│ ├── Dockerfile
│ └── go.mod
├── tools/
│ └── threat-analyzer/
│ ├── src/
│ │ └── main.rs # Rust anomaly detection CLI
│ └── Cargo.toml
├── docs/
│ ├── ARCHITECTURE.md # System architecture docs
│ └── API.md # API reference docs
├── docker-compose.yml
├── Makefile
├── CONTRIBUTING.md
├── SECURITY.md
├── LICENSE
└── README.md
# Run Go unit tests with race detector
make test
# Run Rust analyzer tests
cd tools/threat-analyzer && cargo test
# Run all linters
make lintdocker-compose up --build -d
docker-compose logs -f # View live logs
docker-compose down # Stop all services| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
Backend server port |
WS_TICK_MS |
1000 |
Threat event broadcast interval (ms) |
LOG_LEVEL |
info |
Logging verbosity |
cd backend && go build -o ../bin/cybershield-server ./cmd/server
cd tools/threat-analyzer && cargo build --releaseContributions are welcome! Please read CONTRIBUTING.md and open an issue before submitting a PR.
MIT License — see LICENSE for details.
Built by Koketso Raphasha · Portfolio