git.iko.soy/typeable/nixpkgs
on master help sign in
osquery: remove

osquery was marked as broken since April. If somebody steps up to fix it, we can always revive it from the histroy, but there's not much value in shipping completely broken things in current master. cc @ma27

commit02f869ff30a3d0f3a431b49a3e0e0469cf7e50cd authorFlorian Klink <flokli@flokli.de> dateSun 24 Nov 2019, 22:33 (7 years ago) parente994b67
9 files changed+9−272
nixos/doc/manual/release-notes/rl-2003.xml+5 nixos/modules/module-list.nix−1 nixos/modules/rename.nix+3 nixos/modules/services/monitoring/osquery.nix−91 nixos/tests/all-tests.nix−1 nixos/tests/osquery.nix−28 pkgs/tools/system/osquery/default.nix−149 pkgs/top-level/aliases.nix+1 pkgs/top-level/all-packages.nix−2
nixos/doc/manual/release-notes/rl-2003.xml+5
@@ -181,6 +181,11 @@
181181 The BeeGFS module has been removed.
182182 </para>
183183 </listitem>
184+ <listitem>
185+ <para>
186+ The osquery module has been removed.
187+ </para>
188+ </listitem>
184189 </itemizedlist>
185190 </section>
186191
nixos/modules/module-list.nix−1
@@ -518,7 +518,6 @@
518518 ./services/monitoring/munin.nix
519519 ./services/monitoring/nagios.nix
520520 ./services/monitoring/netdata.nix
521− ./services/monitoring/osquery.nix
522521 ./services/monitoring/prometheus/default.nix
523522 ./services/monitoring/prometheus/alertmanager.nix
524523 ./services/monitoring/prometheus/exporters.nix
nixos/modules/rename.nix+3
@@ -285,6 +285,9 @@ with lib;
285285 (mkRemovedOptionModule [ "services.beegfsEnable" ] "The BeeGFS module has been removed")
286286 (mkRemovedOptionModule [ "services.beegfs" ] "The BeeGFS module has been removed")
287287
288+ # osquery
289+ (mkRemovedOptionModule [ "services.osquery" ] "The osquery module has been removed")
290+
288291 # Redis
289292 (mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.")
290293 (mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.")
nixos/modules/services/monitoring/osquery.nixdeleted−91
@@ -1,91 +0,0 @@
1−{ config, lib, pkgs, ... }:
2−
3−with builtins;
4−with lib;
5−
6−let
7− cfg = config.services.osquery;
8−
9−in
10−
11−{
12−
13− options = {
14−
15− services.osquery = {
16−
17− enable = mkEnableOption "osquery";
18−
19− loggerPath = mkOption {
20− type = types.path;
21− description = "Base directory used for logging.";
22− default = "/var/log/osquery";
23− };
24−
25− pidfile = mkOption {
26− type = types.path;
27− description = "Path used for pid file.";
28− default = "/var/osquery/osqueryd.pidfile";
29− };
30−
31− utc = mkOption {
32− type = types.bool;
33− description = "Attempt to convert all UNIX calendar times to UTC.";
34− default = true;
35− };
36−
37− databasePath = mkOption {
38− type = types.path;
39− description = "Path used for database file.";
40− default = "/var/osquery/osquery.db";
41− };
42−
43− extraConfig = mkOption {
44− type = types.attrs // {
45− merge = loc: foldl' (res: def: recursiveUpdate res def.value) {};
46− };
47− description = "Extra config to be recursively merged into the JSON config file.";
48− default = { };
49− };
50− };
51−
52− };
53−
54− config = mkIf cfg.enable {
55−
56− environment.systemPackages = [ pkgs.osquery ];
57−
58− environment.etc."osquery/osquery.conf".text = toJSON (
59− recursiveUpdate {
60− options = {
61− config_plugin = "filesystem";
62− logger_plugin = "filesystem";
63− logger_path = cfg.loggerPath;
64− database_path = cfg.databasePath;
65− utc = cfg.utc;
66− };
67− } cfg.extraConfig
68− );
69−
70− systemd.services.osqueryd = {
71− description = "The osquery Daemon";
72− after = [ "network.target" "syslog.service" ];
73− wantedBy = [ "multi-user.target" ];
74− path = [ pkgs.osquery ];
75− preStart = ''
76− mkdir -p ${escapeShellArg cfg.loggerPath}
77− mkdir -p "$(dirname ${escapeShellArg cfg.pidfile})"
78− mkdir -p "$(dirname ${escapeShellArg cfg.databasePath})"
79− '';
80− serviceConfig = {
81− TimeoutStartSec = "infinity";
82− ExecStart = "${pkgs.osquery}/bin/osqueryd --logger_path ${escapeShellArg cfg.loggerPath} --pidfile ${escapeShellArg cfg.pidfile} --database_path ${escapeShellArg cfg.databasePath}";
83− KillMode = "process";
84− KillSignal = "SIGTERM";
85− Restart = "on-failure";
86− };
87− };
88−
89− };
90−
91−}
nixos/tests/all-tests.nix−1
@@ -206,7 +206,6 @@ in
206206 openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {};
207207 orangefs = handleTest ./orangefs.nix {};
208208 os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {};
209− osquery = handleTest ./osquery.nix {};
210209 osrm-backend = handleTest ./osrm-backend.nix {};
211210 overlayfs = handleTest ./overlayfs.nix {};
212211 packagekit = handleTest ./packagekit.nix {};
nixos/tests/osquery.nixdeleted−28
@@ -1,28 +0,0 @@
1−import ./make-test.nix ({ pkgs, lib, ... }:
2−
3−with lib;
4−
5−{
6− name = "osquery";
7− meta = with pkgs.stdenv.lib.maintainers; {
8− maintainers = [ ma27 ];
9− };
10−
11− machine = {
12− services.osquery.enable = true;
13− services.osquery.loggerPath = "/var/log/osquery/logs";
14− services.osquery.pidfile = "/run/osqueryd.pid";
15− };
16−
17− testScript = ''
18− $machine->start;
19− $machine->waitForUnit("osqueryd.service");
20−
21− $machine->succeed("echo 'SELECT address FROM etc_hosts LIMIT 1;' | osqueryi | grep '127.0.0.1'");
22− $machine->succeed(
23− "echo 'SELECT value FROM osquery_flags WHERE name = \"logger_path\";' | osqueryi | grep /var/log/osquery/logs"
24− );
25−
26− $machine->succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"pidfile\";' | osqueryi | grep /run/osqueryd.pid");
27− '';
28−})
pkgs/tools/system/osquery/default.nixdeleted−149
@@ -1,149 +0,0 @@
1−{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, python
2−, udev, audit, aws-sdk-cpp, cryptsetup, lvm2, libgcrypt, libarchive
3−, libgpgerror, libuuid, iptables, dpkg, lzma, bzip2, rpm
4−, beecrypt, augeas, libxml2, sleuthkit, yara, lldpd, gflags
5−, thrift, boost, rocksdb_lite, glog, gbenchmark, snappy
6−, openssl, file, doxygen
7−, gtest, fpm, zstd, rdkafka, rapidjson, fetchgit, fetchurl, libelfin
8−, smartmontools, which, git, cscope, ctags, ssdeep
9−}:
10−
11−let
12− overrides = {
13− # use older `lvm2` source for osquery, the 2.03 sourcetree
14− # will break osquery due to the lacking header `lvm2app.h`.
15− #
16− # https://github.com/NixOS/nixpkgs/pull/51756#issuecomment-446035295
17− lvm2 = lvm2.overrideAttrs (old: rec {
18− name = "lvm2-${version}";
19− version = "2.02.183";
20− src = fetchgit {
21− url = "git://sourceware.org/git/lvm2.git";
22− rev = "v${version}";
23− sha256 = "1ny3srcsxd6kj59zq1cman5myj8kzw010wbyc6mrpk4kp823r5nx";
24− };
25− });
26−
27− # use smartmontools fork to programatically retrieve SMART information.
28− # https://github.com/facebook/osquery/pull/4133
29− smartmontools = smartmontools.overrideAttrs (old: rec {
30− name = "smartmontools-${version}";
31− version = "0.3.1";
32− src = fetchFromGitHub {
33− owner = "allanliu";
34− repo = "smartmontools";
35− rev = "v${version}";
36− sha256 = "1i72fk2ranrky02h7nh9l3va4kjzj0lx1gr477zkxd44wf3w0pjf";
37− };
38−
39− # Apple build fix doesn't apply here and isn't needed as we
40− # only support `osquery` on Linux.
41− patches = [];
42− });
43−
44− # dpkg 1.19.2 dropped api in `<dpkg/dpkg-db.h>` which breaks compilation.
45− dpkg = dpkg.overrideAttrs (old: rec {
46− name = "dpkg-${version}";
47− version = "1.19.0.5";
48− src = fetchurl {
49− url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz";
50− sha256 = "1dc5kp3fqy1k66fly6jfxkkg7w6d0jy8szddpfyc2xvzga94d041";
51− };
52− });
53−
54− # filter out static linking configuration to avoid that the library will
55− # be linked both statically and dynamically.
56− gflags = gflags.overrideAttrs (old: {
57− cmakeFlags = stdenv.lib.filter (f: (builtins.match ".*STATIC.*" f) == null) old.cmakeFlags;
58− });
59− };
60−in
61−
62−stdenv.mkDerivation rec {
63− pname = "osquery";
64− version = "3.3.2";
65−
66− # this is what `osquery --help` will show as the version.
67− OSQUERY_BUILD_VERSION = version;
68− OSQUERY_PLATFORM = "NixOS;";
69−
70− src = fetchFromGitHub {
71− owner = "facebook";
72− repo = pname;
73− rev = version;
74− sha256 = "0nrwmzmbziacs3y0nljyc73bibr3w68myjpfwkicg9zgkq4qihij";
75− };
76−
77− patches = [ ./0001-Fix-CMake-configuration-for-Nix.patch ];
78−
79− NIX_CFLAGS_COMPILE = [
80− "-I${libxml2.dev}/include/libxml2"
81− ];
82−
83− nativeBuildInputs = [ python which git cscope ctags cmake pkgconfig doxygen fpm ]
84− ++ (with python.pkgs; [ jinja2 ]);
85−
86− buildInputs = [
87− udev
88− audit
89− (aws-sdk-cpp.override {
90− apis = [ "firehose" "kinesis" "sts" "ec2" ];
91− customMemoryManagement = false;
92− })
93− overrides.lvm2
94− libgcrypt
95− libarchive
96− libgpgerror
97− libuuid
98− iptables
99− overrides.dpkg
100− lzma
101− bzip2
102− rpm
103− beecrypt
104− augeas
105− libxml2
106− sleuthkit
107− yara
108− lldpd
109− overrides.gflags
110− thrift
111− boost
112− glog
113− gbenchmark
114− snappy
115− openssl
116− file
117− cryptsetup
118− gtest
119− zstd
120− rdkafka
121− rapidjson
122− rocksdb_lite
123− libelfin
124− ssdeep
125− overrides.smartmontools
126− ];
127−
128− cmakeFlags = [ "-DSKIP_TESTS=1" ];
129−
130− preConfigure = ''
131− cp -r ${fetchFromGitHub {
132− owner = "osquery";
133− repo = "third-party";
134− rev = "32e01462fbea75d3b1904693f937dfd62eaced15";
135− sha256 = "0va24gmgk43a1lyjs63q9qrhvpv8gmqjzpjr5595vhr16idv8wyf";
136− }}/* third-party
137−
138− chmod +w -R third-party
139− '';
140−
141− meta = with lib; {
142− description = "SQL powered operating system instrumentation, monitoring, and analytics";
143− homepage = https://osquery.io/;
144− license = licenses.bsd3;
145− platforms = platforms.linux;
146− maintainers = with maintainers; [ cstrahan ma27 ];
147− broken = true;
148− };
149−}
pkgs/top-level/aliases.nix+1
@@ -261,6 +261,7 @@ mapAliases ({
261261 openjpeg_2_1 = openjpeg_2; # added 2018-10-25
262262 opensans-ttf = open-sans; # added 2018-12-04
263263 openssh_with_kerberos = openssh; # added 2018-01-28
264+ osquery = throw "osquery has been removed."; # added 2019-11-24
264265 owncloudclient = owncloud-client; # added 2016-08
265266 p11_kit = p11-kit; # added 2018-02-25
266267 parquet-cpp = arrow-cpp; # added 2018-09-08
pkgs/top-level/all-packages.nix−2
@@ -20461,8 +20461,6 @@ in
2046120461
2046220462 osmo = callPackage ../applications/office/osmo { };
2046320463
20464− osquery = callPackage ../tools/system/osquery { };
20465−
2046620464 palemoon = callPackage ../applications/networking/browsers/palemoon {
2046720465 # https://forum.palemoon.org/viewtopic.php?f=57&t=15296#p111146
2046820466 stdenv = gcc49Stdenv;