Technology

Architecture & technology stack

osctrl is a set of small, focused Go services sharing a common core, backed by PostgreSQL and Redis, with a modern React operator frontend and an MCP server for AI agents.

Architecture

How the pieces fit together

osquery agents talk to the TLS endpoint. Operators, automation and MCP clients talk to the API. Everything shares one backend.

CLIENTS OSCTRL SERVICES STATE & INTEGRATIONS osquery agents Linux · macOS · Windows Operators Browser UI Automation Scripts · CI · SOAR MCP clients AI agents osctrl-tls osquery remote API Frontend (React SPA) Operator UI osctrl-api REST + hosted MCP osctrl-cli Operator CLI osctrl-mcp stdio MCP server Shared core Go packages (pkg/*) PostgreSQL Redis cache Log destinations Carve storage Alert channels TLS remote API REST API stdio HTTP MCP

osctrl-mcp and the CLI are just authenticated REST clients — the API's permission checks bound every one of them.

Components

The services in detail

osctrl-tls

Implements the osquery remote API as a TLS endpoint. This is what your fleet talks to:

  • Node enrollment and configuration retrieval
  • Status and result log ingestion
  • Distributed query read/write, with optional accelerated reads
  • File carving uploads

osctrl-api

REST API service powering the frontend, automation and MCP:

  • JWT authentication by default, optional MFA (TOTP, passkeys, recovery codes)
  • Trusted proxy controls and audit logging of operator actions
  • Authenticated osquery table metadata and sample query/carve libraries
  • Optional SSE live updates and an optional hosted MCP endpoint
  • Documented with an OpenAPI specification

Operator frontend

React single-page application served alongside the API:

  • Nodes, environments, queries, saved queries, carves, tags, users, enrollment
  • Audit log, service configuration, log sinks, auth providers and alerting
  • Node activity, optional posture data and an optional deployment health page
  • Read-only node console and accelerated per-node file explorer
  • osquery schema-aware query authoring, with live updates over SSE

osctrl-cli

Command-line interface for operators and automation:

  • Manage environments, nodes, queries, users and settings
  • Works against the REST API, or in direct DB mode
  • Ideal for provisioning, scripting and CI/CD pipelines

osctrl-mcp New

A Model Context Protocol server, in two shapes serving the same tools:

  • osctrl-mcp: a stdio binary launched by the client, for one operator on a workstation
  • Hosted at /api/v1/mcp inside osctrl-api, so a shared deployment serves every user as themselves
  • Read tools cover environments, fleet stats, nodes, the osquery schema and query results
  • Write tools are registered only when explicitly enabled — off by default

Shared core (pkg/*)

All services build on the same Go packages: node state, environments, queries, carves, users and permissions, tags, caching, logging pipeline, alerting, audit log, MFA, GeoIP and posture ingestion, health, rate limiting and more.

Stack

Technology choices

Boring, proven infrastructure — chosen for performance and operational simplicity.

LayerTechnologyNotes
Backend services Go (1.27.1) Single static binaries per component; fast, concurrent log and query handling. GORM, go-redis, zerolog, Viper and Prometheus underneath.
Operator frontend React 19 · TypeScript · Vite 8 · Tailwind CSS 4 Modern SPA served with the API, using TanStack Router/Query/Table and Monaco Editor; Node.js 22+ for development.
Database PostgreSQL Primary datastore for nodes, environments, queries, users and results.
Cache Redis Caching and fast node state for high-throughput fleets.
Endpoint agent osquery Schema metadata shipped through osquery 5.23.1 for query authoring and console .tables.
Deployment Docker · systemd · nginx Docker Compose stack for development; provisioning script and configs for production.
API contract OpenAPI osctrl-api.yaml ships in the repository.
AI integration Model Context Protocol Standalone osctrl-mcp over stdio, or hosted over HTTP at /api/v1/mcp.
Identity JWT · OIDC · SAML · WebAuthn · TOTP Federated providers configurable per deployment; passkeys, security keys and recovery codes for password logins.
Security

Security-sensitive by design

🔑

Authenticated everything

JWT authentication is the default for the API, with optional MFA — TOTP, passkeys and security keys, recovery codes. Table metadata and sample libraries require authentication too.

🧾

Audit logging

Operator actions are audit-logged — hosted MCP writes a row for every tool call, reads included — and trusted proxy controls keep client attribution honest behind load balancers.

🛡️

Least-privilege console

The node console is read-only, permission-checked, and scoped to the target node with fresh, active sessions only.

🤖

Agents stay inside the fence

MCP carries no authorization logic of its own. Hosted tool calls dispatch back through the API's handlers as the calling user, and the standalone binary is bounded by its token's environment permissions.

🚧

Writes are opt-in

MCP write tools are not registered unless explicitly enabled. Scheduled queries always require a target, always expire, are never hidden, and carve queries are refused outright.

📡

Fleet data is untrusted

Hostnames, process names and result rows come from the monitored endpoints themselves. osctrl treats that content as data, never as instructions — the reason writes ship off by default.

Found a vulnerability? Please follow the responsible disclosure guidelines.

Ready to see it running?

One command with Docker Compose, or deploy natively with the provisioning script.