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.
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
auto load ATC config in interactive #1685
auto load ATC config in interactive #1685
Changes from 12 commits
afe51ab
f87fe9f
cbf8db7
bcec485
487a772
4824669
6c966d0
ccb9c83
3d5aa29
cdfb553
9596d36
4378ee7
f7cece7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth figuring out the plumbing to have this fire when we get a new osquery config? This would likely mean that launcher interactive will not pick up the ATCs until the first launcher start up after getting osq config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand... Is this only called on startup? Which means the sqlite conf file may lag weeks to months?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's possible. I'm trying to find a clever way to plumb this through .... we could treat config like a flag in knapsack and use it's observer pattern or just find a way to have the extension call startupsettings.OpenWriter when the config updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, that's an interesting thought. If we ever decide we need to restart osquery on a config change, would it leverage that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt we would ever leverage that when launcher (daemon) is restarting osquery, since launcher (daemon) can just read the config out of bolt db.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right -- that extension would read it from boltdb. But we still need something like that to trigger the restart, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this to have the extension just open the startup settings writer to trigger the write when it gets a new config. I see what you mean about restarting on a new config, as discussed, maybe an issue, but out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree it's out of scope for this PR. Mostly mentioning it in case it chanses the direction you want to go in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe it would feel cleaner/less easy to introduce bugs in the future if we had a specific function to call to perform the config write, rather than relying on a side effect of
OpenWriter
...maybesetFlags
could be exposed asSyncFlags
or something? What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about renaming to
WriteSettings
and removing from the constructor?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works for me 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done