Skip to content
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

nixos/packetbeat: Add packetbeat module #97152

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lejonet
Copy link
Contributor

@lejonet lejonet commented Sep 4, 2020

Motivation for this change

Adds a packetbeat module so that it can be configured with
freeform settings. Made with big help from @aanderse and
@infinisil.

We have the packetbeat package in nixpkgs for some time, but no module, so I decided to make one. It uses the freeform module concept.

Remade PR after screwing up the prior PR with a botched rebase.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Adds a packetbeat module so that it can be configured with
freeform settings. Made with big help from @aanderse and
@infinisil.
@lejonet
Copy link
Contributor Author

lejonet commented Sep 4, 2020

@infinisil here's the config again:

packetbeat = {
    enable = true;
    package = pkgs.packetbeat7;
    settings = {
      name = config.networking.hostName;
      packetbeat = {
        interfaces = {
          device = "ens3";
          type = "af_packet";
          ignore_outgoing = true;
        };
        protocols = {
          tls = {
            ports = [ 443 993 995 5223 8443 8883 9243 ];
            send_certificates = true;
            include_raw_certificates = false;
            include_detailed_fields = true;
            fingerprints = [ "md5" "sha1" "sha256" ];
          };
        };
      };
      output = {
        elasticsearch = lib.mkForce {};
        file = {
          path = "/var/log/packetbeat";
          filename = "packetbeat.log";
          rotate_every_kb = "102400";
          number_of_files = "20";
        };
      };
      fields = {
        env = "utility";
      };
      processors = [ "add_host_metadata: ~" ];
    };
  };

@aanderse
Copy link
Member

@lejonet I think this looks good 👍 I'll defer to @infinisil for final approval and merge, though.

…pes.listOf format.type and change the default to a list with mkBefore
@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
@lelongg
Copy link
Contributor

lelongg commented Nov 25, 2022

Is this ready to be merged ?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 25, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants