diff options
| author | Rutherther <rutherther@ditigal.xyz> | 2024-10-11 21:49:10 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-11-03 22:54:00 +0100 |
| commit | e5d64e87d4759d62c035dad203e9975de3b621a6 (patch) | |
| tree | 23ff18879a0ad7293f59c4bec2e5d6864adc0cf1 /gnu/system.scm | |
| parent | e7a445571d0e45be96894bc6b298b67ceb2f3989 (diff) | |
system: %default-privileged-programs: Set ping capabilities
Ping and ping6 don't need setuid, they can work with
cap_net_raw capability only. This means that even if
ping or ping6 had a vulnerability that could be
used for execution as root, it can't anymore if
the program is not setuid.
* gnu/system.scm (%default-privileged-programs): Remove ping, ping6 setuid
programs, add ping, ping6 programs with cap_net_raw=ep capabilities
Change-Id: Ie409b477f548dbff3318eec33d0d2ca16a1b3209
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/system.scm')
| -rw-r--r-- | gnu/system.scm | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index c19730b331e..9b15a3590ae 100644 --- a/gnu/system.scm +++ b/gnu/system.scm | |||
| @@ -1253,25 +1253,30 @@ use 'plain-file' instead~%") | |||
| 1253 | 1253 | ||
| 1254 | (define %default-privileged-programs | 1254 | (define %default-privileged-programs |
| 1255 | (let ((shadow (@ (gnu packages admin) shadow))) | 1255 | (let ((shadow (@ (gnu packages admin) shadow))) |
| 1256 | (map file-like->setuid-program | 1256 | (cons* |
| 1257 | (list (file-append shadow "/bin/passwd") | 1257 | (privileged-program |
| 1258 | (file-append shadow "/bin/chfn") | 1258 | (program (file-append inetutils "/bin/ping")) |
| 1259 | (file-append shadow "/bin/sg") | 1259 | (capabilities "cap_net_raw=ep")) |
| 1260 | (file-append shadow "/bin/su") | 1260 | (privileged-program |
| 1261 | (file-append shadow "/bin/newgrp") | 1261 | (program (file-append inetutils "/bin/ping6")) |
| 1262 | (file-append shadow "/bin/newuidmap") | 1262 | (capabilities "cap_net_raw=ep")) |
| 1263 | (file-append shadow "/bin/newgidmap") | 1263 | (map file-like->setuid-program |
| 1264 | (file-append inetutils "/bin/ping") | 1264 | (list (file-append shadow "/bin/passwd") |
| 1265 | (file-append inetutils "/bin/ping6") | 1265 | (file-append shadow "/bin/chfn") |
| 1266 | (file-append sudo "/bin/sudo") | 1266 | (file-append shadow "/bin/sg") |
| 1267 | (file-append sudo "/bin/sudoedit") | 1267 | (file-append shadow "/bin/su") |
| 1268 | (file-append fuse-2 "/bin/fusermount") | 1268 | (file-append shadow "/bin/newgrp") |
| 1269 | (file-append fuse "/bin/fusermount3") | 1269 | (file-append shadow "/bin/newuidmap") |
| 1270 | 1270 | (file-append shadow "/bin/newgidmap") | |
| 1271 | ;; To allow mounts with the "user" option, "mount" and "umount" must | 1271 | (file-append sudo "/bin/sudo") |
| 1272 | ;; be setuid-root. | 1272 | (file-append sudo "/bin/sudoedit") |
| 1273 | (file-append util-linux "/bin/mount") | 1273 | (file-append fuse-2 "/bin/fusermount") |
| 1274 | (file-append util-linux "/bin/umount"))))) | 1274 | (file-append fuse "/bin/fusermount3") |
| 1275 | |||
| 1276 | ;; To allow mounts with the "user" option, "mount" and "umount" must | ||
| 1277 | ;; be setuid-root. | ||
| 1278 | (file-append util-linux "/bin/mount") | ||
| 1279 | (file-append util-linux "/bin/umount")))))) | ||
| 1275 | 1280 | ||
| 1276 | (define %setuid-programs | 1281 | (define %setuid-programs |
| 1277 | ;; Do not add to this list or use it in new code! It's defined only to ease | 1282 | ;; Do not add to this list or use it in new code! It's defined only to ease |
