5394 Commits

Author SHA1 Message Date
Ian Johnson
2f4b0a4228 interfaces/docker-support: make generic rules not conflict with snap-confine
* interfaces/docker-support: make generic rules not conflict with snap-confine

The rules we inject into the profile to account for allowing devmode snaps to
execute other snaps are in conflict with these, meaning that the docker snap
(and the strictly confined microk8s snap) cannot be installed with devmode
confinement which sometimes needs to be done. So make these generic rules allow
anything except very specifically the transition rules which we inject that
have regular expression wildcards in them to get the policy to compile
properly.

Also adjust the spread test to ensure we are testing that the docker snap can
be installed with devmode, at least to the point where apparmor profiles are
compiled correctly.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* interfaces/docker-support: re-word comments for clarity

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* interfaces/docker-support: add additional missing exclusion rules

Thanks to Alex for spotting these being missing.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-03-21 09:16:18 +01:00
Michael Vogt
60f4427aec Merge pull request #11518 from alfonsosanchezbeato/modem-manager-allow-managed-objects
i/b/modem-manager: provide access to ObjectManager
2022-03-21 09:14:19 +01:00
Michael Vogt
81f4c48522 Merge pull request #11474 from alfonsosanchezbeato/allow-more-calls-to-resolved
i/b/network_{control,manager}.go: add more access to resolved
2022-03-21 09:12:16 +01:00
Alfonso Sánchez-Beato
0b9149631f i/b/network-manager: restrict a bit more calls to GetConnectionUnixUser 2022-03-18 14:51:00 +01:00
Michael Vogt
617d36191d Merge pull request #11488 from alfonsosanchezbeato/add-seccomp-call
i/seccomp/template.go: add close_range to the allowed syscalls
2022-03-17 13:24:09 +01:00
Alfonso Sánchez-Beato
a47c423d49 i/b/modem_manager: allow access to org.freedesktop.DBus.ObjectManager
org.freedesktop.DBus.ObjectManager is now used in libmm-glib, so it
gets called by clients accessing the ModemManager daemon.
2022-03-17 12:01:13 +01:00
Michael Vogt
4175ea3c1f Merge pull request #11491 from jdstrand/jdstrand/opengl-i915-perf_stream_paranoid
interface/opengl: allow read on /proc/sys/dev/i915/perf_stream_paranoid
2022-03-14 11:57:33 +01:00
Alfonso Sánchez-Beato
cf319c1ecb i/b/network_manager.go: allow nmcli calls to GetConnectionUnixUser
nmcli is using these calls now. Denial is:

[10409.360786] audit: type=1107 audit(1646846633.209:211): pid=578
uid=100 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED"
operation="dbus_method_call" bus="system" path="/org/freedesktop/DBus"
interface="org.freedesktop.DBus" member="GetConnectionUnixUser"
mask="send" name="org.freedesktop.DBus" pid=2359
label="snap.network-manager.nmcli" peer_label="unconfined"
2022-03-11 16:51:25 +01:00
Alfonso Sánchez-Beato
88225be55e i/b/network_{control,manager}.go: add more access to resolved
Allow more calls to systemd-resolved dBus interface from the
interfaces that can control network resources. These new calls are
being used now by NetworkManager in jammy. Also, point to more
up-to-date documenation for the interface.
2022-03-11 16:51:25 +01:00
Jamie Strandboge
6854e0300e interface/opengl: allow read on /proc/sys/dev/i915/perf_stream_paranoid
/proc/sys/dev/i915/perf_stream_paranoid is used to allow toggling Intel
Graphics metrics collection to non-root users. The firefox snap (at
least) reads this during startup (but doesn't try to write to it) which
causes log noise but otherwise seems to work ok. Since the contents are
a simple integer value, there is nothing sensitive in the file, so allow
snaps that plug opengl to read the file.

References:
- https://github.com/intel/pti-gpu#prerequisites
2022-03-11 08:45:13 -06:00
Michael Vogt
ef5c97306d Merge pull request #11485 from alexmurray/apparmor-base-template-systemd-machined
interfaces/apparmor: Update base template for systemd-machined
2022-03-11 13:25:02 +01:00
Michael Vogt
4154e57ca4 Merge pull request #11481 from alfonsosanchezbeato/add-dynamic-linker-for-jammy
i/a/template.go: add ld path for jammy
2022-03-11 13:17:22 +01:00
Alfonso Sánchez-Beato
9379cf376f i/seccomp/template.go: add close_range to the allowed syscalls
close_range was added to kernel 5.9. For snap-seccomp to actually use
this information, libseccomp 2.5.2 or later is needed.
2022-03-11 12:02:14 +01:00
Alfonso Sánchez-Beato
3774aef9a2 i/a/template.go: modify ld path for jammy
In jammy, the full path for the dynamic linker has changed to
/usr/lib/{arch}-linux-gnu/ld-linux-{arch}.so.{1,2}
Change the related rule so things like ldd can work confined.
2022-03-10 09:26:38 +01:00
Alex Murray
ec7507a985 interfaces/apparmor: Update base template for systemd-machined
The base apparmor template already includes the various VarLink sockets but
is missing the one from systemd-machined. Support was recently added
upstream in https://gitlab.com/apparmor/apparmor/-/merge_requests/861 so
this change ensures we keep the base template up to date in this regard
too.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2022-03-10 16:14:00 +10:30
Michael Vogt
58cf958e17 Merge pull request #11440 from oSoMoN/browser-support-rtkit-realtimewithpid
interfaces/browser-support: allow RealtimeKit's MakeThreadRealtimeWithPID
2022-03-08 18:35:15 +01:00
Michael Vogt
6a548dcc90 Merge pull request #11465 from bboozzoo/bboozzoo/account-consumer-pam-tally2
interfaces/builtin/account-control: allow to execute pam_tally2
2022-03-08 18:27:01 +01:00
Miguel Pires
dd0e93e849 interfaces: fix AppArmor permissions for Snap dir 2022-03-08 10:32:35 +00:00
Miguel Pires
803e770435 Merge branch 'master' into core22-migration 2022-03-04 16:59:16 +00:00
Michael Vogt
6ee124ec0d Merge pull request #11409 from anonymouse64/feature/devmode-snaps-call-snap-confine-extra-unit-tests
interfaces/apparmor: add missing unit tests for special devmode rules/behavior
2022-03-04 13:49:30 +01:00
Michael Vogt
1b8a1bff8a Merge pull request #11372 from bboozzoo/bboozzoo/systemd-interface-backend-batch
interfaces/systemd: use batch systemd operations
2022-03-04 10:31:19 +01:00
Michael Vogt
f48ef30b01 Merge pull request #11459 from anonymouse64/bugfix/resolved-dbus-rules-in-network-control
interfaces/network-control: add D-Bus rules for resolved too
2022-03-04 09:24:41 +01:00
Ian Johnson
1c92cab5c1 interfaces/network-control: add D-Bus rules for resolved too
Currently the only place these rules are exposed is in the network-manager
slot, which is only intended to be slotted by network-manager itself, but there
are valid use cases to be able to call these D-Bus endpoints for a snap
managing the network that is not network-manager too, so add them here.

Fixes: https://bugs.launchpad.net/snapd/+bug/1962501
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-03-03 08:21:24 -06:00
Maciej Borzecki
798579546f interfaces/builtin: allow useradd to call pam_tally2
Useradd can reach out to pam_tally2 to reset the login counter, in which case it
gets blocked by AppArmor with:

apparmor="DENIED" operation="exec" profile="snap.test.test"
name="/usr/sbin/pam_tally2" pid=5056 comm="useradd" requested_mask="x"
denied_mask="x" fsuid=0 ouid=0

Fixes: https://bugs.launchpad.net/snapd/+bug/1958640

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-03 13:28:14 +01:00
Ian Johnson
3ccc95c9f0 interfaces/cpu-control: add extra idleruntime data/reset files to cpu-control
This is needed for some kernels with the mentioned patch where individual
monitoring of CPU's can be achieved by these files.

See also ticket 00329266 and LP bug 1962447

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-03-02 16:25:04 -06:00