osctrl

module
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT

README ΒΆ

osctrl

osctrl

Fast and efficient osquery management.

Software License Build Status Go Report Card

πŸ€” What is osctrl?

osctrl is a fast and efficient osquery management solution, implementing its remote API as TLS endpoint.

With osctrl you can:

  • ✨ Monitor all your systems running osquery
  • πŸ“¦ Distribute its configuration fast
  • πŸ“Š Collect all the status and result logs
  • ⚑ Run on-demand queries
  • πŸ—‚οΈ Carve files and directories
  • βš™οΈ Scale from hundreds to hundreds of thousands of nodes

[!IMPORTANT] The legacy server-rendered osctrl-admin HTML interface will be deprecated soon. The new frontend is the primary operator experience going forward and will receive future UI improvements and features.

[!WARNING] osctrl is a fast evolving project, and while it is already being used in production environments, it is still under active development. Please make sure to read the documentation and understand its current state before deploying it in a critical environment.

πŸš€ Why osctrl?

Whether you’re running a small deployment or managing large fleets, osctrl gives you visibility and control over your osquery endpoints without compromising security or performance.

πŸ‘‰ Documentation

You can find the documentation of the project in https://osctrl.net

πŸ—‚ Project Structure

osctrl/
β”œβ”€β”€ cmd/                         # Service and CLI entrypoints
β”‚   β”œβ”€β”€ admin/                   # osctrl-admin (legacy HTML UI + admin handlers/templates/static)
β”‚   β”œβ”€β”€ api/                     # osctrl-api (REST API service)
β”‚   β”œβ”€β”€ cli/                     # osctrl-cli (operator CLI)
β”‚   └── tls/                     # osctrl-tls (osquery remote API endpoint)
β”œβ”€β”€ frontend/                    # React SPA frontend for the operator UI
β”œβ”€β”€ pkg/                         # Shared application packages
β”‚   β”œβ”€β”€ auditlog/                # Audit log manager
β”‚   β”œβ”€β”€ backend/                 # DB manager/bootstrap
β”‚   β”œβ”€β”€ cache/                   # Redis/cache managers
β”‚   β”œβ”€β”€ carves/                  # File carve logic/storage integrations
β”‚   β”œβ”€β”€ config/                  # Config structs/flags/validation
β”‚   β”œβ”€β”€ environments/            # Environment management
β”‚   β”œβ”€β”€ handlers/                # Shared HTTP handlers
β”‚   β”œβ”€β”€ logging/                 # Log pipeline + logger backends
β”‚   β”œβ”€β”€ nodes/                   # Node state/registration/cache
β”‚   β”œβ”€β”€ queries/                 # Query management/scheduling/results
β”‚   β”œβ”€β”€ settings/                # Runtime settings
β”‚   β”œβ”€β”€ tags/                    # Tag management
β”‚   β”œβ”€β”€ users/                   # User and permissions management
β”‚   β”œβ”€β”€ utils/                   # Utility helpers
β”‚   β”œβ”€β”€ types/                   # Shared type definitions
β”‚   └── version/                 # Version metadata
β”œβ”€β”€ deploy/                      # Deployment configs/scripts (docker/nginx/osquery/systemd, CI/CD, redis, config, helpers, etc.)
β”œβ”€β”€ tools/                       # Dev/release helpers and API test assets (Bruno collections, scripts)
β”œβ”€β”€ bin/                         # Built binaries (from make)
β”œβ”€β”€ docker-compose-dev.yml       # Local multi-service development stack
β”œβ”€β”€ Makefile                     # Build/test/dev targets
└── osctrl-api.yaml              # OpenAPI specification for osctrl-api

πŸ› Architecture

flowchart LR
    subgraph Clients["Clients"]
        Agents["osquery agents"]
        Ops["Operators"]
        Tools["Automation / CLI"]
    end

    subgraph Interfaces["Interfaces"]
        Tls["osctrl-tls"]
        Frontend["osctrl frontend"]
        Admin["osctrl-admin (legacy HTML UI)"]
        API["osctrl-api"]
        CLI["osctrl-cli"]
    end

    subgraph Core["Shared backend"]
        Shared["Shared packages (pkg/*)"]
    end

    subgraph Data["State and integrations"]
        DB["PostgreSQL backend"]
        Redis["Redis cache"]
        Logs["Log destinations"]
        Carves["Carve storage"]
    end

    Agents -->|TLS remote API| Tls
    Ops -->|Browser UI| Frontend
    Ops -.->|Legacy browser UI| Admin
    Tools -->|REST API| API
    Tools -->|CLI| CLI

    Frontend -->|HTTP API| API
    Admin -->|HTTP API| API
    CLI -->|HTTP API| API

    Tls --> Shared
    API --> Shared
    Admin --> Shared
    CLI --> Shared

    Shared --> DB
    Shared --> Redis
    Shared --> Logs
    Shared --> Carves
    CLI -.->|Direct DB mode| DB

πŸ›  Development

The fastest way to get started with osctrl development is by using Docker and Docker Compose. But you can find other methods below.

🐳 Running osctrl with docker for development

You can use docker to run osctrl and all the components are defined in the docker-compose-dev.yml that ties all the components together, to serve a functional deployment.

The docker development stack exposes:

  • https://localhost:8444 for the frontend
  • https://localhost:8443 for the legacy osctrl-admin HTML interface

For frontend-only development details, see frontend/README.md.

Ultimately you can just execute make docker_dev and it will automagically build and run osctrl locally in docker, for development purposes.

πŸ€– Using provisioning script

Using the provided deploy/provision.sh script, you can set up a development environment on your local machine. This script will install all necessary dependencies and configure the environment for osctrl development in a latest Ubuntu LTS system.

Check the documentation for more details on how to use the provisioning script.

Ultimately the script can also be used to deploy osctrl in production systems, please refer to the documentation for more details.

πŸ— Building from source

To build osctrl from source, ensure you have Go installed (version 1.25 or higher is recommended). Then, clone the repository and run the following commands:

git clone https://github.com/jmpsec/osctrl.git
cd osctrl
make

This will compile all the osctrl components (osctrl-tls, osctrl-admin, osctrl-api, osctrl-cli), placing the binaries in the bin/ directory.

If you are working on the new operator UI, the frontend SPA lives in frontend/ and is built separately from the Go binaries.

πŸ’¬ Slack

Find us in the #osctrl channel in the official osquery Slack community (Request an auto-invite!)

πŸ“œ License

osctrl is licensed under the MIT License.

🧠 Security & Reporting

This is a security-sensitive project. Please read the SECURITY.md for vulnerability reporting and responsible disclosure guidelines.

🀝 Contributing

We ❀️ contributions!

Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.

Directories ΒΆ

Path Synopsis
admin
auth module
handlers module
sessions module
api
handlers module
backend module
cache module
carves module
cmd
admin command
api command
cli command
tls command
environments module
logging module
metrics module
nodes module
pkg
auth
Package auth defines the provider-agnostic federated-identity surface for osctrl-api.
Package auth defines the provider-agnostic federated-identity surface for osctrl-api.
auth/oidc
Package oidc is the OpenID Connect (RFC 6749 + OIDC Core 1.0) implementation of the auth.Provider interface defined in pkg/auth.
Package oidc is the OpenID Connect (RFC 6749 + OIDC Core 1.0) implementation of the auth.Provider interface defined in pkg/auth.
auth/saml
Package saml is the SAML 2.0 Web Browser SSO Profile implementation of the auth.Provider interface defined in pkg/auth.
Package saml is the SAML 2.0 Web Browser SSO Profile implementation of the auth.Provider interface defined in pkg/auth.
osquery
Package osquery provides shared helpers for working with the osquery schema.
Package osquery provides shared helpers for working with the osquery schema.
ratelimit
Package ratelimit provides a small token-bucket rate-limit middleware used to protect anonymous attack surfaces (login, enroll) from brute-force / password-spray.
Package ratelimit provides a small token-bucket rate-limit middleware used to protect anonymous attack surfaces (login, enroll) from brute-force / password-spray.
queries module
settings module
tags module
tls
handlers module
tools
fake_news_go command
types module
users module
utils module
version module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL