Last active
July 21, 2023 14:12
-
-
Save ravloony/2f5682fad481168dfb5778e911f47bee to your computer and use it in GitHub Desktop.
Falcon package
This file contains 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
{ stdenv, dpkg, fetchurl, openssl, libnl, buildFHSUserEnv,... }: | |
stdenv.mkDerivation { | |
name = "falcon-sensor"; | |
version = "4.18.0-6402"; | |
arch = "amd64"; | |
src = fetchurl { | |
url = "https://storage.googleapis.com/company-tools/falcon-sensor/falcon-sensor_4.18.0-6402_amd64.deb"; | |
sha512 = "dc41cfe0232124480abdcf456df9a3bd6cab62716bc5beea089fbf99ac2e29bf1e1a44676591a71eeb35afe7f25e495b53ede007cfc15dcbf47df7ec0a016098"; | |
}; | |
buildInputs = [ dpkg ]; | |
sourceRoot = "."; | |
unpackCmd = '' | |
dpkg-deb -x "$src" . | |
''; | |
installPhase = '' | |
cp -r ./ $out/ | |
realpath $out | |
''; | |
meta = with stdenv.lib; { | |
description = "Crowdstrike Falcon Sensor"; | |
homepage = "https://www.crowdstrike.com/"; | |
license = licenses.unfree; | |
platforms = platforms.linux; | |
maintainers = with maintainers; [ ravloony ]; | |
}; | |
} |
This file contains 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
{ pkgs, ... }: | |
let | |
falcon = pkgs.callPackage ./falcon { }; | |
falcon-env = pkgs.buildFHSUserEnv { | |
name = "falcon-sensor"; | |
targetPkgs = pkgs: [ pkgs.libnl pkgs.openssl ]; | |
runScript = "bash"; | |
}; | |
script = pkgs.writeScript "init-falcon" '' | |
#! ${pkgs.bash}/bin/sh | |
${falcon-env}/bin/falcon-sensor ${falcon}/opt/CrowdStrike/falconctl -g --cid | |
''; | |
in | |
{ | |
systemd.services.falcon-sensor = { | |
enable = true; | |
description = "CrowdStrike Falcon Sensor"; | |
after = [ "local-fs.target" ]; | |
conflicts = [ "shutdown.target" ]; | |
before = [ "shutdown.target" ]; | |
serviceConfig = { | |
ExecStartPre = "${script}"; | |
ExecStart = "${falcon-env}/bin/falcon-sensor ${falcon}/opt/CrowdStrike/falcond"; | |
Type = "forking"; | |
PIDFile = "/var/run/falcond.pid"; | |
Restart = "no"; | |
}; | |
wantedBy = [ "multi-user.target" ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@thall Thanks for sharing! Though for me it still does not start, not sure why:
References:
But, yeah, probably since they don't support NixOS, not sure if that is worth it.