Commit graph

866 commits

Author SHA1 Message Date
John Johansen
330bd6c5f6 abstractions: fix merge conflict resoltion typo
Fix typo introduced when resolving a merge conflict for d9ab83281b
("Add support for local additions to abstractions")

Signed-off-by: John Johansen <john.johansen@canonical.com>
2019-01-24 04:34:03 -08:00
Matthew Garrett
d9ab83281b Add support for local additions to abstractions
Local policy may want to extend or override abstractions, so add support for including local updates to them.

Acked-by: Christian Boltz <apparmor@cboltz.de>
Acked-by: intrigeri <intrigeri@boum.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2019-01-24 03:06:03 -08:00
Marius Tomaschewski
b0bacba9db abstractions/nameservice: allow /run/netconfig/resolv.conf
Latest netconfig in openSUSE writes /run/netconfig/resolv.conf, and only
has a symlink to it in /etc

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1097370
Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2019-01-24 02:43:02 -08:00
Christian Boltz
0199edf8e7
update mysqld profile
This updates the mysqld to what I use on my servers nowadays.
2019-01-24 00:30:34 +01:00
Christian Boltz
5d384d9625 Merge branch 'cboltz-dnsmasq-libvirtd' into 'master'
dnsmasq: allow peer=libvirtd to support named profile

See merge request apparmor/apparmor!304

Acked-by: Eric Chiang <ericchiang@google.com> for 2.12..master
2019-01-22 22:23:59 +00:00
Vincas Dargis
b5be596460 mesa: allow reading drirc.d
Recent Mesa update introduces new denies:

```
type=AVC msg=audit(1547905564.212:523): apparmor="DENIED"
operation="open" profile="supertuxkart" name="/usr/share/drirc.d/"
pid=15740 comm="supertuxkart" requested_mask="r" denied_mask="r"
fsuid=1000 ouid=0
```

```
type=AVC msg=audit(1547905896.307:548): apparmor="DENIED"
operation="open" profile="supertuxkart"
name="/usr/share/drirc.d/00-mesa-defaults.conf" pid=15963 c
omm="supertuxkart" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
```

Add rule to allow reading newly required paths.
2019-01-19 15:55:58 +02:00
Christian Boltz
027dcdb23f Merge branch 'fix-compose-cache' into 'master'
qt5-compose-cache-write: fix anonymous shared memory access

See merge request apparmor/apparmor!301

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2019-01-14 20:51:10 +00:00
Christian Boltz
3e3c90152f Merge branch 'fix-qt5-settings' into 'master'
qt5-settings-write: fix anonymous shared memory access

See merge request apparmor/apparmor!302

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2019-01-14 20:48:21 +00:00
Vincas Dargis
8f6a8fb194 Refactor qt5-settings-write
Merge symlink rules together with `rw` rules for brevity.
2019-01-14 19:23:49 +02:00
Christian Boltz
20fe099ced
dnsmasq: allow peer=libvirtd to support named profile
The /usr/sbin/libvirtd profile will get a profile name ("libvirtd").

This patch adjusts the dnsmasq profile to support the named profile in
addition to the "old" path-based profile name.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1118952#c3
2019-01-13 17:38:09 +01:00
Vincas Dargis
73f01196bb audio: Fix alsa settings access
OpenAL application on Debian Buster produces deny message:
```
type=AVC msg=audit(1547295526.633:732): apparmor="DENIED"
operation="open" profile="supertuxkart" name="/etc/alsa/conf.d/"
pid=13963 comm="supertuxkart" reque
sted_mask="r" denied_mask="r" fsuid=1000 ouid=0
```

Add file rule to allow reading Alsa configuration files.
2019-01-12 14:23:28 +02:00
Vincas Dargis
f1200873b8 qt5-settings-write: fix anonymous shared memory access
*Add anonymous shared memory access rule for QtSettings.conf file
itself.
* Reduce strictness of anonymous shared memory file names - numbers in
them can be smaller or bigger.
* Fix consistency - require anonymous shared memory file names to end
with digit in all rules.
2019-01-12 12:50:19 +02:00
Vincas Dargis
1250402471 qt5-compose-cache-write: fix anonymous shared memory access
Qt5 applications produces deny message when saving compose cache files:

```
type=AVC msg=audit(1547287756.436:198): apparmor="DENIED"
operation="link" profile="qtox"
name="/home/vincas/.cache/qt_compose_cache_little_endian_4982ae57498642c5997565013f7ffe4e"
pid=2878 comm="qtox" requested_mask="l" denied_mask="l" fsuid=1000
ouid=1000 target="/home/vincas/.cache/#919806"
```

Add file rule to enable writing anonymous shared memory file.
2019-01-12 12:34:22 +02:00
intrigeri
a91d199ab1 Make tunables/share play well with aliases.
This reverts commit aa3022208f.

Space-separated list of values don't play well with aliases.
For example, in Tails, despite this alias rule:

  alias / -> /lib/live/mount/rootfs/*.squashfs/,

… the Tor Browser profile denies access to
/lib/live/mount/rootfs/filesystem.squashfs/usr/share/mime/mime.cache, which
should be equivalent to /usr/share/mime/mime.cache. That's fixed by using
alternations instead; too bad they're less readable.

Possibly related:
https://bugs.launchpad.net/apparmor/+bug/888077
https://bugs.launchpad.net/apparmor/+bug/1703692
https://bugs.launchpad.net/apparmor/+bug/1703692
2019-01-07 12:58:56 +00:00
Simon Deziel
04b2842e1c abstractions/ssl_{certs,keys}: allow reading ocsp.der maintained by dehydrated for OCSP stapling
Signed-off-by: Simon Deziel <simon@sdeziel.info>
2019-01-03 08:31:06 -05:00
Simon Deziel
c5a89d5daf abstractions/ssl_{certs,keys}: sort the alternation for dehydrated and drop the "-" from the filenames
Signed-off-by: Simon Deziel <simon@sdeziel.info>
2019-01-03 08:29:21 -05:00
Simon Deziel
1306f9a64d abstractions/ssl_{certs,keys}: dehydrated uses /var/lib on Debian
Signed-off-by: Simon Deziel <simon@sdeziel.info>
2019-01-02 19:33:19 -05:00
John Johansen
e0ed9c2cae Merge branch 'EmersonBernier/socket_read-only' into 'master'
profiles/apparmor.d/abstractions/X: make x11 socket read-only

Write access isn't needed for connecting to x11 socket. Also clear some duplicate and redundant rules in other abstractions.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/281

Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-21 11:44:04 +00:00
Petr Vorel
55dc6b3e57 dhcpd: Support correct path for lease file on IPv6
/var/lib/dhcp/dhcpd6.leases path for lease file on IPv6 has been in
dhcp repository since 2008, now visible in commit 8dea7ba7 ("Add DHCPv6
files in configure").

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2018-12-18 01:38:55 +01:00
Petr Vorel
bca66f5064 dhclient: Add path for Fedora/RHEL/CentOS/Oracle Linux
These distros use non-standard paths [1] since dhcp 4.0 in 2008
(commits in fedora pkg: 82186fd and c3b67cd)

[1] https://src.fedoraproject.org/cgit/rpms/dhcp.git/tree/dhcp.spec#n389

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2018-12-18 01:38:43 +01:00
Petr Vorel
ce6c3c3505 dhclient: Support correct path for lease file on IPv6
/var/lib/dhcp/dhclient6.leases path for lease file on IPv6 has been in
dhcp repository since 2008, now visible in commit 8dea7ba7 ("Add DHCPv6
files in configure").
Adding it via extending dhclient-*.leases pattern.

Not sure whether /var/lib/dhcp6/dhclient.leases was ever used on Linux,
but keep in for backward compatibility.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2018-12-18 00:45:54 +01:00
Emerson Bernier
c7b8368216 profiles/apparmor.d/abstractions/X: make x11 socket read-only
Write access isn't needed for connecting to x11 socket. Also
clear some duplicate and redundant rules in other abstractions.
2018-12-08 13:52:03 +01:00
John Johansen
bf58767724 Merge branch 'cboltz-dovecot-dumpable' into 'master'
dovecot: allow reading /proc/sys/fs/suid_dumpable

This is needed if a dovecot child process segfaults - in this case, dovecot provides a helpful error message like

dovecot[6179]: auth-worker: Fatal: master: service(auth-worker): child 8103 killed with signal 11 (core not dumped - https://dovecot.or /bugreport.html#coredumps - set /proc/sys/fs/suid_dumpable to 2)

which involves reading the current value in suid_dumpable.

I propose this fix for 2.10..master.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/286
Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-08 08:31:21 +00:00
John Johansen
99d1865462 Merge branch 'couple-more-for-private-files' into 'master'
deny ~/.mutt** in private-files and audit deny ~/.aws in private-files-strict

PR: https://gitlab.com/apparmor/apparmor/merge_requests/276
Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-08 06:57:07 +00:00
Petr Vorel
49848b9081
dnsmasq: Add pid file used by NetworkManager
Signed-off-by: Petr Vorel <pvorel@suse.cz>
2018-12-07 23:42:53 +01:00
Petr Vorel
3ef8df6ac0
dnsmasq: Adjust pattern for log files to comply SELinux
i.e. move '*' from beginning to before suffix.

Commit 025c7dc6 ("dnsmasq: Add permission to open log files") added
pattern, which is not compatible with SELinux. As this pattern has been
in SELinux since 2011 (with recent change to accept '.log' suffix +
logrotate patterns which are not relevant to AppArmor) IMHO it's better
to adjust our profile.

Fixes: 025c7dc6 ("dnsmasq: Add permission to open log files")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2018-12-07 23:40:19 +01:00
Christian Boltz
2202a8a267
dovecot: allow reading /proc/sys/fs/suid_dumpable
This is needed if a dovecot child process segfaults - in this case,
dovecot provides a helpful error message like

dovecot[6179]: auth-worker: Fatal: master: service(auth-worker): child 8103 killed with signal 11 (core not dumped - https://dovecot.org/bugreport.html#coredumps - set /proc/sys/fs/suid_dumpable to 2)

which involves reading the current value in suid_dumpable.
2018-12-06 18:12:25 +01:00
Christian Boltz
0a666b8e48 Merge branch 'certbot' into 'master'
Add /etc/letsencrypt/archive to ssl_key abstraction

See merge request apparmor/apparmor!283

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2018-11-30 15:44:13 +00:00
Julian Andres Klode
4c85a7ec9e profiles/postfix-smtpd: Include ssl_certs, ssl_keys
This is needed for serving TLS.
2018-11-30 14:43:29 +01:00
Julian Andres Klode
b858428dd1 profiles/postdrop: Allow reading from pickup socket 2018-11-30 14:38:57 +01:00
Julian Andres Klode
d1ab0a021e profiles/postfix-pickup: Allow reading from cleanup socket 2018-11-30 14:33:45 +01:00
Julian Andres Klode
60d203b622 postfix.local: Minor adjustments to make it work
This connects queue manager to local.
2018-11-30 14:30:13 +01:00
Julian Andres Klode
02528133d2 postfix.*: Adapt for new queue names, and extra locking and r/w communication
This gets us to the local process now, which comes next.
2018-11-30 14:24:43 +01:00
Julian Andres Klode
3d842ddb82 postifx-common: Allow access to dynamicmaps, most seems to use it 2018-11-30 14:23:56 +01:00
Julian Andres Klode
e8841a0953 postfix.tlsmgr: Connect to urandom and prng exchange 2018-11-30 14:23:34 +01:00
Julian Andres Klode
f4bfd78164 postfix.master: Change path of child processes 2018-11-30 14:22:58 +01:00
Julian Andres Klode
cb46878644 Add /etc/letsencrypt stuff to ssl_keys/ssl_certs abstraction
`/etc/letsencrypt/live/` contains symlinks to
`/etc/letsencrypt/archive/` which contains the keys. Add the
certs to ssl_certs and the private keys to ssl_keys.
2018-11-30 14:02:16 +01:00
Steve Beattie
9943da2f52
profiles/postfix: add locking perm to pid files
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
dd4903efc6
profiles/postfix: eliminate some redundant rules
Remove rules covered by the postfix-common or other abstractions.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
889503f623
profiles: add a postfix dnsblog profile
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
1c9459825a
profiles: add a postfix postscreen profile
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
35d84895fe
profiles/postfix-master: grant signal+unix communication with children
Grant the ability to communicate with the postfix named child profiles
via signals and unix sockets. Include the path-based match names as
a fallback on upgrades.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
39ca2adff6
profiles/postfix: use named profiles
Convert all the postfix subprocesses to using named profiles instead of
path match profiles, and adjust exec paths for newer debian/ubuntu
releses. Rename profiles to match profile names.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
01648c6a61
profiles/postfix-master: use profile name instead of match pattern
Convert postfix's master profile to use a named profile
(postfix-master) rather than the exec path match pattern. Adjust
postfix-common abstraction to take this into account. Rename profile
name in the profiles/apparmor/profiles/extras/ directory to match
the profile name.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:52 -08:00
Jamie Strandboge
170e8d6ac8 deny ~/.mutt** in private-files and audit deny ~/.aws in private-files-strict
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
2018-11-19 16:13:57 -06:00
Vincas Dargis
2438179b76 Use @{sys} tunable in profiles and abstractions
Commit aa06528790 made @{sys} tunable
available by default.

Update profiles and abstractions to actually use @{sys} tunable for
better confinement in the future (when @{sys} becomes kernel var).

Closes LP#1728551
2018-11-08 20:04:46 +02:00
Christian Boltz
f74edd5d5a
allow locking /etc/aliases.db
This is needed for "newaliases" on current openSUSE Tumbleweed / postfix 3.3.1
2018-10-25 20:59:25 +02:00
Christian Boltz
fd68a5eb64 Merge branch 'cboltz-profile-names' into 'master'
Add profile names to all profiles with {bin,sbin} attachment

See merge request apparmor/apparmor!242

Acked-by: intrigeri <intrigeri@debian.org>
2018-10-21 10:34:59 +00:00
Vincas Dargis
dc7ae28de0 profiles/Makefile: test abstractions against apparmor_parser
Update Makefile to test abstractions by generating temporary profile, to
check for missing (not backported) abstractions or other issues.
2018-10-17 20:05:51 +03:00
Christian Boltz
b77116e6af
Add profile names to all profiles with {bin,sbin} attachment
Also adjust the signal rules in the dovecot-common and apache2-common
abstractions to match the profile names, and to really do that
(peer=...{bin,sbin}... didn't work, the correct syntax would have been
peer=...\{bin,sbin\}...)

This fixes the regression introduced by !149 / commit
4200932d8f
2018-10-15 20:57:33 +02:00