Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Foundational changes required before any new feature work can begin. - 0.1 Redis infrastructure: add redis:7-alpine to docker-compose dev and prod, REDIS_URL config, singleton client in app/infrastructure/redis_client.py - 0.2 Token blacklist on Redis SEC-001: replace in-memory dict with Redis SETEX keyed by jti, auto-expiring TTL derived from token exp - 0.3 Database indexes SR-006: Alembic migration b019 with 5 composite indexes for scoring, MTTD/MTTR, remediation, and notification queries - 0.4 Domain exceptions TD-003: app/domain/exceptions.py with typed errors, error_handler middleware mapping them to HTTP, services decoupled from FastAPI - 0.5 Fix silenced exceptions TD-007: replace 4 bare except-pass blocks in test_workflow_service with logger.warning with exc_info - 0.6 CI pipeline TD-009: GitHub Actions workflow with Postgres and Redis service containers, ruff lint, pytest; ruff.toml for baseline config
142 lines
4.8 KiB
YAML
142 lines
4.8 KiB
YAML
# =============================================================================
|
|
# Aegis - MITRE ATT&CK Coverage Platform (Development)
|
|
# =============================================================================
|
|
#
|
|
# Quick Start:
|
|
# docker-compose up -d
|
|
#
|
|
# Access:
|
|
# - Frontend: http://localhost:5173
|
|
# - Backend API: http://localhost:8000
|
|
# - Swagger UI: http://localhost:8000/docs
|
|
# - MinIO Console: http://localhost:9001 (minioadmin/minioadmin)
|
|
#
|
|
# Admin credentials are auto-generated on first start — check the
|
|
# backend container logs: docker-compose logs backend | grep -A5 "Admin"
|
|
# =============================================================================
|
|
|
|
services:
|
|
# ── PostgreSQL Database ────────────────────────────────────────────────────
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: aegis-postgres
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: attackdb
|
|
ports:
|
|
- "5433:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d attackdb"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# ── MinIO Object Storage ───────────────────────────────────────────────────
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: aegis-minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin
|
|
ports:
|
|
- "9000:9000" # API
|
|
- "9001:9001" # Console
|
|
volumes:
|
|
- minio_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "mc", "ready", "local"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# ── Redis ──────────────────────────────────────────────────────────────────
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: aegis-redis
|
|
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# ── FastAPI Backend ────────────────────────────────────────────────────────
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: aegis-backend
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
# Database
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/attackdb
|
|
# Security — SECRET_KEY is left unset so an ephemeral key is
|
|
# auto-generated for local development (see backend logs for warning).
|
|
# Set it explicitly if you need persistent sessions across restarts.
|
|
ALGORITHM: HS256
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: 60
|
|
# Redis
|
|
REDIS_URL: redis://redis:6379/0
|
|
# MinIO
|
|
MINIO_ENDPOINT: minio:9000
|
|
MINIO_ACCESS_KEY: minioadmin
|
|
MINIO_SECRET_KEY: minioadmin
|
|
MINIO_BUCKET: evidence
|
|
MINIO_SECURE: "false"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_started
|
|
volumes:
|
|
- ./backend:/app
|
|
command: sh /app/entrypoint.sh
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# ── React Frontend (Development) ───────────────────────────────────────────
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
target: development
|
|
container_name: aegis-frontend
|
|
ports:
|
|
- "5173:5173"
|
|
environment:
|
|
# Vite environment variables
|
|
VITE_API_URL: http://localhost:8000/api/v1
|
|
depends_on:
|
|
- backend
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules # Prevent overwriting node_modules
|
|
restart: unless-stopped
|
|
|
|
# ── Volumes ──────────────────────────────────────────────────────────────────
|
|
volumes:
|
|
postgres_data:
|
|
name: aegis_postgres_data
|
|
minio_data:
|
|
name: aegis_minio_data
|
|
redis_data:
|
|
name: aegis_redis_data
|