Commit graph

1246 commits

Author SHA1 Message Date
John Johansen
32d748ab0f Merge add Dovecot and other mail related profiles
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/644
Acked-by: John Johansen <john.johansen@canonical.com>
2020-10-25 11:22:24 +00:00
John Johansen
1961bb7719 Merge Adjust to support brave in ubuntu abstractions
See Bug-Ubuntu: https://launchpad.net/bugs/1889699

Fixes: https://launchpad.net/bugs/1889699
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/667
Acked-by: John Johansen <john.johansen@canonical.com>
2020-10-25 11:13:43 +00:00
John Johansen
3ff07adda5 Merge Adjust ubuntu-integration to use abstractions/exo-open
see Bug-Ubuntu: https://launchpad.net/bugs/1891338

Fixes: https://launchpad.net/bugs/1891338
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/666
Acked-by: John Johansen <john.johansen@canonical.com>
2020-10-25 11:11:39 +00:00
Christian Boltz
dbb1b900b8 Merge branch 'adjust-for-new-ICEauthority-path-in-run' into 'master'
Adjust for new ICEauthority path in /run

Bug-Ubuntu: https://launchpad.net/bugs/1881357

See merge request apparmor/apparmor!668


Acked-by: Christian Boltz <apparmor@cboltz.de> for 3.0 and master
2020-10-25 10:16:26 +00:00
Jamie Strandboge
1abe101734 Adjust for new ICEauthority path in /run
Bug-Ubuntu: https://launchpad.net/bugs/1881357
2020-10-25 09:56:34 +00:00
Francois Marier
9b30f9306d Adjust to support brave in ubuntu abstractions
Bug-Ubuntu: https://launchpad.net/bugs/1889699
2020-10-25 09:53:44 +00:00
Jamie Strandboge
9ff0bbb69e Adjust ubuntu-integration to use abstractions/exo-open
Bug-Ubuntu: https://launchpad.net/bugs/1891338
2020-10-25 09:48:25 +00:00
John Johansen
6039d1580a Merge abstractions: mesa - tightens cache location and add fallback
This tightens the cache location in @{HOME}/.cache and also adds the tmp fallback location.

Currently there are the following entries in the mesa abstraction:

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/91
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/652
Acked-by: Christian Boltz <apparmor@cboltz.de>
2020-10-25 09:14:40 +00:00
John Johansen
cfc57c08e6 Merge profiles: nscd: service fails with apparmor 3.0.0-2 on Arch Linux
After a recent upgrade of apparmor on Arch Linux the nscd systemd service fails to start. Arch Linux has /var/db/nscd and that path is missing from the profile AFAICT.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/124
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/651
Acked-by: Christian Boltz <apparmor@cboltz.de>
2020-10-25 09:08:06 +00:00
Erick555
81867f9424 profiles/apparmor.d/abstractions/X: make x11 socket writable again
Unfortunately in apparmor sockets need rw access. Currently x11 can only work if abstract socket is available and used instead so those restrictions won't trigger. This partially reverts c7b8368216
2020-10-23 12:22:10 +00:00
FallenWarrior2k
e0b20a4d2f Revert "Merge dnsmasq: Permit access to /proc/self/fd/"
This reverts merge request !628
2020-10-19 20:29:43 +00:00
Kevin Locke
17cb8f0418 Add Fontmatrix to abstractions/fonts
[Fontmatrix] [adds ~/.Fontmatrix/Activated to fonts.conf].  This causes
programs which use [Fontconfig] (directly or indirectly through
libraries such as [pango]) to include that directory in their font
search path, which causes errors such as:

    audit: type=1400 audit(1602678958.525:53): apparmor="DENIED" operation="open" profile="fr.emersion.Mako" name="/home/username/.Fontmatrix/Activated/.uuid" pid=48553 comm="mako" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
    audit: type=1400 audit(1602678958.525:54): apparmor="DENIED" operation="open" profile="fr.emersion.Mako" name="/home/username/.Fontmatrix/Activated/" pid=48553 comm="mako" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

if the program does not explicitly include this directory in its
AppArmor profile.  As with other common font locations, add
~/.Fontmatrix/Activated to the fonts abstraction for read-only access.

[Fontconfig]: https://gitlab.freedesktop.org/fontconfig/fontconfig
[Fontmatrix]: https://github.com/fontmatrix/fontmatrix
[Pango]: https://pango.gnome.org/
[adds ~/.Fontmatrix/Activated to fonts.conf]: https://github.com/fontmatrix/fontmatrix/blob/75552e2/src/typotek.cpp#L1081-L1088

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-10-14 19:45:23 -06:00
Mikhail Morfikov
5aa6db68e0 abstractions: mesa - tightens cache location and add fallback
This tightens the cache location in @{HOME}/.cache and also adds
the tmp fallback location.

Currently there are the following entries in the mesa abstraction:

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/91
Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-10-11 05:08:32 -07:00
glitsj16
821f9fe42d profiles: nscd: service fails with apparmor 3.0.0-2 on Arch Linux
After a recent upgrade of apparmor on Arch Linux the nscd systemd service fails to start. Arch Linux has /var/db/nscd and that path is missing from the profile AFAICT.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/651
Fixes: https://gitlab.com/apparmor/apparmor/-/issues/124
Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-10-11 04:50:49 -07:00
Bernhard M. Wiedemann
bd1e22ad07 profiles: add pyzorsocket and razorsocket
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:26:01 +02:00
Bernhard M. Wiedemann
c343f052c0 profiles: add haproxy
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:26:01 +02:00
Bernhard M. Wiedemann
2eea414c68 profiles: add clamd
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:26:01 +02:00
Bernhard M. Wiedemann
8319bc5dc7 profiles: Add 3 more dovecot services
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:26:01 +02:00
Bernhard M. Wiedemann
286f071259 profile: Allow SSL access to freshclam
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:12:45 +02:00
Bernhard M. Wiedemann
6e908f28d6 profiles: Drop duplicate line
already covered by dovecot-common

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-10-07 20:12:45 +02:00
Anton Nesterov
9b70ef4fb7 Fix dhclient and dhclient-script profiles to work on debian buster 2020-10-06 19:51:07 +00:00
Christian Boltz
6e59f454b1
Add dovecot-script-login profile
... and allow dovecot to Px to it.

The profile is based on a profile I received in a bugreport, with the
actual script factored out. Note that you'll _need_ to add a rule to the
local/ include to allow executing the actual script, but since the
script to execute is configurable, it's basically impossible to add a
default rule for it.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1166007
2020-09-27 16:26:28 +02:00
John Johansen
a680c949af Merge dnsmasq: Permit access to /proc/self/fd/
As of [48755ebf](https://www.openhub.net/p/dnsmasq/commits/1679009518), dnsmasq iterates through directory entries in /proc/self/fd/ to find which file descriptors are open to avoid the potentially costly operation of closing all possible file descriptors.

While the current profile does not make dnsmasq inoperable, this change permits AppArmor users running dnsmasq to avoid falling back on the generic code path.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/628
Acked-by: John Johansen <john.johansen@canonical.com>
2020-09-18 11:20:01 +00:00
John Johansen
9d6db05b52 profiles: update profiles for the new proc attr interfaces
New kernels provide an alternative proc attr interface for apparmor
which is needed for LSM stacking.

Update the remaining profiles that use the old interface to
include access to the new interface.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-09-18 04:07:24 -07:00
FallenWarrior2k
93a3a30ffd
dnsmasq: Permit access to /proc/self/fd/
As of [48755ebf], dnsmasq iterates through directory entries in
/proc/self/fd/ to find which file descriptors are open to avoid the
potentially costly operation of closing all possible file descriptors.

[48755ebf]: https://www.openhub.net/p/dnsmasq/commits/1679009518
2020-09-18 12:56:13 +02:00
John Johansen
1a7d9d9da0 Merge parser: Fix MR625 to emit proc attr access for all situations
MR625 fixed hats not emitting the rule to access the proc interface needed for change_hat, but it broke the rule being emitted for the parent (which used to work).

The proc attr access rule should be emitted for any profile that is a hat OR any profile that contains hats.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/626
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-09-18 10:30:30 +00:00
John Johansen
3328225bd4 abstractions: update change_profile abstraction for stacking patch
LSM stacking adds new interfaces
   /proc/<pid>/attr/apparmor/*

that should be used in preference of the old interface files in
   /proc/<pid>/attr/*

The library has already been updated to use the new path but the
abstraction for change_profile has not so accessing the new interface
in a confined application fails.

Fix this by making the abstraction cover the old and new interfaces.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/626
Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-09-17 19:28:36 -07:00
Christian Boltz
405f05aa5d
Rename postfix.* to postfix-* to match profile names
39ca2adff6 removed the usr.lib.postfix
prefix from the filename, but missed to change the remaining dot to a
"-" to fully match the profile names.
2020-09-15 22:39:47 +02:00
Christian Boltz
d55ca8b624
postfix-master: allow access to postlog socket 2020-09-08 21:50:39 +02:00
Christian Boltz
a1e03860d9
Rename php-fpm profile file to just "php-fpm"
Nice profile names should also result in nice filenames, at least for
new profiles.

Also update the local include filename.
2020-09-08 20:41:58 +02:00
Antonio Russo
8798d44ebe
php-fpm: fix profile name in php-worker
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
2020-09-06 05:26:45 -06:00
John Johansen
0dfb2b28bb Revert "php-fpm: allow only one pid file"
This reverts commit 64ae865675.

On Debian (unstable), the PID file is stored with the 7.4 version:

/run/php/php-fpm.sock
/run/php/php7.4-fpm.pid
/run/php/php7.4-fpm.sock

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/115
Reported-by:  Antonio Russo <www.antonioerusso.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/617
Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-09-05 11:50:27 -07:00
Christian Boltz
39ef7c508f
postfix-common: allow reading icu *.dat
several postfix-* binaries on openSUSE Tumbleweed need to read
/usr/share/icu/[0-9]*.[0-9]*/*.dat.
2020-09-04 23:14:54 +02:00
John Johansen
0dc86bfeb3 profiles: fixup chromium profile
- drop out dated maintenance comment
- cleanup profile name rules, and fix a few broken references
- /usr/lib -> /{usr,}/lib
- lib -> lib{,32,64}

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/611
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-09-03 11:44:19 -07:00
Vincas Dargis
e6dbe3bfd3 nvidia_modprobe: allow creating /dev/nvidia-modeset
On Debian Sid we get this denial:

```
type=AVC msg=audit(1599065006.981:527): apparmor="DENIED"
operation="mknod" profile="nvidia_modprobe" name="/dev/nvidia-modeset"
pid=12969 comm="nvidia-modprobe" requested_mask="c" denied_mask="c"
fsuid=0 ouid=0
```

Update nvidia_modprobe profile to allow creating device file.
2020-09-03 18:20:33 +03:00
John Johansen
eb8f9302aa profiles: Add a hosts_access abstraction
Host files accessed by tcp_wrapper can reference other files, from man
5 hosts.allow

```
A string that begins with a '/' character is treated as a file name. A host name or address is matched if it matches any host name or address pattern listed in the named file. The file format is zero or more lines with zero or more host name or address patterns separated by whitespace. A file name pattern can be used anywhere a host name or address pattern can be used.
```

This means adding a file to hosts requires updating multiple profiles
Add a hosts abstraction so users only have to modify a single location.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/605
Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1864466
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2020-09-01 19:39:59 -07:00
John Johansen
e1ba76375b profiles: Add chromium-browser profile from Ubuntu
Ubuntu is dropping their chromium-browser profile because
chromium-browser has been made a snap on ubuntu. Suck in the profile
upstream as a reference profile for those who want to confine
chromium outside of a snap, and update its includes.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/606
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-08-31 21:56:59 -07:00
John Johansen
cc97494528 Merge Fix access to Fips 140-2 library integrity files
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/595
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2020-08-31 17:41:11 +00:00
John Johansen
33112c324c Merge php-fpm: /run path update and peer name fixes
* fix profile name in signal and change_profile rule
* php-fpm profile: adjust /run paths

Thanks to Darix for pointing out that openSUSE now uses /run/php-fpm/

Also switch to using @{run}.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/601
Acked-by: John Johansen <john.johansen@canonical.com>
2020-08-31 06:48:33 +00:00
Christian Boltz
64ae865675
php-fpm: allow only one pid file
According to Darix, the pid is only in the main config, and it doesn't
make sense to have multiple pid files
2020-08-30 23:24:22 +02:00
Christian Boltz
9892a03270
php-fpm: fix profile name in signal and change_profile rule
Note: the change_profile rule was not really correct and only worked by
accident. We want to specify the target profile, therefore add the '->'.
2020-08-30 22:39:30 +02:00
Christian Boltz
6cf58457d7 Merge branch 'patch-1' into 'master'
Fix /usr/lib/postfix binary paths in postfix+dovecot profiles

See merge request apparmor/apparmor!602

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.12..master
2020-08-30 18:57:11 +00:00
Alexis Grey
04394d0749 Fix /usr/lib/postfix binary paths in postfix+dovecot profiles
This makes it consistent with the other Postfix profiles.
2020-08-30 18:57:11 +00:00
Vincas Dargis
a98a4f734f nvidia_modprobe: allow reading driver parameters
On Debian Sid nvidia_modprobe is not permissive enough:

```
type=AVC msg=audit(1598788812.837:495): apparmor="DENIED"
operation="open" profile="nvidia_modprobe"
name="/proc/driver/nvidia/params" pid=31586 comm="nvidia-modprobe"
requested_mask="r" denied_mask="r" fsuid=0 ouid=0
```

Update profile to all reading /proc/driver/nvidia/params

Fixes Debian bug 969267 [0]

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969267
2020-08-30 19:24:29 +03:00
Christian Boltz
3a4dc1f885
php-fpm profile: adjust /run paths
Thanks to Darix for pointing out that openSUSE now uses /run/php-fpm/

Also switch to using @{run}.
2020-08-28 22:23:13 +02:00
John Johansen
398bb20dfd policy: Provide example and base abi to pin pre 3.0 policy
Provide example rules in parser.conf to pin pre 3.0 policy and
appropriate abi files.

abis for vanilla upstream kernels and outoftree network patched
kernels are provided. With both ABIs dropping v8 support from
advertised by the kernel as 2.x policy/userspace did not support it.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/598
Acked-by: Steve Beattie <steve.beattie@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-08-28 12:57:00 -07:00
Steve Beattie
e463f9ad44
profiles: add FIPS-140-2 lib validation hmac files to abstractions/base
Cryptographic libraries that have had FIPS 140-2 patches applied with
read from and validate themselves against a validation file, which is in
the same directory as the library itself. As an example, A FIPS 140-2
version libgcrypt on x86-64 has the following shared library and hmac file:

  /lib/x86_64-linux-gnu/libgcrypt.so.20.2.1
  /lib/x86_64-linux-gnu/.libgcrypt.so.20.hmac

A similarly named version of libgcrypt + hmac file can be seen for SUSE
systems in:

  https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp2464.pdf

and Red Hat:

  https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp2657.pdf

The libraries provided by FIPS 140-2 compliant versions of OpenSSL also
include this.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/595
2020-08-24 23:06:54 -07:00
John Johansen
345f4eaeff Merge abstractions/gnome: allow /usr/share/gtk-3.0/settings.ini
GTK+ 3 has a global settings file (see https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtksettings.c#L345) that should be readable as well.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/592
Acked-by: John Johansen <john.johansen@canonical.com>
2020-08-20 08:07:11 +00:00
Jonas Witschel
af6fe026e1 abstractions/gnome: allow /usr/share/gtk-3.0/settings.ini
GTK+ 3 has a global settings file that should be readable as well.
2020-08-18 12:28:53 +02:00
Antonio Russo
660ce39937 Add php-fpm isolation with apparmor hats
Adapted from https://nordisch.org/posts/php-fpm-apparmor/, port the
nextcloud-independent portion of the php-fpm worker abstractions and
php-fpm isolation for more general usage.

Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
2020-08-16 12:11:00 -06:00