ynetd: add hardened ctf-centric fork (#390813)

authored by philiptaron.tngl.sh and committed by GitHub def23ceb 65a59121

+34
+29
pkgs/by-name/yn/ynetd/hardened.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + }: 6 + stdenv.mkDerivation (finalAttrs: { 7 + pname = "ctf-ynetd"; 8 + version = "2024.12.31"; 9 + 10 + src = fetchurl { 11 + url = "https://hxp.io/assets/data/code/ctf-ynetd-2024.12.31.tar.xz"; 12 + hash = "sha256-hUEZZEulmaV3KfKOqE1wl7y4SRUn2/HoOjVDabk5+YA="; 13 + }; 14 + 15 + installPhase = '' 16 + runHook preInstall 17 + install -Dm755 ynetd $out/bin/ynetd 18 + runHook postInstall 19 + ''; 20 + 21 + meta = { 22 + description = "Fork of ynetd hardened for CTFs with isolation using PID namespaces, minimal overhead proof-of-work checking, and strict resource limits via cgroups"; 23 + homepage = "https://hxp.io/code/"; 24 + license = lib.licenses.mit; 25 + platforms = lib.platforms.linux; 26 + maintainers = [ lib.maintainers.haylin ]; 27 + mainProgram = "ynetd"; 28 + }; 29 + })
+5
pkgs/by-name/yn/ynetd/package.nix
··· 2 lib, 3 stdenv, 4 fetchurl, 5 }: 6 stdenv.mkDerivation (finalAttrs: { 7 pname = "ynetd"; ··· 21 install -Dm755 ynetd $out/bin/ynetd 22 runHook postInstall 23 ''; 24 25 meta = { 26 description = "Small server for binding programs to TCP ports";
··· 2 lib, 3 stdenv, 4 fetchurl, 5 + callPackage, 6 }: 7 stdenv.mkDerivation (finalAttrs: { 8 pname = "ynetd"; ··· 22 install -Dm755 ynetd $out/bin/ynetd 23 runHook postInstall 24 ''; 25 + 26 + # ctf-ynetd releases are based on the last stable ynetd version 27 + # these should be kept in sync when possible 28 + passthru.hardened = callPackage ./hardened.nix { }; 29 30 meta = { 31 description = "Small server for binding programs to TCP ports";