dracut-support interface¶
dracut-support allows operating as the
dracut program. This interface is for
internal use by the dracut snap. You should not need to use this interface in
your snap.
The default snap seccomp policy denies creating files with the setuid or setgid
permission bits set (via chmod, fchmod, fchmodat, fchmodat2, creat,
mknod, mknodat, and open/openat with O_CREAT or O_TMPFILE).
Connecting this interface suppresses those deny rules so that the snap can
preserve setuid/setgid file modes when staging files, for example when copying
system files with cp -a while building an initrd image. The suppression
applies only to the apps and hooks that have the plug connected; other apps and
hooks in the same snap remain hardened. Note that openat2 remains
unconditionally denied for all snaps, as its arguments cannot be inspected by
seccomp.
Requires snapd version 2.80+.
Caution
This interface allows the snap to create setuid-root binaries in its writable
areas. Snap data directories, such as /var/snap/<snap>/common, are created
world-readable and world-executable (mode 0755), so on a suid-enabled host
filesystem any unconfined local user can directly execute a root-owned setuid
binary staged there by a root-running snap and gain root. Connections therefore
grant host-root trust and are reviewed accordingly by the Snap Store.
Developer details¶
Auto-connect: no Super-privileged: yes
Code examples¶
The test code can be found in the snapd repository: https://github.com/canonical/snapd/blob/master/interfaces/builtin/dracut_support_test.go
The source code for the interface is in the snapd repository: https://github.com/canonical/snapd/blob/master/interfaces/builtin/dracut_support.go