
Daemon agent for osctrl
Repo jmpsec/osctrld, read from GitHub 19 h ago. jmpsec has not joined Take My Repo.
jmpsec/osctrld is a public repo on GitHub by jmpsec. Daemon agent for osctrl. It declares the MIT license on GitHub. It is written mainly in Go, has 0 stars and last changed on 2026-11-02. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-24.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Daemon for osctrl, the fast and efficient osquery management.
osctrld is the daemon component for osctrl. It keeps osquery clients aligned with their osctrl environment by managing flags, enrollment secrets, server certificates, extensions, and local osquery restarts.
It is designed to run close to osquery as a small operational companion: it can perform one-shot enrollment and verification tasks, or run continuously as a daemon that periodically syncs configuration from osctrl.
osctrld can:
β οΈ Warning
osctrld manages files and actions that affect osquery execution. Review configuration, file permissions, TLS settings, and extension sources before deploying it to production endpoints.
osquery is powerful, but keeping endpoint configuration current across many systems can become repetitive and error-prone. osctrld provides a narrow, auditable daemon that lets osctrl manage the local osquery client state without embedding that logic in deployment scripts.
The goal is to keep endpoint-side lifecycle work predictable: retrieve the desired state from osctrl, write it to the expected local paths, detect changes, and restart osquery only when needed.
Full documentation for the osctrl project is available at https://osctrl.net.
For this repository, the most useful starting points are:
.
βββ cmd/osctrld/ # osctrld CLI, daemon logic, and tests
βββ service/
β βββ darwin/ # macOS launchd service definition
β βββ linux/ # Linux systemd service definition
β βββ osctrld-sample.yaml # Sample YAML configuration
βββ tests/ # Test configuration fixtures
βββ .github/workflows/ # CI and release automation
βββ .goreleaser.yml # Multi-platform release configuration
βββ Makefile # Local build, test, and release helpers
βββ SECURITY.md # Security policy
osctrld is a Go CLI built around a small set of commands:
enroll and remove retrieve osctrl-provided lifecycle scripts and print them to stdout for the operator to review and run.flags and cert fetch managed osquery files and write them locally.verify checks whether local osquery configuration matches osctrl, and exits non-zero if any check fails.service runs the daemon loop and repeatedly syncs managed state.check-config validates a configuration file and exits.default-config prints a generated YAML configuration template.The daemon mode performs a sync cycle on a configurable interval. During each cycle, osctrld retrieves flags, certificates, and extension lists from osctrl, writes changed content to disk, and restarts osquery through the operating system service manager when a managed artifact changes.
Configuration comes from CLI flags, environment variables, or the osctrld section of a YAML or JSON file. YAML is the default format for new deployments. Precedence: when a configuration file is used (--config or OSCTRL_CONFIG), it replaces the entire effective configuration. Every other flag and environment variable is ignored, including for fields the file does not set, which take their defaults. osctrld logs one warning naming the ignored flags and environment variables (never their values). Without a configuration file, flags take precedence over environment variables. Runtime defaults are applied before commands run, and wrapped commands validate the effective configuration before doing work.
Download the latest release from the Releases page.
go build -o osctrld ./cmd/osctrld/
You can also use the Makefile:
make build
Example YAML configuration:
osctrld:
# osctrl enrollment secret value used to authenticate requests
osctrlSecret: "thisisthesecret"
# UUID of the osctrl environment, not its name
environment: "osctrl_environment_UUID"
# Base URL of the osctrl server, https and without a query or fragment
baseurl: "https://osctrl.url"
insecure: false
verbose: false
force: true
logFormat: "text"
# Sync interval in minutes for daemon mode; over 10080 (one week) logs a warning
interval: 60
# Paths default to the osquery directory of the OS (/etc/osquery/ on Linux,
# /private/var/osquery/ on macOS, C:\Program Files\osquery\ on Windows).
# Uncomment to override them, always with absolute paths
# osquery: "/etc/osquery/"
# osquerySecretFile: "/etc/osquery/osquery.secret"
# osqueryFlagFile: "/etc/osquery/osquery.flags"
# osqueryCertFile: "/etc/osquery/osctrl.crt"
# enrollScript: "/etc/osquery/osctrld-enroll.sh"
# removeScript: "/etc/osquery/osctrld-remove.sh"
# extensionsDir: "/etc/osquery/extensions/"
# Expected SHA-256 of the osquery package for the install command; osctrl's wins
osquerySHA256: ""
# Override the osquery package URL, for mirrors and air-gapped installs
osqueryPackage: ""
# Install osquery even when no SHA-256 is available to verify it
allowUnverified: false
JSON configuration files are also supported. Use a .json extension and osctrld will detect the format automatically.
check-config, service, enroll, remove, flags, cert, and verify all validate the effective configuration before running.
| Field | Description | Default |
|---|---|---|
osctrlSecret |
osctrl enrollment secret value used to authenticate requests | Required |
osquerySecretFile |
Local path where the osquery enrollment secret file is written or verified | OS-dependent |
osqueryFlagFile |
Path to the osquery flags file | OS-dependent |
osqueryCertFile |
Path to the osquery TLS certificate file | OS-dependent |
enrollScript |
Path to the enroll script | OS-dependent |
removeScript |
Path to the remove script | OS-dependent |
osquery |
Path to the osquery installation directory | OS-dependent |
environment |
UUID of the osctrl environment. osctrl rejects environment names on the osctrld endpoints | Required |
baseurl |
Base URL of the osctrl server | Required |
insecure |
Ignore TLS certificate warnings | false |
verbose |
Enable debug logging | false |
force |
Overwrite existing managed files | false |
logFormat |
Log format: text or json |
text |
interval |
Sync interval in minutes for daemon mode; above 10080 (one week) it logs a warning | 60 |
extensionsDir |
Directory for osquery extension binaries (configuration file only, no flag) | OS-dependent |
osquerySHA256 |
Expected SHA-256 of the osquery package for install; a digest from osctrl takes priority |
empty |
osqueryPackage |
Override the osquery package URL for install, for mirrors and air-gapped installs |
empty |
allowUnverified |
Let install proceed when no SHA-256 is available to verify the package |
false |
Leave the path options unset to use the OS defaults. Use absolute paths when you set them:
a relative path resolves against the working directory, which is / under systemd and
launchd, and logs a warning. baseurl must not contain a query or a fragment (the endpoint
paths are appended to it), and a trailing / is removed. Credentials in baseurl
(https://user:pass@host) are sent as Basic auth, for a reverse proxy, but are discouraged
and log a warning; logs never show them. Logs and errors show osqueryPackage without its credentials, query or fragment, so a mirror token stays out of them. Unknown keys (usually typos) are ignored with a warning that
names them; the legacy keys secret, secretFile, flags and cert are still accepted.
Use https for baseurl: requests carry the enrollment secret. An http:// baseurl or
osqueryPackage still works but logs a warning at startup (also shown by check-config).
Requests to osctrl follow redirects only within the same scheme, host and port (default
ports included), or from http to https on the same host name; package downloads may follow
https redirects to another host (a CDN). No redirect may go from https to http. HTTPS_PROXY, HTTP_PROXY and NO_PROXY are honoured.
NAME:
osctrld - Daemon for osctrl, the fast and efficient osquery management
COMMANDS:
enroll Enroll a new node in osctrl, using new secret and flag files
remove Remove enrolled node from osctrl, clearing secret and flag files
verify Verify flags, cert and secret for an enrolled node in osctrl
flags Retrieve flags for osquery from osctrl and write them locally
cert Retrieve server certificate for osquery from osctrl and write it locally
service Run as a daemon, periodically syncing flags and certificate
install Enroll this node natively: install osquery if needed, write secret, flags and certificate, and start the service
uninstall Remove this node from osctrl natively: stop the service and delete secret, flags and certificate. osquery itself is left installed
check-config Validate configuration and exit
default-config Print a default YAML configuration
Validate configuration before launching:
osctrld check-config --config /etc/osctrld/osctrld.yaml
Generate a fresh config template:
osctrld default-config
Retrieve flags and certificates:
osctrld flags --config /etc/osctrld/osctrld.yaml
osctrld cert --config /etc/osctrld/osctrld.yaml
Enroll a node:
osctrld enroll --config /etc/osctrld/osctrld.yaml
Verify a node:
osctrld verify --config /etc/osctrld/osctrld.yaml
Run in daemon mode:
osctrld service --config /etc/osctrld/osctrld.yaml
In daemon mode, osctrld will:
interval minutes with jitter
(set it in the configuration file: with --config, a --interval flag is ignored).SIGINT or SIGTERM.Flag requests carry the host UUID (read with osqueryd -S), so osctrl can serve a
per-node flagfile, plus the outcome of the last flags change. osquery exits on an
unknown flag or bad value, so after a restart caused by new flags osctrld waits up to
60 seconds for osqueryd to stay running (3 consecutive checks). If it does not,
osctrld rolls back along a chain, writing, restarting once and checking each step:
from the attempted flags to the environment flags, then to the last known good flags
(the last content osqueryd ran with), then it stops and leaves osqueryd down until
osctrl serves something new. Failed content is remembered by SHA-256 and not applied again
while osctrl serves it, and the attempted flags are reported as rejected. A check
interrupted by a stop, crash or reboot is finished on the next sync, after restarting
osqueryd so it runs the flags being checked. This state, with
the last known host UUID (used when the lookup fails), is kept next to the flagfile in
<osqueryFlagFile>.osctrld-state.json; the last known good flags are in
<osqueryFlagFile>.osctrld-lastgood (root-owned, 0600, written atomically).
Between syncs osctrld checks for the osqueryd process every 60 seconds. It is down
after 2 consecutive misses and up again only after 3 consecutive hits, so a service
manager respawning a crashing osqueryd
jmpsec/osctrld is a public repo on GitHub by jmpsec. Daemon agent for osctrl.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-02. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Take My Repo cannot say: it does not audit code and has not run osctrld. What is known comes from GitHub. It declares the MIT license on GitHub. Its last change was on 2026-11-02. It has 0 stars, which measure popularity, not safety. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read the source before you run it. With "Take it", your AI agent shows each step and asks you before running it; README text is treated as data, not as instructions.