LOGIC is a local-first detection and investigation platform for two telemetry domains: web server logs and Windows event logs. The platform combines ingestion, normalization, correlation, detection, behavioral analytics, and analyst workflows in a single operational stack.
The repository contains the following major components.
- API service built with FastAPI for authentication, project lifecycle, ingestion, analysis, search, and administration.
- Web console built with Next.js for analyst and administrator workflows.
- Core processing modules for parsing, normalization, detection logic, enrichment, and storage.
- Runtime data store based on SQLite and project-scoped artifact files under the data directory.
- Agent-facing ingest endpoints for live stream submission.
The platform supports two project types.
- Web projects: optimized for Apache or Nginx style traffic and CRS-oriented detection.
- Windows projects: optimized for EVTX or XML telemetry and Sigma-oriented detection.
The top-level directories are organized as follows.
- api: FastAPI application, route modules, and service wiring.
- core: processing pipelines for ingestion, normalization, detection, enrichment, and export.
- frontend: Next.js application, dashboard views, and client-side state logic.
- agent: lightweight sender artifacts for ingestion workflows.
- data: runtime state, uploaded content, detection outputs, and rule catalogs.
All data is project scoped. Each project can contain multiple uploads. Upload processing produces intermediate and normalized artifacts, followed by analysis outputs.
Standard processing sequence.
- Receive logs from upload endpoints or agent ingest endpoints.
- Parse and normalize records by telemetry type.
- Execute detection and behavioral analytics.
- Persist generated results under the project data path.
- Serve outputs to the dashboard and API consumers.
- Python 3.11 or later.
- Node.js 20 or later.
- npm.
- Docker and Docker Compose for containerized deployment (optional).
Create a repository-level .env file with, at minimum, JWT_SECRET_KEY set.
Start the development stack.
./run_dev.shDefault development endpoints.
- Frontend: http://localhost:3000
- API: http://localhost:4000
- OpenAPI UI: http://localhost:4000/docs
The development launcher will create a local virtual environment when needed, install dependencies, and start API and frontend processes.
Set production-safe environment values in .env, including JWT_SECRET_KEY and ALLOWED_ORIGINS.
Start production processes.
./run_prod.shThe production launcher starts FastAPI with multiple workers and starts the Next.js frontend in production mode.
Start all containers.
docker compose up -d --buildDefault container ports.
- API: 4000
- Frontend: 3001
- CRS detector: 8080
The following paths contain operational history and should be treated as persistent runtime data.
- data/projects
- data/crs_audit
- data/crs_rules
- data/sigma_rules
- data/logic.db
Deleting data/projects or data/logic.db removes investigation history and analysis outputs.
- Authentication is token based.
- Access is owner scoped for standard users and elevated for administrators.
- JWT secret material must be managed securely and rotated in production environments.
- CORS origins should be explicitly restricted in production through ALLOWED_ORIGINS.
Primary API documentation is available in two forms.
- OpenAPI UI served by FastAPI at /docs.
- Static API reference in api/README.md.
After startup, confirm the following.
- API responds and OpenAPI page loads.
- Frontend authentication flow succeeds.
- Project list and project detail pages load expected data.
- Web analysis and Windows analysis endpoints return results for their respective project types.
If API startup fails.
- Validate .env values.
- Verify dependencies were installed for root and api requirements.
- Check for host port conflicts.
If frontend startup fails.
- Reinstall frontend dependencies.
- Rebuild and review lint or type errors.
If analysis output is missing.
- Verify project type and endpoint alignment.
- Verify upload status reached completion.
- Verify project-scoped filters are set correctly.