National Cyber Warfare Foundation (NCWF)login

nix-security-box for curated security tooling on NixOS


0 user ratings
2026-11-02 15:26:09
milo
Red Team (CNA)
"nix-security-box

nix-security-box packages a curated set of penetration testing and security assessment tools for NixOS, favoring maintained, actively developed utilities over Kali-style kitchen-sink collections.








Toolfabaff/nix-security-box — Nix package set of security and pentesting tools for NixOS
CategorySecurity tool packaging / Nix expressions
Primary UseAssembling reproducible, per-task security toolboxes via configuration.nix imports or ad-hoc nix-shell environments
Safe UseIntended for authorized penetration tests, security assessments, lab environments, and defensive research on systems you administer
Telemetry NoteThe package set itself is inert metadata; the individual tools it installs (e.g., nmap, masscan) produce their own observable network traffic and logs

fabaff/nix-security-box is a collection of Nix expressions that brings a broad set of information security tooling to NixOS users, maintained by Fabian Affolter and licensed under MIT. With 408 stars and a primary language of Nix, the project sits in an interesting niche: it is not a tool itself but a distribution mechanism, a curated overlay of package definitions that lets an operator declaratively assemble the exact arsenal a given engagement requires. The README frames it as a package set for penetration tests, security assessments, and other security-related tasks, and the repo's topic tags (red-team, blue-team, pentest, offensive-security) signal that it deliberately spans both sides of the house rather than catering exclusively to offensive work.


The philosophy section is the most revealing part of the README. The author explicitly rejects the strategy of mimicking Kali Linux, which existing Nix expressions already attempt, and instead builds the set around actual operational need, selecting tools per category rather than reproducing another distribution's inventory wholesale. Two principles stand out: combining well-known, established tools with brand-new ones, and skipping unmaintained projects. This is a meaningful curation stance for professionals. Anyone who has watched a Kali-style meta-package pull in a dozen abandoned scanners knows that stale tooling is a liability — outdated dependencies in security tools are themselves a supply-chain risk — and a set that prunes dead projects is easier to reason about from both an offensive and a defensive perspective.


Mechanically, the project works through NixOS's standard import mechanism. You make the repository available locally and then include the category files you need in /etc/nixos/configuration.nix, pulling in, say, ./port-scanners.nix alongside your normal hardware configuration. The README links to hosted documentation listing all available categories under the imports page, which effectively serves as the index of what tool families are covered. This declarative approach means your workstation's tooling is versioned in configuration and reproducible across machines — a property that matters when you need to document exactly which tool versions were present during an authorized assessment.


The second consumption pattern the README demonstrates is ad-hoc shells, and this is arguably where the project is most useful in day-to-day operations. Rather than permanently installing a full arsenal on your host, you cherry-pick tools into a small mkShell expression — the example builds portscan.nix with nmap and masscan in nativeBuildInputs — and drop into it with nix-shell portscan.nix. The result is an ephemeral, scoped environment containing exactly the tools a specific task needs and nothing else. For consultants rotating between client environments, this reduces both attack surface on the operator's own machine and the risk of tool sprawl confusing later audits.


The README also points at a hosted template, nstb-shell.nix, described as a starting point from which you delete the tools you don't need — an inverted but pragmatic workflow compared to building up from scratch. Additionally, it recommends RedNix from redcode-labs, a companion repository offering ready-to-use shells. This cross-referencing tells you the ecosystem around nix-security-box is designed in layers: the raw package set here, preassembled shell environments there, and per-category configuration modules in between. An operator can enter at whichever level of abstraction fits their familiarity with Nix.


It is worth dwelling on why the Nix model specifically suits security work, because the README implies it without arguing it. Immutable, content-addressed packages mean tool versions are pinned and bit-reproducible; two analysts importing the same expression get identical binaries, which is valuable when reproducing scan behavior or when a finding needs to be verified by a second pair of eyes. Nix's isolation also means a niche or bleeding-edge tool — exactly the kind this project explicitly wants to surface — can be installed without polluting system state or creating dependency conflicts with the rest of your workstation, a chronic problem with pip- and gem-installed security utilities on traditional distros.


The nix-shell example itself doubles as one of the two invocation snippets worth reproducing conceptually: define a shell with the tools you want, then run nix-shell portscan.nix to enter it. The other is the configuration.nix import pattern, where category files are added to the imports list. Both are standard NixOS idioms, and notably neither is weaponized content — the repository distributes installation metadata, not exploits or payloads. The actual offensive capability lives in the packaged tools themselves, each of which arrives with its own upstream documentation, license, and operational considerations.


For blue-team readers, the topics include blue-team for a reason: the same declarative packaging that assembles a scanner environment can assemble a defensive analysis environment, and the project's category structure appears to cover tooling across the spectrum rather than only attack utilities. Defenders monitoring an authorized assessment can also benefit from the deterministic nature of the setup — knowing precisely which tools an internal red team deployed makes it easier to correlate the traffic those tools generate, such as the distinctive probes of masscan at high packet rates.


There are some practical caveats to weigh. The README is relatively terse, and depth of documentation lives in the hosted category listing rather than the repo itself; a prospective user should browse the imports page to judge coverage in the categories they care about before committing. The project also assumes working familiarity with Nix and NixOS — the configuration examples (, imports, mkShell) will feel natural to a Nix user but opaque to someone arriving from an apt- or pacman-based workflow, for whom a Kali-style distribution may remain the lower-friction path.


Overall, nix-security-box is best understood as infrastructure for a particular kind of operator: one who already runs NixOS and wants security tooling treated with the same rigor as the rest of their system — pinned, reproducible, pruned of dead projects, and scoped per task. Its curation policy (maintained tools only, established plus emerging) is a genuine differentiator in a space where meta-collections often accrete without pruning, and the shell-based workflow it promotes aligns well with the discipline of keeping an authorized assessment's tooling footprint minimal and auditable. For teams standardized on Nix, it is a sensible foundation; for everyone else, it is an interesting case study in what reproducible packaging brings to operational security work.



Official project repository for fabaff/nix-security-box.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/11/nix-security-box-for-curated-security.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.