1 { config, lib, pkgs, ... }:
6 cfg = config.services.prometheus.alertmanagerWebhookLogger;
9 options.services.prometheus.alertmanagerWebhookLogger = {
10 enable = mkEnableOption "Alertmanager Webhook Logger";
12 package = mkPackageOption pkgs "alertmanager-webhook-logger" { };
14 extraFlags = mkOption {
15 type = types.listOf types.str;
17 description = "Extra command line options to pass to alertmanager-webhook-logger.";
21 config = mkIf cfg.enable {
22 systemd.services.alertmanager-webhook-logger = {
23 description = "Alertmanager Webhook Logger";
25 wantedBy = [ "multi-user.target" ];
26 after = [ "network-online.target" ];
27 wants = [ "network-online.target" ];
31 ${cfg.package}/bin/alertmanager-webhook-logger \
32 ${escapeShellArgs cfg.extraFlags}
35 CapabilityBoundingSet = [ "" ];
38 NoNewPrivileges = true;
40 MemoryDenyWriteExecute = true;
42 LockPersonality = true;
44 ProtectProc = "invisible";
45 ProtectSystem = "strict";
46 ProtectHome = "tmpfs";
49 PrivateDevices = true;
54 ProtectHostname = true;
56 ProtectKernelTunables = true;
57 ProtectKernelModules = true;
58 ProtectKernelLogs = true;
59 ProtectControlGroups = true;
61 Restart = "on-failure";
63 RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
64 RestrictNamespaces = true;
65 RestrictRealtime = true;
66 RestrictSUIDSGID = true;
80 meta.maintainers = [ maintainers.jpds ];