366 Commits

Author SHA1 Message Date
Valentin David
26e318b86c data/systemd: make snapd.seed wait for snapd.socket only
snapd.service should not need to be started from snapd.seed.service
to start. Only snapd.socket needs to be started.
2024-02-18 15:06:52 +02:00
Valentin David
3e9425d21c snapd.apparmor.service: add explicit dependency to snapd.mounts.target
In case of re-execution, snapd snap has to be
mounted. apparmor.service has a dependency to local-fs.target which is
enough in theory. But in case this dependency dispappears, it is
better to have an explicit dependency to snapd.mount.target in the
unit.
2024-02-18 15:06:52 +02:00
Oliver Calder
3cd59d8985 Revert "many: add stub services for prompting"
This reverts commit 7fe4772e26.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2024-02-18 15:06:52 +02:00
Oliver Calder
a4178bea54 Revert "data: fix snapd.aa-prompt-ui.service to actually get started (#12693)"
This reverts commit 82b79b4322.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2024-02-18 15:06:52 +02:00
Ernest Lotter
4db9975541 Revert "release: 2.61.2" 2024-02-18 13:09:17 +02:00
Valentin David
d9532d3a64 data/systemd: make snapd.seed wait for snapd.socket only
snapd.service should not need to be started from snapd.seed.service
to start. Only snapd.socket needs to be started.
2024-02-15 22:18:26 +02:00
Valentin David
6b7f3e38f5 snapd.apparmor.service: add explicit dependency to snapd.mounts.target
In case of re-execution, snapd snap has to be
mounted. apparmor.service has a dependency to local-fs.target which is
enough in theory. But in case this dependency dispappears, it is
better to have an explicit dependency to snapd.mount.target in the
unit.
2024-02-15 22:15:43 +02:00
Oliver Calder
f48850c0d1 Revert "many: add stub services for prompting"
This reverts commit 7fe4772e26.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2024-02-15 22:10:21 +02:00
Oliver Calder
561401565d Revert "data: fix snapd.aa-prompt-ui.service to actually get started (#12693)"
This reverts commit 82b79b4322.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2024-02-15 22:08:50 +02:00
Sergio Cazzolato
45b23f8a66 Fix selinux policy for polkit agent
The selinux-clean test started failing in fedora and centos recently.

It is caused by a change in the polkit_agent interface where now the
polkit-agent-helper-1 is located here
/usr/lib{exec,/polkit-1}/polkit-agent-helper-1

The change has been introduced in:
https://github.com/snapcore/snapd/pull/13261

The denial produced is the following:
type=AVC msg=audit(1698154354.527:12577): avc:  denied  { getattr } for
pid=82525 comm="snapd" path="/usr/lib/polkit-1/polkit-agent-helper-1"
dev="sda5" ino=109823 scontext=system_u:system_r:snappy_t:s0
tcontext=system_u:object_r:policykit_auth_exec_t:s0 tclass=file
permissive=1
2023-11-29 10:06:20 +02:00
Sergio Cazzolato
f71b83203b tests: fix selinux-lxd in centos-7 (#13224)
Update the selinux policy to fix the denial which is shown in centos 7

type=AVC msg=audit(09/26/23 12:44:11.492:315) : avc:  denied  { rename }
for  pid=28207 comm=snapd name=lxd.lxc.yLBQbN9J4LrW~ dev="sda2"
ino=17679133 scontext=system_u:system_r:snappy_t:s0
tcontext=system_u:object_r:usr_t:s0 tclass=lnk_file permissive=1
2023-09-28 15:32:41 +02:00
Sergio Cazzolato
12adc7f85f tests: fix selinux-clean denials after removing snap (#13100)
After pr #13019 the selinux-clean test started failing after removing
the snap test-snapd-service.

type=AVC msg=audit(08/21/23 14:42:23.030:1354) : avc:  denied  { search
} for  pid=38749 comm=snap name=x1 dev="sda5" ino=196452
scontext=system_u:system_r:snappy_cli_t:s0
tcontext=system_u:object_r:snappy_var_t:s0 tclass=dir permissive=1
----
type=AVC msg=audit(08/21/23 14:42:23.030:1355) : avc:  denied  { getattr
} for  pid=38749 comm=snap path=/var/snap/test-snapd-service/x1
dev="sda5" ino=196452 scontext=system_u:system_r:snappy_cli_t:s0
tcontext=system_u:object_r:snappy_var_t:s0 tclass=dir permissive=1
----
type=AVC msg=audit(08/21/23 14:42:38.846:1412) : avc:  denied  { search
} for  pid=39200 comm=snap name=x1 dev="sda5" ino=196452
scontext=system_u:system_r:snappy_cli_t:s0
tcontext=system_u:object_r:snappy_var_t:s0 tclass=dir permissive=1
----
type=AVC msg=audit(08/21/23 14:42:38.846:1413) : avc:  denied  { getattr
} for  pid=39200 comm=snap path=/var/snap/test-snapd-service/x1
dev="sda5" ino=196452 scontext=system_u:system_r:snappy_cli_t:s0
tcontext=system_u:object_r:snappy_var_t:s0 tclass=dir permissive=1
2023-08-22 12:10:32 +02:00
Ondrej Kubik
db0fc0be0a data: include "modprobe.d" and "modules-load.d" in preseeded blob
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2023-07-04 18:09:15 +02:00
Philip Meulengracht
e7caa4cdf7 data/selinux: require type boot_t 2023-05-10 08:38:58 +02:00
Philip Meulengracht
8f0a52fc01 data/selinux: appstream interface needs to be able to mount on /var/lib 2023-05-10 08:38:58 +02:00
Philip Meulengracht
15bb9b2fc2 data/selinux: more AVC denials that needs to be handled 2023-05-10 08:38:58 +02:00
Philip Meulengracht
9bc1899f93 data/selinux: move the etc rule to its own section 2023-05-03 10:00:27 +02:00
Philip Meulengracht
b38c5d3c87 data/selinux: add missing AVC rule for etc_t 2023-05-03 10:00:27 +02:00
Michael Vogt
82b79b4322 data: fix snapd.aa-prompt-ui.service to actually get started (#12693)
* data: fix snapd.aa-prompt-ui.service to actually get started

The current snapd.aa-prompt-ui.service user service is dbus activated.
However this does not work with the latest prompt design.

* packaing: add snapd.aa-prompt-ui.service to auto-start
2023-04-06 13:34:13 +02:00
Sergio Cazzolato
2e1778c5ad In selinux policy allow snapd to read upowerd binary
This is required by upower-observe interface.

Some tests are failing in centos and fedora after the
upowerObserveInterface was update in this way.

func (iface *upowerObserveInterface) StaticInfo() interfaces.StaticInfo
{
...
		ImplicitOnCore:
osutil.IsExecutable("/usr/libexec/upowerd"),
...
}

This is to avoid this denial:

type=SYSCALL msg=audit(1679948376.046:1319): arch=c000003e syscall=262
success=yes exit=0 a0=ffffffffffffff9c a1=c0001e47b0 a2=c0001246b8 a3=0
items=0 ppid=1 pid=40320 auid=4294967295 uid=0 gid=0 euid=0 suid=0
fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="snapd"
exe="/usr/libexec/snapd/snapd" subj=system_u:system_r:snappy_t:s0
key=(null)
type=AVC msg=audit(1679948376.046:1319): avc:  denied  { getattr } for
pid=40320 comm="snapd" path="/usr/libexec/upowerd" dev="sda2"
ino=2180887 scontext=system_u:system_r:snappy_t:s0
tcontext=system_u:object_r:devicekit_power_exec_t:s0 tclass=file
permissive=1
2023-03-30 17:17:10 +01:00
Alberto Mardegan
6e618c4963 data/selinux: update comment 2023-01-10 09:25:45 +01:00
Alberto Mardegan
8047108c64 data/selinux: update policy for new snap-confine
We now build the snap "/" as a tmpfs, so we need additional permissions.
2023-01-10 09:25:45 +01:00
Sergio Costas
ff7978736b data: install snapcraft logo in /usr/share/snapd (#12388)
This commit ensures that the snapcraft icon is shown in the lock screen notifications. Unfortunately, to make it work it requires to be modified in the .deb package; it seems that there is no way of doing this in the snap package because the required change must be set in the "first" .desktop file, and /usr/share(/applications) is before than /var/lib/snapd/desktop(/applications) in the XDG_DATA_DIRS order.

Jira: DT-862
2022-12-07 11:05:42 +01:00
Alex Murray
dbd4fc753d data: Add systemd-tmpfiles configuration to create private tmp dir
Use systemd-tmpfiles to create the private tmp mount namespace root
dir (/tmp/snap-private-tmp) on boot as owned by root with restrictive
permissions. We can use this as a known location to then create per-snap
private tmp mount namespace dirs (/tmp/snap-private-tmp/snap.$SNAP_INSTANCE)
etc.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2022-12-01 06:29:44 +01:00
Michael Vogt
c502f0cd50 Merge pull request #12037 from valentindavid/valentindavid/systemd-mount-unit-deps
many: create snapd.mounts targets to schedule mount units
2022-11-08 08:29:27 +01:00