summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNoé Lopez <noelopez@free.fr>2025-12-08 16:39:11 +0100
committerRutherther <rutherther@ditigal.xyz>2025-12-22 22:48:57 +0100
commit587fd2dad49d8af3f31d06e29ff43c986d6f35c4 (patch)
tree83caa58ed08acc6dae900f219d4c7bcfb5927cc7 /doc
parent9a78e760762c1d93369e765bdce12388e1662ec6 (diff)
etc: Add AppArmor profile for the daemon.
* .gitignore: Add etc/apparmor.d/tunables/guix. * Makefile.am (nodist_apparmor_profile_DATA) (nodist_apparmor_profile_tunables_DATA): Define it. * configure.ac: Generate etc/apparmor.d/tunables/guix. Add --with-apparmor-profile-dir option. * etc/apparmor.d/guix-daemon: New file. * etc/apparmor.d/tunables/guix.in: New file. * doc/guix.texi: Document AppArmor profiles. * gnu/packages/package-management.scm (guix): Add future changes commented. Change-Id: Iac7df9d642383cc46a2d450c3badef31199ab041 Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index d7d40ceb223..fc25b653f32 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -146,6 +146,7 @@ Copyright @copyright{} 2025 Artur Wroblewski@*
146Copyright @copyright{} 2025 Edouard Klein@* 146Copyright @copyright{} 2025 Edouard Klein@*
147Copyright @copyright{} 2025 Rodion Goritskov@* 147Copyright @copyright{} 2025 Rodion Goritskov@*
148Copyright @copyright{} 2025 dan@* 148Copyright @copyright{} 2025 dan@*
149Copyright @copyright{} 2025 Noé Lopez@*
149 150
150Permission is granted to copy, distribute and/or modify this document 151Permission is granted to copy, distribute and/or modify this document
151under the terms of the GNU Free Documentation License, Version 1.3 or 152under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -919,6 +920,7 @@ pre-built binaries.
919* Build Environment Setup:: Preparing the isolated build environment. 920* Build Environment Setup:: Preparing the isolated build environment.
920* Daemon Offload Setup:: Offloading builds to remote machines. 921* Daemon Offload Setup:: Offloading builds to remote machines.
921* SELinux Support:: Using an SELinux policy for the daemon. 922* SELinux Support:: Using an SELinux policy for the daemon.
923* AppArmor Support:: Using an AppArmor profile for the daemon.
922@end menu 924@end menu
923 925
924@node Build Environment Setup 926@node Build Environment Setup
@@ -1097,6 +1099,8 @@ systemctl daemon-reload
1097systemctl start guix-daemon 1099systemctl start guix-daemon
1098@end example 1100@end example
1099 1101
1102If your system has AppArmor enabled, @pxref{AppArmor Support}.
1103
1100@quotation Warning 1104@quotation Warning
1101The commands above assume that @command{guix pull} was run for the root 1105The commands above assume that @command{guix pull} was run for the root
1102user. You can check whether this is the case by running this command: 1106user. You can check whether this is the case by running this command:
@@ -1526,6 +1530,43 @@ installation time whenever the Guix package that provides the
1526effectively running @code{guix-daemon} executable is upgraded. 1530effectively running @code{guix-daemon} executable is upgraded.
1527@end enumerate 1531@end enumerate
1528 1532
1533@node AppArmor Support
1534@subsection AppArmor Support
1535
1536@cindex AppArmor
1537
1538Guix includes an AppArmor profile for the build daemon in
1539@file{etc/apparmor.d/guix-daemon} that can be installed on systems with
1540strict AppArmor policies to allow it to run unprivileged
1541(@pxref{Build Environment Setup}). Indeed, the unprivileged daemon makes
1542use of Linux user namespaces but these are disallowed
1543without an AppArmor policy on some systems like Ubuntu.
1544
1545To know if this applies to you, check if the
1546@code{kernel.apparmor_restrict_unprivileged_userns} kernel parameter is
1547enabled.
1548
1549@subsubsection Installing the AppArmor profile
1550@cindex AppArmor, profile installation
1551
1552@quotation Note
1553The @code{guix-install.sh} binary installation script offers to perform
1554the steps below for you (@pxref{Binary Installation}).
1555@end quotation
1556
1557Run these commands as root to install the profile:
1558
1559@example
1560export apparmor_sources=/var/guix/profiles/per-user/root/current-guix/etc/apparmor.d
1561cp -f -t /etc/apparmor.d/tunables "$apparmor_sources/tunables/guix"
1562cp -f -t /etc/apparmor.d "$apparmor_sources/guix-daemon"
1563cp -f -t /etc/apparmor.d "$apparmor_sources/guix"
1564apparmor_parser -r /etc/apparmor.d/guix-daemon
1565apparmor_parser -r /etc/apparmor.d/guix
1566@end example
1567
1568After this, the build daemon will be able to function correctly.
1569
1529@node Invoking guix-daemon 1570@node Invoking guix-daemon
1530@section Invoking @command{guix-daemon} 1571@section Invoking @command{guix-daemon}
1531@cindex @command{guix-daemon} 1572@cindex @command{guix-daemon}