GithubHelp home page GithubHelp logo

shen771 / zeek2nix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hardenedlinux/zeek2nix

0.0 0.0 0.0 2.09 MB

An operator which calls zeek to nix-ecosystem simply.

License: MIT License

Shell 1.67% Nix 95.59% Zeek 2.74%

zeek2nix's Introduction

Zeek to Nix Flake’s feature

Building Zeek with nix-shell(shell mode)

nix develop
# or
nix-shell

Library

Building zeek with plugins

mkZeekPlugins = inputs.zeek2nix.lib.zeekWithPlugins {
  package = inputs.zeek2nix.packages.${system}.zeek-latest;
  plugins = [
    {
      src = inputs.zeek2nix.lib.nixpkgs.zeek-sources.zeek-community-id;
    }
  ];
  };

Testing your Zeek Plugin src with Nix-CI

mkZeekPluginCI = nixpkgs.zeekPluginCi {
    plugins = [
      {
        src = inputs.zeek2nix.lib.nixpkgs.zeek-sources.zeek-netmap;
      }
    ];
    buildInputs = [inputs.zeek2nix.lib.nixpkgs.netmap];
  };

Deploying Zeek with NixOS (flakes feature)

{
  inputs =
    {
      zeek-nix = {
        url = "github:hardenedlinux/zeek-nix/main";
        inputs.nixpkgs.follows = "nixos";
      };
      "..."
        };
        outputs = { self, zeek-nix, nixpkgs, ... }: {
        nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem {
          system = "...";

          modules = [
            zeek-nix.nixosModules.zeek
            ({ ... }: {
              services.zeek = {
                enable = true;
                standalone = true;
                interface = "eno1";
                listenAddress = "localhost";
                package = pkgs.zeekWithPlugins {
                  package = pkgs.zeek-latest;
                  plugins = [
                    {
                      src = pkgs.zeek-sources.zeek-community-id;
                    }
                  ];
                };

                privateScript = ''
                  @load /home/gtrun/project/hardenedlinux-zeek-script/scripts/zeek-query.zeek
                  @load /home/gtrun/project/hardenedlinux-zeek-script/scripts/log-passwords.zeek
                '';
              };
            })
          ];
        };
      };
    }

creating the zeek dynamic dir to /var/lib/zeek

[2020-10-09 Fri 19:35] <- sudo bash ./pre-run-zeekctl.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use zeek

zeek2nix's People

Contributors

gtrunsec avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.