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

This commit is contained in:
Philip Taron
2025-03-17 17:32:56 -07:00
committed by GitHub
2 changed files with 34 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ctf-ynetd";
version = "2024.12.31";
src = fetchurl {
url = "https://hxp.io/assets/data/code/ctf-ynetd-2024.12.31.tar.xz";
hash = "sha256-hUEZZEulmaV3KfKOqE1wl7y4SRUn2/HoOjVDabk5+YA=";
};
installPhase = ''
runHook preInstall
install -Dm755 ynetd $out/bin/ynetd
runHook postInstall
'';
meta = {
description = "Fork of ynetd hardened for CTFs with isolation using PID namespaces, minimal overhead proof-of-work checking, and strict resource limits via cgroups";
homepage = "https://hxp.io/code/";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.haylin ];
mainProgram = "ynetd";
};
})
+5
View File
@@ -2,6 +2,7 @@
lib,
stdenv,
fetchurl,
callPackage,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ynetd";
@@ -22,6 +23,10 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
# ctf-ynetd releases are based on the last stable ynetd version
# these should be kept in sync when possible
passthru.hardened = callPackage ./hardened.nix { };
meta = {
description = "Small server for binding programs to TCP ports";
homepage = "https://yx7.cc/code/";