-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Osquerybeat: Improve osquery client connect code. Update config_refresh to 60 seconds. #28848
Osquerybeat: Improve osquery client connect code. Update config_refresh to 60 seconds. #28848
Conversation
This pull request does not have a backport label. Could you fix it @aleksmaus? 🙏
NOTE: |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
(cherry picked from commit d2e3b99)
(cherry picked from commit d2e3b99) Co-authored-by: Aleksandr Maus <[email protected]>
…in-the-package-binareis * upstream/master: allows disable pod events enrichment with deployment name (elastic#28521) Remove Docker input from Filebeat (elastic#28817) [breaking] Make default_field: false the default for all fields (elastic#28596) Osquerybeat: Improve osquery client connect code (elastic#28848) Add crawler metrics into the stats metricset for Enterprise Search (elastic#28790) Remove the now deprecated appsearch module from metricbeat (elastic#28850) Remove Beat generators (elastic#28816) chore: upload files to Google Storage when they exist (elastic#28836) Revert "chore(ci): disable E2E tests in Beats (elastic#28715)" (elastic#28812) Deprecate generating custom Beats (elastic#28814) [Metricbeat] upgrade flatbuffers to 1.12.1 (elastic#28094) Osquerybeat: Fix restart flags after previously bad config (elastic#28827) Force ECS and JSON logging for libbeat/logp (elastic#28573) Filebeat: Error on startup for unconfigured module (elastic#28818) Deprecate log input in favour of filestream (elastic#28623) Fix some spelling mistakes (elastic#28080)
(cherry picked from commit d2e3b99)
(cherry picked from commit d2e3b99) Co-authored-by: Aleksandr Maus <[email protected]>
…in-the-package-binareis * upstream/master: allows disable pod events enrichment with deployment name (elastic#28521) Remove Docker input from Filebeat (elastic#28817) [breaking] Make default_field: false the default for all fields (elastic#28596) Osquerybeat: Improve osquery client connect code (elastic#28848) Add crawler metrics into the stats metricset for Enterprise Search (elastic#28790) Remove the now deprecated appsearch module from metricbeat (elastic#28850) Remove Beat generators (elastic#28816) chore: upload files to Google Storage when they exist (elastic#28836) Revert "chore(ci): disable E2E tests in Beats (elastic#28715)" (elastic#28812) Deprecate generating custom Beats (elastic#28814) [Metricbeat] upgrade flatbuffers to 1.12.1 (elastic#28094) Osquerybeat: Fix restart flags after previously bad config (elastic#28827) Force ECS and JSON logging for libbeat/logp (elastic#28573) Filebeat: Error on startup for unconfigured module (elastic#28818) Deprecate log input in favour of filestream (elastic#28623) Fix some spelling mistakes (elastic#28080)
What does this PR do?
Fixes code logic in osquery connect with retries.
The error not correctly propagated from this line:
https://github.com/elastic/beats/blame/20d637e1afc7104e7a1f24532cd491e59ad6b245/x-pack/osquerybeat/internal/osqdcli/client.go#L138
when the context was cancelled while waiting next retry.
This doesn't cause an issue, but is not the correct behavior and could be potentially be misleading when logging
when the connection attempt was cancelled via context.
This PR also updates the config refresh interval from 10 seconds to 60 seconds.
This is the interval how often
osqueryd
polls our configuration plugin (implemented in osquerybeat) over local RPC (osquery domain socket or pipe). The reasoning for that is explained in the added comment:This follows the similar change in the kolide/launcher:
kolide/launcher@5d31869#diff-4fb691d7c9dc698ab635973bdc357a76d02d94583bc6e0c3e8f5483b2f55996aR150
Summary of changes:
retry
logic for osquery reconnect, made it better testableconfig_refresh
from 10 to 60 secondsWhy is it important?
Improves osquery client connect code quality, and unit test coverage, fixes a minor defect there.
Updates for less frequent RPC calls to configuration plugin.
Checklist
Screenshots
Debug log changes