Configuration endpoints to receive osquery configuration from gitOps#799
Merged
Configuration endpoints to receive osquery configuration from gitOps#799
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GitOps-oriented configuration ingestion to osctrl-tls by introducing dedicated configuration update endpoints and a “read-only configuration” mode that prevents edits through osctrl-admin.
Changes:
- Introduces a new TLS POST endpoint (
/{env}/{secret}/osquery-config) to push osquery configuration updates (optionally with integrity checking). - Extends TLS YAML/flag configuration to define config endpoints and adds an
osquery.readOnlyflag to disable configuration edits via admin. - Updates the admin configuration UI/POST handler to enforce read-only mode.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/types/types.go | Adds request type for config endpoint payloads. |
| pkg/environments/environments.go | Adds default path constant for the new config endpoint. |
| pkg/config/utils.go | Includes config endpoints in generated TLS example config output. |
| pkg/config/types.go | Adds configEndpoints config and osquery.readOnly flag in config types. |
| pkg/config/flags.go | Adds CLI/env flag to enable read-only configuration mode. |
| cmd/tls/utils.go | Wires loaded YAML configEndpoints into runtime params. |
| cmd/tls/main.go | Registers the new TLS config endpoint when configured; wires handler options. |
| cmd/tls/handlers/post.go | Implements the new config ingestion endpoint (base64+gzip + optional integrity). |
| cmd/tls/handlers/handlers.go | Adds handler option/storage for configured endpoints. |
| cmd/admin/templates/conf.html | Makes config editors read-only in the UI and disables actions when configured. |
| cmd/admin/handlers/post.go | Blocks configuration updates when read-only mode is enabled. |
| .pre-commit-config.yaml | Updates golangci-lint pre-commit hook revision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Implementation of #746 and adding configuration endpoints to
osctrl-tlsto receive osquery configuration per environment, so it can be integrated in a gitOps flow. It disables the ability to edit configurations viaosctrl-admin.