Repository navigation
osquery extensions delivery - #1096
Merged
Merged
Conversation
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
osquery extensions delivery
Companion to the osctrld change that installs extensions safely (verified, root-owned, with process checks, rollback and per-extension status). Builds on per-node flags overrides (#1093).
Problem
osquery extensions add tables osquery doesn't ship, such as the trailofbits/osquery-extensions collection, and command execution, the typical investigation tool. osctrl had no way to distribute them. osctrld already called
POST /{env}/osctrld-extensions, but osctrl didn't serve it.What changes
Library:
pkg/extensions^[A-Za-z0-9_-]{1,64}$, unique ignoring case), description, version, and a command execution marker.universal; extensions without a file for the platform are skipped.ok,rejected,kept(a removal failed) andremoved.keptand the host has no unexpired assignment for it.keptrecord.kept.osctrl-tls (under
osctrld.enabled, authenticated with the environment secret)POST /{env}/osctrld-extensionswith{secret, uuid?, platform, arch, status?}returns[{name, sha256, size, url}].[].POST /{env}/osctrld-extensionwith{secret, sha256}.Content-Length.registerRoutes(), with a test that registers every route together. The originally planned/{env}/osctrld-extension/{sha256}panicked at startup against/{env}/{secret}/osquery-config.osctrl-api
GET|POST /api/v1/extensionsPATCH|DELETE /api/v1/extensions/{id}PUT|DELETE /api/v1/extensions/{id}/files/{platform}/{arch}file, streamed withMultipartReader.GET|PUT|DELETE /api/v1/environments/extensions/{env}[/{id}].GET /api/v1/nodes/{env}/node/{uuid}/extensions, for environment admins: the effective set, assignments, statuses and lingering rows. The command-execution library is included for super admins.PUT|DELETE /api/v1/nodes/{env}/node/{uuid}/extensions/{id}, super admins only.{"expires_at": <future RFC3339> | null}. A missing or misspelled key is refused rather than silently granting "never expires".SPA
Deployment and docs
/api/client_max_body_sizeraised from 64m to 65m indeploy/nginx/frontend.conf,deploy/docker/conf/nginx/frontend-dev.conf,deploy/cicd/nginx/frontend.confanddeploy/cicd/nginx/frontend-tls.conf.Security and operational impact
extensions,extension_files,extension_chunks,env_extensions,node_extensions,node_extension_statuses) with explicitidx_ext_*index names. No changes to existing tables.provision.sh: the direct API vhost inherits nginx's global 20 MB body limit (documented). Uploads over 20 MB through it fail untilclient_max_body_sizeis raised there.rejected, which isn't flagged as lingering.keptrecord that never reports again blocks deleting that extension until the node is deleted.Validation
go test ./... -count=1: 57 packages passgo vet ./...;gofmt -l pkg cmd(empty);golangci-lint run ./...: 0 issuesmake openapi-check: cleancd frontend && npm test: 560 tests pass;npm run check: cleanpkg/extensions:InEnvSet;cmd/tls:cmd/apiandcmd/cli:expires_atsent, plain-text host errors;