-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
osquery: init at 2.5.2 #27347
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
osquery: init at 2.5.2 #27347
Conversation
This currently builds the SDK as a static library, while it would be nice to instead provide a shared library. Unfortunately, when I add: ${if (!enableStatic) then "OSQUERY_BUILD_SHARED" else null} = true;
${if (!enableStatic) then "BUILD_LINK_SHARED" else null} = true; I get the following compile error:
|
wantedBy = [ "multi-user.target" ]; | ||
path = [ pkgs.osquery ]; | ||
preStart = '' | ||
mkdir -p ${escapeShellArg cfg.loggerPath} |
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.
escapeShellArg
will not add quotes around the argument. You have to add them manually.
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's not what it looks like:
nix-repl> lib.escapeShellArg "this is a test"
"'this is a test'"
Note, specifically, the inner single quotes ('
).
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.
You are right.
GENTOO_RELEASE = "/etc/gentoo-release" | ||
|
||
def _platform(): | ||
+ return ("nixos", "nixos") |
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.
To bad that they have no support for /etc/os-release
. The only disadvantage of this patch is, that it won't work on non-nixos. Also I don't how many people would use osqueryd that way.
else() | ||
set(LINUX TRUE) | ||
- set(CXX_COMPILE_FLAGS "${CXX_COMPILE_FLAGS} -std=c++14 -stdlib=libstdc++") | ||
+ set(CXX_COMPILE_FLAGS "${CXX_COMPILE_FLAGS} -std=c++14") |
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.
What was the problem with libstdc++
in nixos? It might also helpful to add a comment so future maintainer have an easier job.
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.
@Mic92 I get: g++: error: unrecognized command line option '-stdlib=libstdc++'
The osquery
devs build their stuff with clang
, where that flag makes sense.
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.
Do think we could run into subtle runtime bugs due not using clang++ on nixos?
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.
No; we're not mixing different standard libs, so everything should be fine.
I've further split-up the commits (factoring out |
I think this is fairly uncontroversial; merging. |
Motivation for this change
I'd like to use osquery: https://osquery.io/
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)The
osqueryd
daemon can be configured in NixOS like so:As time goes by, we can try to expand the support for legitimate configuration options, but that's out of scope for this PR; for now,
extraConfig
provides an escape hatch (we'll want this anyway, since the config file schema is large, and we'll undoubtedly provide only subset as direct NixOS options at any given moment; we should allow people to easily express the config settings in the interim). The settings inextraConfig
are merged recursively, so separate NixOS config files can specify separate schedules, packs, etc.