Repository navigation
Align osctrld with the current osctrl server - #24
Merged
Merged
Conversation
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.
Align osctrld with the current osctrl server
Checked osctrld end to end against osctrl's own request handlers and fixed where they disagree. Flags, cert,
enrollandverifyalready worked; these four didn't.HTTP 400, but osctrld's docs, sample config anddefault-configsaid a name works.validateConfigurationnow rejects a name with a clear message (exit code 2) before any request is made. The docs, sample config and test fixtures now use a UUID.osctrld-extensions, so the request always got a 404. That 404 is now read as "no extensions" and skipped quietly. A wrong URL or environment still fails loudly on the flags and cert requests earlier in the same cycle, and extension sync starts working by itself once osctrl adds the endpoint. To support this,genericRetrievereturns a typed HTTP status error; its message text is unchanged.osquery_sha256is one value for the whole server and overrides the node's--osquery-sha256, but each OS and architecture has its own package, so without the source the error was hard to act on.installnow trims the flags and certificate before writing them, so it writes the same files as theflagsandcertcommands.Operational impact: a config that names its environment, such as
environment: "dev", now fails validation instead of getting a 400 from the server. Use the environment's UUID.Validation
go test ./cmd/osctrld/ -race: all 105 tests ran and passed, coverage up from 69.8% to 74.5%golangci-lint run ./..., native andGOOS=windows: 0 issuesenrollandverifysucceed, and an environment name is rejected before any request is made.