Commit graph

4927 commits

Author SHA1 Message Date
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
fad38ca93f Merge branch 'make-tunables-share-play-well-with-aliases' into 'master'
Make tunables/share play well with aliases

See merge request apparmor/apparmor!300
2019-01-09 17:49:53 +00: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
Christian Boltz
a772ee0f8b Merge branch 'EmersonBernier/shellcheck' into 'master'
parser/apparmor.systemd: fix minor issues detected by shellcheck

See merge request apparmor/apparmor!293

Acked-by: Christian Boltz <apparmor@cboltz.de> for master and 2.13
2019-01-03 17:41:56 +00:00
Christian Boltz
1f53de174d Merge branch 'var-lib-dehydrated' into 'master'
abstractions/ssl_{certs,keys}: dehydrated uses /var/lib on Debian

See merge request apparmor/apparmor!299

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2019-01-03 17:32:51 +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
Christian Boltz
ed692337a5
Drop get_profile_filename() from logparser.py
This function is unused since the last commit.
2019-01-02 20:42:57 +01:00
Christian Boltz
03ea5b82b7
drop failing corner-case check in logparser.py
aa-logprof errors out if it hits a log event for a non-existing profile
while a profile file with the default filename for that non-existing
profile exists. This can for example happen after adding a profile name
to a profile if audit.log still contains events for the attachment-based
profile name.

Since we ignore log events for non-existing profiles in general, drop
the code for the special case "but a file matching the default filename
for that non-existing profile exists" and also silently ignore events
for this very special non-existing profile.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1120472
2019-01-02 20:30:54 +01:00
intrigeri
775835db64 Fix is_apparmor_present() regression which breaks the Debian initscript.
Commit 0d5ab43d59 removed support for loading
modules and introduced a caller, in apparmor_start(), that passes no argument to
is_apparmor_present(), which breaks that function when /bin/sh → /bin/dash.

Passing a module name as argument does not make sense since we dropped support
for the long obsolete "subdomain" module, so let's simplify
is_apparmor_present() and adjust its callers accordingly.

Bug-Debian: https://bugs.debian.org/917874
2019-01-01 17:55:48 +00:00
intrigeri
1bd401bb35 Stop looking for apparmor.conf.
As per the discussion that starts at
https://gitlab.com/apparmor/apparmor/merge_requests/252#note_125983293,
apparmor.conf was never documented nor explicitly supported.
It's not really clear what problem it was meant to solve.
2018-12-28 16:34:17 +00:00
intrigeri
93f0c2d9ca Don't call the obsolete configure_owlsm function.
It was removed in commit 94ff870f.
2018-12-28 16:27:58 +00:00
intrigeri
3b997c79b4 Don't try to list files in a non-existent directory.
Thanks to Jamie Strandboge for spotting this during review.
2018-12-27 17:54:11 +00:00
intrigeri
10ba242b89 Make control flow clearer.
Let's add a safety net if we ever add another return code to skip_profile.
2018-12-27 17:46:43 +00:00
Emerson Bernier
b3937d19a4 parser/apparmor.systemd: fix minor issues detected by shellcheck 2018-12-21 19:50:10 +01: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
Jamie Strandboge
ec7d8ba11e Merge branch 'fix-dhclient-dhcpd-lease-on-ipv6' into 'master'
Fix dhclient dhcpd lease on IPv6

See merge request apparmor/apparmor!291
2018-12-18 14:22:39 +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
Eric Chiang
ccb1b01da7 Merge branch 'cboltz-xattr-cleanprof' into 'master'
Add a test profile with xattrs=... to cleanprof tests

See merge request apparmor/apparmor!289
2018-12-17 18:31:40 +00:00
intrigeri
5865d01449 Remove dead code.
Since 04eb2fe3, __parse_profiles_dir can only return 0 or 1, so $STATUS can only
be 0 or 1, so trying to reset this variable to 0 when its value is 2 can only
cause confusion.
2018-12-16 21:05:06 +00:00
intrigeri
45bc0b8eb7 Merge remote-tracking branch 'origin/master' into prepare-rc.apparmor.functions-for-Debian-and-Ubuntu 2018-12-16 20:36:53 +00:00
Christian Boltz
274132ee6c
Add a test profile with xattrs=... to cleanprof tests 2018-12-09 20:54:41 +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
718744b122 Merge branch 'cboltz-re_flags' into 'master'
Split out RE_FLAGS

... instead of having it duplicated in RE_PROFILE_HAT_DEF and RE_PROFILE_START.

Note that the flags=... handling in RE_PROFILE_HAT_DEF was more/too
strict (for example it didn't allow whitespace around the "="), so this
change also qualifies as a little bugfix.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/287
Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-08 08:37:18 +00: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
dedf977d01 Merge branch 'cboltz-ignore-orig-rej' into 'master'
Ignore *.orig and *.rej files when loading profiles

This was "accidently" reported by Ralph on the opensuse-support
mailinglist.

I propose this for 2.10..master (I verified that 2.10 tools and libapparmor have *.orig and *.rej in the ignore list)

PR: https://gitlab.com/apparmor/apparmor/merge_requests/282
Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-08 08:15:23 +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
John Johansen
8441a42c51 Merge branch 'cboltz-drop-activate_repo_profiles' into 'master'
Drop unused activate_repo_profiles()

PR: https://gitlab.com/apparmor/apparmor/merge_requests/274
Acked-by: John Johansen <john.johansen@canonical.com>
2018-12-08 06:55:49 +00:00
John Johansen
67d7cd0ab0 Merge branch 'cboltz-dnsmasq' into 'master'
dnsmasq profile updates by Petr Vorel

This merge request includes two dnsmasq profiles Petr Vorel sent to the mailinglist:

dnsmasq: Add pid file used by NetworkManager
dnsmasq: Adjust pattern for log files to comply SELinux

I propose these patches for 2.11..master.

I'm not against also backporting to 2.10, but the profile in 2.10 doesn't allow to write anything in /var/log/, so either we apply/backport the changes manually, or we rely on the fact that we didn't get any bugreports for it ;-) Oh, and since I'm only forwarding these patches, I'll already add

Acked-by: Christian Boltz apparmor@cboltz.de for 2.11..master
Acked-by: John Johansen <john.johansen@canonical.com>

PR: https://gitlab.com/apparmor/apparmor/merge_requests/288
2018-12-08 06:24:32 +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
0d830fae31
Split out RE_FLAGS
... instead of having it duplicated in RE_PROFILE_HAT_DEF and
RE_PROFILE_START.

Note that the flags=... handling in RE_PROFILE_HAT_DEF was more/too
strict (for example it didn't allow whitespace around the "="), so this
change also qualifies as a little bugfix.
2018-12-06 22:02:01 +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
aa1e8bd55d Merge branch 'utils-xattrs' into 'master'
utils: add support to tools for profiles with xattrs

See merge request apparmor/apparmor!285

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-12-06 13:15:49 +00:00
Eric Chiang
fde015435a utils: add support to tools for profiles with xattrs
Signed-off-by: Eric Chiang <ericchiang@google.com>
2018-12-05 19:22:32 -08:00
Steve Beattie
40449fdd27
Make coverity: do all compiles as one scan-build run
In fed101920b, the coverity build process
was modified to split out the build logs into separate files, instead of
having one log file that gets overwritten repeatedly, making failures
hard to debug.

However, the coverity service gets upset if there is no file named with
the expected build log name. Therefore, instead, we'll capture the
python bits first, and then capture all the compilation bits in one
cov-build command.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/273
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-11-30 12:23:39 -08: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
Christian Boltz
869f98a2a4 Merge branch 'postfix-profiles' into 'master'
Postfix profile updates

See merge request apparmor/apparmor!284

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-11-30 14:20:51 +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