/
wax_boy
/
semaphore_custom
Обзор
Документация
Войти
/
wax_boy
/
semaphore_custom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
util/security_linux.go
15 строк
395 B
Denis Gukov
sec(config): add flag process.no_new_privs
16 апр 2026, 13:36
Не верифицирован
16 апр 2026, 13:36
c90f8f6
Код
Авторство
О чём код?
//go:build linux package util import ( "golang.org/x/sys/unix" ) // SetNoNewPrivs sets the no_new_privs flag on the current process. // Once set, this is inherited by all child processes and cannot be unset. // It prevents privilege escalation via setuid/setgid binaries and // filesystem capabilities. func SetNoNewPrivs() error { return unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) }