Commit graph

1210 commits

Author SHA1 Message Date
Alexandre Pujol
8074ff4fd1
GTK abstraction: add support for gtk4. 2022-02-22 19:34:59 +00:00
Simon Deziel
9e0adcfd07 smbd: allow reading under /usr/share/samba
Signed-off-by: Simon Deziel <simon@sdeziel.info>
2022-02-17 18:54:54 -05:00
Craig Small
071935b914 Update apache2-common so that other processes can trace the hats that include this file. The main includes abstractions/base which has these lines in it, which is why ss -tnlp sometimes fails.
See also: https://bugs.debian.org/1003153 for more details about how this occurs.
2022-02-17 07:57:55 +00:00
John Johansen
e71e27c574 Merge smbd: include snippet generated at runtime on Debian and openSUSE
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/838
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2022-02-15 21:29:02 +00:00
Christian Boltz
19abc66425
smbd: include snippet generated at runtime on openSUSE 2022-02-15 21:52:15 +01:00
Jamie Strandboge
9505724d72 Allow access to socket directory used by recent ibus-daemon 2022-02-12 08:38:23 +00:00
intrigeri
9af832f48a smbd: include snippet generated at runtime on Debian 2022-02-12 08:36:10 +00:00
Cristiano Nunes
f0d3d6748f Fix: Opening links with Chrome 2022-02-03 09:42:36 -03:00
John Johansen
d9afe25a0d Merge add snap-browsers profile
Whenever the evince deb package tries to open a snap browser which was
selected as the default, we get the following denial:

audit[2110]: AVC apparmor="DENIED" operation="exec" profile="/usr/bin/evince" name="/usr/bin/snap" pid=2110 comm="env" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

As a short-term solution, we are adding a snap-browsers profile
which restricts what snaps opened by evince can do.
The long-term solution is currently not available, but could be
accomplished by using enhanced environment variable filtering/mediation
and delegation of open fds.

Bug: https://launchpad.net/bugs/1794064

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/806
Acked-by: John Johansen <john@jjmx.net>
2022-01-27 08:35:05 +00:00
Mikhail Morfikov
93d49a3945
add the GTK abstraction 2022-01-21 18:37:22 +01:00
Christian Boltz
90b312c55a Merge branch 'cboltz-samba-lmb2' into 'master'
abstractions/samba: allow ldb2 paths

See merge request apparmor/apparmor!821

Note: https://bugzilla.opensuse.org/show_bug.cgi?id=1192684 was made public in the meantime.

Acked-by: Jon Tourville <jon.tourville@canonical.com>
2022-01-18 12:53:52 +00:00
John Johansen
2b270216aa Merge abstractions/openssl: allow /etc/ssl/{engdef,engines}.d/
These directories were introduced in openssl in https://patchwork.ozlabs.org/project/openwrt/patch/20210429153530.10020-2-cotequeiroz@gmail.com/

I propose this patch for 3.0 and master. Optionally also for older branches, even if it's unlikely that systems using 2.13.x or older get a new-enough openssl to need this ;-)

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/818
Acked-by: John Johansen <john.johansen@canonical.com>
2022-01-17 20:07:29 +00:00
Christian Boltz
901f2ea9cd
abstractions/samba: allow ldb2 paths
libldb packaging in openSUSE changes to use "ldb2" in the path, adjust
the abstraction accordingly.

Patch by Samuel Cabrero <scabrero@suse.de>
via https://build.opensuse.org/request/show/947009

References:
- https://bugzilla.opensuse.org/show_bug.cgi?id=1192684 (non-public)
- https://build.opensuse.org/request/show/946250 (ldb packaging change)
- https://build.opensuse.org/request/show/946251 (samba packaging change)
2022-01-17 20:03:13 +01:00
Christian Boltz
867d32950e
Define @{HOMEDIRS} before using it in @{HOME}
The old order is not really wrong / a bug because the order doesn't
matter, but defining the variables it in the "right" order helps to
prevent confusion.

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003158
2022-01-05 21:00:50 +01:00
Noel Power
e19abd3bdf profiles/apparmor.d: Fix file_mmap violation for bsc#1192336.
- Fix 'apparmor="DENIED" operation="file_mmap" profile="samba-bgqd"
      name="/usr/lib64/samba/samba-bgqd" pid=2876 comm="samba-bgqd"
      requested_mask="m" denied_mask="m" fsuid=0 ouid=0'

entries appearing in SLE15-SP4

Signed-off-by: Noel Power <noel.power@suse.com>
2021-12-20 15:01:19 +00:00
Christian Boltz
e58dd798f0
abstractions/openssl: allow /etc/ssl/{engdef,engines}.d/
These directories were introduced in openssl in
https://patchwork.ozlabs.org/project/openwrt/patch/20210429153530.10020-2-cotequeiroz@gmail.com/
2021-12-19 22:36:05 +01:00
Christian Boltz
cac848e240
abstractions/python: add several permissions
- allow reading *.so.*
- allow directory listings in .../site-packages/
- allow reading various metadata files

These additions are based on denials seen on openSUSE Leap 15.3 with
python 3.9.
2021-12-04 20:54:52 +01:00
Christian Boltz
5491b75872
abstractions/python: merge /usr/ and /usr/local/ rules
This keeps all existing permissions, and adds a few that were out of
sync:
- /usr/lib*/python3.*/lib-dynload/*.so missed 3.1[0-9]
- /usr/lib/python3/... was missing, only /usr/local/python3/ was allowed
2021-12-04 20:09:52 +01:00
Georgia Garcia
21e5a721ab replace deprecated distutils with setuptools
Adds python3 setuptools as a build dependency for libapparmor

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/202
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/813
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-11-11 20:23:35 -03:00
Christian Boltz
8c1243e43f
Add missing /proc permissions to avahi-daemon profile
Fixes: https://gitlab.com/apparmor/apparmor/-/issues/203
2021-10-26 13:54:51 +02:00
Georgia Garcia
fb3283f37e add snap-browsers profile
Whenever the evince deb package tries to open a snap browser which was
selected as the default, we get the following denial:

audit[2110]: AVC apparmor="DENIED" operation="exec" profile="/usr/bin/evince" name="/usr/bin/snap" pid=2110 comm="env" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

As a short-term solution, we are adding a snap-browsers profile
which restricts what snaps opened by evince can do.
The long-term solution is currently not available, but could be
accomplished by using enhanced environment variable filtering/mediation
and delegation of open fds.

Bug: https://launchpad.net/bugs/1794064

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2021-10-18 09:44:52 -03:00
John Johansen
9d14d6ebfb Merge abstractions/samba: allow use of /run/lock/samba
Some distros use /run/lock/samba as the Samba lock directory, so allow
that in the samba abstraction in addition to /run/samba.

MR: https://gitlab.com/apparmor/apparmor!805
Acked-by: John Johansen <john.johansen@canonical.com>
2021-10-16 07:10:09 +00:00
Christian Boltz
85e53a5d04
Add profile for samba-bgqd
... and some rules in the smbd profile to execute it and send it a term
signal.

samba-bgqd is (quoting its manpage) "an internal helper program
performing asynchronous printing-related jobs."

samba-bgqd was added in Samba 4.15.

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1191532
2021-10-15 22:06:05 +02:00
Cameron Nemo
f5c9003d41 abstractions/samba: allow use of /run/lock/samba
Some distros use /run/lock/samba as the Samba lock directory, so allow
that in the samba abstraction in addition to /run/samba.
2021-10-05 22:51:18 -07:00
Christian Boltz
254ebacbd8
dnsmasq: allow paths for podman dnsname plugin
The dnsname plugin in podman needs access to some files in
/run/containers/cni/dnsname/*/

This is also documented upstream:
https://github.com/containers/dnsname/blob/main/README_PODMAN.md
but nobody thought about telling us to just update the profile :-/

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1190271
2021-09-16 23:10:38 +02:00
Shai4she
de5966671f Include local customization, cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990499 2021-09-03 08:27:02 +00:00
Mikhail Morfikov
b3dcd02dff
add a missing slash at the end of the sys rule 2021-08-20 00:38:14 +02:00
Christian Boltz
ea7b201ba4
Update abstractions/python and profiles for python 3.10
Fixes: https://gitlab.com/apparmor/apparmor/-/issues/187
2021-08-11 21:37:40 +02:00
John Johansen
a98469eb09 [7/7] abstractions: Make "available" readable as part of the enabled api
Understacking AppArmor if it is not the major LSM may set the enabled
field to false, to keep userspace from hitting the old shared proc
interfaces. The parameter "available" is added to indicate apparmor
is available but not present on the older interfaces.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/150
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/713
Signed-off-by: John Johansen <john.johansen@canonical.com>
2021-07-21 14:31:44 -07:00
Christian Boltz
f3dd0d1911
allow Prometheus metrics end-point in dovecot/stats
Patch by Michael Ströder <michael@stroeder.com>
2021-07-19 22:36:28 +02:00
Christian Boltz
b6b89478aa
Allow reading /etc/login.defs.d/ in abstraction/authentication
This directory can include login.defs config sniplets in openSUSE
Tumbleweed.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1188296

See also
https://en.opensuse.org/openSUSE:Packaging_UsrEtc#pam.2Fpam-config
2021-07-15 13:04:44 +02:00
Christian Boltz
b5241282e8
move @{PROC}/sys/crypto/fips_enabled r, rule
... from openssl to crypto abstraction
2021-07-13 21:56:29 +02:00
Christian Boltz
ba8087927f
Move crypto-policies rules from ssl_certs to crypto
No additional include rule needed since crypto is included in base.
2021-07-13 21:56:29 +02:00
Christian Boltz
534a6d3057
move @{PROC}/sys/crypto/* permissions from base to crypto 2021-07-13 21:56:29 +02:00
Christian Boltz
9830031314
Add crypto abstraction and include it in base
crypto allows reading /etc/gcrypt/random.conf, which is possibly needed
for all programs that use libgcrypt.

Reported by darix, he has seen it with vivaldi.
2021-07-13 21:56:29 +02:00
Christian Boltz
13a8221622
abstractions/ssl_certs: allow reading crypto policies
See https://gitlab.com/redhat-crypto/fedora-crypto-policies for details.

Reported by darix and also my own audit.log - the actual denial was for
/usr/share/crypto-policies/DEFAULT/openssl.txt.

Also allow the /etc/crypto-policies/ counterpart.

(I'm aware that the crypto policies are not really certificates, but
since they are used by several crypto libraries, ssl_certs is probably
the best place for them even if the filename doesn't match.)
2021-06-28 22:04:08 +02:00
Georgia Garcia
644d36003c profiles: Fix config dir on make check
The check-logprof test in the profiles Makefile specifies
the configuration directory as --configdir ../utils/test,
but when aa-logprof looks for severity.db in the configdir,
it cannot find it.

This fix points the configdir to utils. Note that the
logprof.conf on utils uses the configuration for files
created during the libapparmor installation on the system.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/177
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2021-06-21 14:20:34 +00:00
Christian Boltz
5853f52233
abstractions/php: support PHP 8
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1186267
2021-05-21 22:50:54 +02:00
Christian Boltz
d78db0502f
Update postfix profiles
with paths and needed permissions seen on latest Tumbleweed
2021-05-09 17:45:13 +02:00
Mikhail Morfikov
92e27f5566 abstractions: Add trash abstraction
I noticed that some apps have support for moving files to trash, but
currently there's no abstraction that would provide rules to make this
action possible.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/160
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/738
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-04-21 13:01:43 -07:00
Mikhail Morfikov
f19f9ae1fa abstractions: update video abstraction
the video abstraction currently it only contains the following rules:

  @{sys}/class/video4linux r,
  @{sys}/class/video4linux/** r,

Judging by the v4l path, this abstraction should be used whenever some
app wants to use for instance a webcam or other USB cameras to stream
video usually in chat apps. I was testing some apps, and it looks like
the following rules are needed to make the video streaming possible:

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/159
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/740
Signed-off-by: John Johansen <john.johansen@canonical.com>
2021-04-14 14:51:09 -07:00
John Johansen
c734839551 profiles: dhclient: allow setting task comm name
dhclient wants to set its thread names to functional names for
introspection purposes. Eg.

$ pstree -at 3395
dhclient ens3
  ├─{isc-socket}
  ├─{isc-timer}
  └─{isc-worker0000}

When denied this can result in dhclient breaking and failing to obtain
IPv4 addresses.

Fixes: https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1918410
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-03-30 17:16:50 -07:00
John Johansen
277677daf3 profiles: dhcpd: add rule for port_range
The following AppArmor denial errors are shown on startup:

Oct 25 00:52:00 xxx kernel: [  556.231990] audit: type=1400 audit(1603601520.710:32): apparmor="DENIED" operation="open" profile="/usr/sbin/dhcpd" name="/proc/sys/net/ipv4/ip_local_port_range" pid=1982 comm="dhcpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

Oct 25 00:52:00 xxx kernel: [  556.232257] audit: type=1400 audit(1603601520.710:33): apparmor="DENIED" operation="open" profile="/usr/sbin/dhcpd" name="/proc/sys/net/ipv4/ip_local_port_range" pid=1982 comm="dhcpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

Fixes: https://bugs.launchpad.net/bugs/1901373
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/726
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2021-03-15 23:56:19 -07:00
Mikhail Morfikov
5ad5dd0bcb abstractions: Fix wayland abstraction for compositors based on wlroots
Apparmor provides the wayland abstraction, but it looks like it misses
some rules. For instance, there are many wayland compositors which are
based on wlroots, and it looks like that when you try to use such
compositor, all GUI apps executed in the graphical environment can't
work properly (they don't event start). They all want the following
rule:

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/143
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/725
Signed-off-by: John Johansen <john.johansen@canonical.com>
2021-03-15 05:54:39 -07:00
Mikhail Morfikov
d4e0a94511 abstractions: Add missing rule in wutmp abstraction
Currently the wutmp abstraction has the following rules:
  /var/log/lastlog  rwk,
  /var/log/wtmp     wk,
  @{run}/utmp       rwk,

According to what I see in my apparmor profiles, just a few apps want
to interact with the files listed above, especially with the
/var/log/wtmp . But when the apps do this, they sometimes want the
read access to this file. An example could be the last command. Is
there any reason for not having the r in the rule?  The second thing
is the file /var/log/btmp (which isn't included in the
abstracion). Whenever I see an app, which wants to access the
/var/log/wtmp file, it also tries to interact with the /var/log/btmp
file, for instance lightdm/sddm or su . Most of the time they need
just wk permissions, but sometimes apps need also r on this file, an
example could be the lastb command, which is just a link to last.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/152
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/724
Signed-off-by: John Johansen <john.johansen@canonical.com>
2021-03-14 11:50:43 -07:00
Christian Boltz
08719eebc1
postfix-flush and -showq: add permissions needed with latest postfix
... as seen on openSUSE Tumbleweed
2021-03-07 14:33:59 +01:00
Christian Boltz
a07f30e25d
postfix: allow access to *.lmdb files
... in addition to *.db files.

openSUSE Tumbleweed now uses the lmdb format by default.
2021-03-07 14:33:49 +01:00
Christian Boltz
32bd2bcec3
cleanup postfix profiles
/etc/postfix/*.db is covered by abstractions/postfix-common
2021-03-07 14:33:37 +01:00
Rose Kunkel
ee5303c8a0 Fix nscd conflict with systemd-homed
My main user account is managed by systemd-homed. When I enable
AppArmor and have nscd running, I get inconsistent behavior with my
user account - sometimes I can't log in, sometimes I can log in but
not use sudo, etc.

This is the output of getent passwd:
  $ getent passwd
  root0:0::/root:/usr/bin/zsh
  bin1:1::/:/sbin/nologin
  daemon2:2::/:/sbin/nologin
  mail8:12::/var/spool/mail:/sbin/nologin
  ftp14:11::/srv/ftp:/sbin/nologin
  http33:33::/srv/http:/sbin/nologin
  nobody65534:65534:Nobody:/:/sbin/nologin
  dbus81:81:System Message Bus:/:/sbin/nologin
  [...]
  rose1000:1000:Rose Kunkel:/home/rose:/usr/bin/zsh

But getent passwd rose and getent passwd 1000 both return no output.
Stopping nscd.service fixes these problems. Checking the apparmor
logs, I noticed that nscd was denied access to
/etc/machine-id. Allowing access to that file seems to have fixed the
issue.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/707
Fixes: https://gitlab.com/apparmor/apparmor/-/issues/145
Signed-off-by: John Johansen <john.johansen@canonical.com>
2021-02-11 22:53:07 -08:00
Seth Arnold
656f2103ed profiles: firefox Add support for widevine DRM
Ubuntu 18.04, Firefox 60.0.1+build2-0ubuntu0.18.04.1

Running firefix, then going to netflix.com and attempting to play a
movie. The widevinecdm plugin crashes, the following is found in
syslog:

Jun 15 19:13:22 xplt kernel: [301351.553043] audit: type=1400 audit(1529046802.585:246): apparmor="DENIED" operation="file_mmap" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/xav/.mozilla/firefox/wiavokxk.default-1510977878171/gmp-widevinecdm/1.4.8.1008/libwidevinecdm.so" pid=16118 comm="plugin-containe" requested_mask="m" denied_mask="m" fsuid=1000 ouid=1000
Jun 15 19:13:22 xplt kernel: [301351.553236] audit: type=1400 audit(1529046802.585:247): apparmor="DENIED" operation="ptrace" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" pid=24714 comm="firefox" requested_mask="trace" denied_mask="trace" peer="/usr/lib/firefox/firefox{,*[^s][^h]}"
Jun 15 19:13:22 xplt kernel: [301351.553259] plugin-containe[16118]: segfault at 0 ip 00007fcdfdaa76af sp 00007ffc1ff03e28 error 6 in libxul.so[7fcdfb77a000+6111000]
Jun 15 19:13:22 xplt snmpd[2334]: error on subcontainer 'ia_addr' insert
...

Fixes: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1777070
Reported-by: Xav Paice <xav.paice@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/684
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2021-02-11 19:38:57 -08:00