Commit graph

866 commits

Author SHA1 Message Date
intrigeri
2cb322ff59 Adjust white-space back to "tabular style" and make one merged-/usr related rule look like the others.
Thanks to Christian Boltz <apparmor@cboltz.de> for noticing these :)
2016-12-07 20:00:06 +01:00
Christian Boltz
e0e3cdd61e abstractions/php: adjust PHP7 paths for openSUSE
openSUSE uses "php7" (not just "php") in several paths, so also allow that.


Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9.
2016-12-07 13:10:45 +01:00
John Johansen
ff80b8c858 Add backwards compatibility php5 abstraction
Signed-off-by: John Johansen <john.johansen@canonical.com>
2016-12-07 02:46:59 -08:00
John Johansen
1ee574deea Update php abstraction
Signed-off-by: kees cook <kees@outflux.net>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-12-07 02:45:32 -08:00
intrigeri
2d3c95ef09 abstractions/base: drop 'ix' for ld-*.so and friends.
This should solve the "overlapping rules with conflicting 'x'
modifiers" problem (introduced with r3594) entirely.

The other options I could think of were:

 * ix → Pix, adjust all profiles that do 'ix' accordingly, and leave
   alone those that do Pix already; downsides: requires updating quite
   a few profiles all around the place, and breaks a mere "file," rule;

 * ix → Pix, adjust all profiles that do 'ix' accordingly, and change
   the "file," rule semantics to imply Pix; downside: very intrusive,
   and likely to break random existing policy in ways that are hard
   to predict;

 * stick to ix, and adjust all profiles that do anything else with
   overlapping rules, to do ix instead; downside: in some cases this means
   removing the 'P' modifier, which can cause regressions in how we confine
   stuff.

I've looked up in the bzr history to understand why execution rights
would be needed, and… the answer predates the move to bzr.
Looking into the SVN history, if it's even available anywhere, is
a bit too much for me, so I've tested this change and the few
applications I've tried did not complain. Of course, more testing will
be needed.
2016-12-03 16:52:47 +01:00
intrigeri
b6aeae70dc abstractions/base: revert ix→Pix.
It simply breaks too much stuff, such as a mere "file," rule.
2016-12-03 16:51:55 +01:00
intrigeri
a8ac2b4ccb abstractions/base: turn remaining ix rules into Pix.
Having consistent x modifiers in this abstraction is needed
to allow profiles including abstractions/base to apply x rules
overlapping with several of the rules from the base abstraction.

E.g. one may need to have rules applying to /**, for example because
a mere "file," conflicts with the ix→Pix change I did in r3596.
2016-12-03 16:03:56 +01:00
intrigeri
b3768dce8d abstractions/base: turn merged-/usr-enabled ix rules into Pix, to avoid conflicts with other profiles.
Example conflicts that are solved by this commit include:

 abstractions/ubuntu-helpers:
  /usr/{,local/}lib*/{,**/}* Pixr,
2016-12-03 14:45:56 +01:00
intrigeri
d73143db0d abstractions/base: drop obsolete rule, supersede by @{multiarch} a while ago.
It causes conflicts in x modifiers when compiling usr.sbin.cupsd.
2016-12-03 13:00:35 +01:00
intrigeri
f9ca24c293 Make policy compatible with merged-/usr. 2016-12-03 10:59:01 +01:00
Steve Beattie
d913f20f48 abstractions/X: yet another location for Xauthority
Add access to /{,var/}run/user/*/X11/Xauthority.

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845250

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-12-01 16:03:37 -08:00
Seth Arnold
dd719db1a9 Add more wayland paths, suggested by Simon McVittie in
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1507469
2016-11-30 15:16:32 -08:00
Christian Boltz
897df9af45 dovecot profile: allow capability sys_resource
On servers with not too much memory ("only" 16 GB), dovecot logins fail:

Nov 25 21:35:15 server dovecot[28737]: master: Fatal: setrlimit(RLIMIT_DATA, 268435456): Permission denied
Nov 25 21:35:15 server dovecot[28731]: master: Error: service(auth): command startup failed, throttling for 2 secs
Nov 25 21:35:15 server dovecot[28737]: auth: Fatal: master: service(auth): child 25976 returned error 89 (Fatal failure)

audit.log messages are:
... apparmor="DENIED" operation="capable" profile="/usr/sbin/dovecot" pid=25000 comm="dovecot" capability=24  capname="sys_resource"
... apparmor="DENIED" operation="setrlimit" profile="/usr/sbin/dovecot" pid=25000 comm="dovecot" rlimit=data value=268435456

After allowing capability sys_resource, dovecot can increase the limit
and works again.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
2016-11-29 21:35:14 +01:00
Christian Boltz
561da60cc7 Update abstractions/gnome with versioned gtk paths
References: https://bugs.debian.org/845005


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9
2016-11-22 00:30:42 +01:00
Christian Boltz
b3d7e84fb2 Allow /var/lib/nscd in abstractions/nameservice and nscd profile
The latest glibc (including nscd) in openSUSE Tumbleweed comes with
    glibc-2.3.3-nscd-db-path.diff: Move persistent nscd databases to
    /var/lib/nscd

This needs updates (adding /var/lib/nscd/) to abstractions/nameservice
and the nscd profile.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9
2016-11-18 20:17:43 +01:00
Christian Boltz
df022e3431 Allow /var/cache/samba/lck/* in abstractions/samba
nmbd, winbindd (and most probably also smbd - but it has a more
permissive profile that already allows this) need rw access to
/var/cache/samba/lck/* on Debian 8.6.

Reported by FLD on IRC.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9
2016-11-18 20:12:43 +01:00
Christian Boltz
cb67bae6b2 Allow "network unspec dgram," in ntpd profile
A while ago, support for "network unspec" was added. However, nobody
updated the ntpd profile (at least not the profile in upstream bzr)
which was the main reason for adding "unspec".

References: https://bugs.launchpad.net/ubuntu/+source/ntp/+bug/1546455
            (the original bugreport about "unspec")

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1009964
            (about the ntpd profile)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
2016-11-15 00:41:53 +01:00
Christian Boltz
25613a43a8 Add m permissions to mlmmj profiles
Newer kernels need m permissions for the binary the profile covers,
so add it before someone hits this problem in the wild ;-)

Also add a note that the mlmmj-recieve profile is probably superfluous
because upstream renamed the misspelled binary.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9
2016-11-09 19:44:35 +01:00
Christian Boltz
17210f21a2 Update mlmmj profiles
This patch updates the mlmmj profiles in the extras directory to the
profiles that are used on lists.opensuse.org now. Besides adding lots
of trailing slashes for directories, several permissions were added.
Also, usr.bin.mlmmj-receive gets added - it seems upstream renamed
mlmmj-recieve to fix a typo.

These profiles were provided by Per Jessen.

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


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-11-08 21:34:15 +01:00
Seth Arnold
dcd2298aec intrigeri@boum.org 2016-11-06 dnsmasq: allow libvirt_leaseshelper "m" permission on itself. 2016-11-07 11:57:08 -07:00
intrigeri
d8278f51ec dnsmasq: allow libvirt_leaseshelper "m" permission on itself.
Without this, on current Debian unstable, libvirt_leaseshelper crashes
when dnsmasq starts it.
2016-11-06 10:48:34 +01:00
intrigeri
ab1d5d2ffd gnome abstraction: grant read access to ~/.config/gtk-3.0/*.
E.g. Totem needs access to ~/.config/gtk-3.0/settings.ini.
2016-11-06 10:23:51 +01:00
Christian Boltz
65ebf07f4b dnsmasq profile: more lxd additions
Besides dnsmasq.leases, dnsmasq.pid needs to be written. Also read
access for some files is needed (currently dnsmasq.raw and
dnsmasq.hosts - using dnsmasq.* makes this more future-proof when
more files get added)

References: https://bugs.launchpad.net/apparmor/+bug/1634199 (again)


Acked-by: John Johansen <john.johansen@canonical.com>

Bug: https://launchpad.net/bugs/1403468
2016-10-21 13:07:14 +02:00
Christian Boltz
01e4927791 Add new dnsmasq.leases location for lxd to dnsmasq profiles
References: https://bugs.launchpad.net/bugs/1634199


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-10-18 13:22:53 +02:00
Christian Boltz
35a17557b8 allow reading /tmp/.X11-unix/* in abstractions/X
This is needed when starting X with "-nolisten local".


References: https://bugs.launchpad.net/apparmor/+bug/1589823


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9
2016-10-14 20:34:09 +02:00
Steve Beattie
af6dad767f Profile abstractions: add wayland/weston abstraction
Merged from intrigeri@boum.org, thanks!

Bug: https://bugs.debian.org/827335
2016-10-14 09:57:42 -07:00
Christian Boltz
051a54889f syslog-ng profile: allow writing *.qf files
These files are needed for disk-based buffering (added in syslog-ng 3.8).
This was reported to me by Peter Czanik, one of the syslog-ng developers.

Note: I'm not sure about adding @{CHROOT_BASE} to this rule, so for now
I prefer not to do it - adding it later is easy, but finding out if it
could be removed is hard ;-)


Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9.
2016-10-13 20:29:17 +02:00
Christian Boltz
8f9d61af1d Add missing permissions to dovecot profiles
- dovecot/auth: allow to read stats-user
- dovecot/config: allow to read /usr/share/dovecot/**
- dovecot/imap: allow to ix doveconf, read /etc/dovecot/ and
  /usr/share/dovecot/**

These things were reported by Félix Sipma in Debian Bug#835826
(with some help from sarnold on IRC)

References: https://bugs.debian.org/835826


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.



Also allow reading ~/.dovecot.svbin (that's the default filename in the
dovecot config) in dovecot/lmtp profile.
(*.svbin files can probably also appear inside @{DOVECOT_MAILSTORE}, but
that's already covered by the existing rules.)

References: https://bugs.debian.org/835826 (again)


Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9
2016-10-05 20:46:03 +02:00
Christian Boltz
196f344270 Allow both paths in traceroute profile
In 2011 (r1803), the traceroute profile was changed to also match
/usr/bin/traceroute.db:
    /usr/{sbin/traceroute,bin/traceroute.db} {

However, permissions for /usr/bin/traceroute.db were never added.
This patch fixes this.


While on it, also change the /usr/sbin/traceroute permissions from
rmix to the less confusing mrix.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-09-30 00:07:26 +02:00
intrigeri
d482d1a26c Include the wayland abstraction from the gnome one.
This is the least invasive solution to the problem I'm trying to solve
right now (Evince not starting in GNOME on Wayland, and probably
similar issues for other GNOME applications I suppose).

At some point, we will probably want to source the wayland abstraction
from other desktop environments' abstractions, or simply from the
X one. Let's come back to it once people using these other desktop
environments on Wayland with AppArmor enabled tell us what policy
change is needed to make it work for them.
2016-09-11 23:03:24 +02:00
intrigeri
c636d1771e Add a basic wayland abstraction.
It's good enough to allow starting Evince in GNOME on Wayland,
on current Debian unstable.

References: https://bugs.debian.org/807880
2016-09-11 23:03:01 +02:00
intrigeri
7870b2c326 gnome abstraction: allow reading file type associations from another place where it can live on Debian.
In Debian, gnome-session (3.20.1-2)'s changelog reads:

    If /etc/gnome/defaults.list was modified by the system administrator,
    the file is moved to /etc/xdg/gnome-mimeapps.list during the upgrade.

So we want to at least support /etc/xdg/gnome-mimeapps.list. And while
we're at it, let's support *-mimeapps.list instead of just gnome-mimeapps.list,
in case other desktop environments or derivatives need such customizations.
2016-08-25 12:12:56 +02:00
Christian Boltz
6d9e55a8a3 winbindd profile: allow dac_override
This is needed to delete kerberos ccache files, for details see
https://bugzilla.opensuse.org/show_bug.cgi?id=990006#c5


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9.
2016-08-03 21:51:54 +02:00
Seth Arnold
36244d4872 add ld.so.preload to <abstractions/base>, thanks to Uzair Shamim 2016-07-29 11:44:17 -07:00
Martin Pitt
f065286d27 Allow dbus-user-session D-Bus path
https://launchpad.net/bugs/1604872

dbus-user-session uses the file based Unix socket in $XDG_RUNTIME_DIR/bus.
Extend the dbus-session-strict abstraction to also allow that.

Acked-by: Tyler Hicks <tyhicks@canonical.com>
2016-07-26 22:49:51 -05:00
Christian Boltz
366b3dfdad Allow mr for /usr/lib*/ldb/*.so in samba abstractions
This is needed for winbindd (since samba 4.4.x), but smbd could also need it.

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


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-07-26 21:12:35 +02:00
Steve Beattie
e69ab01670 profiles: ubuntu-browsers abstraction: support Debian's firefox-esr
Merged from intrigeri@boum.org; thanks!
2016-06-24 11:45:40 -07:00
intrigeri
7c1087b20f ubuntu-browsers abstraction: re-implement Debian's firefox-esr support in a way that does not affect other Firefox browsers. 2016-06-24 17:34:55 +02:00
Seth Arnold
787ced1969 From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Tue, 21 Jun 2016 18:18:45 +0100
Subject: abstractions/nameservice: also support ConnMan-managed resolv.conf

Follow the same logic we already did for NetworkManager,
resolvconf and systemd-resolved. The wonderful thing about
standards is that there are so many to choose from.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-06-22 15:15:49 -07:00
Jamie Strandboge
5a2be35287 profiles: Create abstraction for mozc input method editor
An abstraction to allow mozc clients to connect to the mozc-server.

Signed-off-by: Jamie Strandboge <jamie@ubuntu.com>
[tyhicks: Wrote commit message]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-06-04 00:28:03 -05:00
Jamie Strandboge
140234a408 profiles: Create abstractions for fcitx input method framework
Create a set of strict and non-strict abstractions, much like the
existing dbus abstractions, for connecting to the fcitx bus.

Signed-off-by: Jamie Strandboge <jamie@ubuntu.com>
[tyhicks: Wrote commit message]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-06-04 00:27:59 -05:00
Christian Boltz
08471c5b08 allow inet6 in ping profile
The latest iputils merged ping and ping6 into a single binary that does
both IPv4 and IPv6 pings (by default, it really does both).
This means we need to allow network inet6 raw in the ping profile.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=980596
            (contains more details and example output)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
2016-05-18 21:18:10 +02:00
Seth Arnold
d3774684c0 dbus-session-strict: allow access to the user bus socket
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Wed, 4 May 2016 13:48:36 +0100
Subject: dbus-session-strict: allow access to the user bus socket

If dbus is configured with --enable-user-bus (for example in the
dbus-user-session package in Debian and its derivatives), and the user
session is started with systemd, then the "dbus-daemon --session" will be
started by "systemd --user" and listen on $XDG_RUNTIME_DIR/bus. Similarly,
on systems where dbus-daemon has been replaced with kdbus, the
bridge/proxy used to provide compatibility with the traditional D-Bus
protocol listens on that same socket.

In practice, $XDG_RUNTIME_DIR is /run/user/$uid on all systemd systems,
where $uid represents the numeric uid. I have not used /{var/,}run here,
because systemd does not support configurations where /var/run and /run
are distinct; in practice, /var/run is a symbolic link.

Based on a patch by Sjoerd Simons, which originally used the historical
path /run/user/*/dbus/user_bus_socket. That path was popularized by the
user-session-units git repository, but has never been used in a released
version of dbus and should be considered unsupported.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-05-11 16:01:41 -07:00
Seth Arnold
43cc512e51 Simon Deziel 2016-04-29 usr.sbin.sshd: allow reading blacklisted host keys 2016-04-29 14:55:00 -07:00
Simon Deziel
6bdd2c34dc usr.sbin.sshd: allow reading blacklisted host keys 2016-04-29 14:25:53 -04:00
intrigeri
fdbdf26b33 ubuntu-browsers abstraction: simplify rule.
Thanks to Christian Boltz <apparmor@cboltz.de> for the suggestion!
2016-04-24 19:34:58 +02:00
intrigeri
221a8681c0 ubuntu-browsers abstraction: support path used by Debian's firefox-esr. 2016-04-24 16:24:42 +02:00
Simon Deziel
5931538103 usr.sbin.sshd: deny net_admin that is not strictly required
Matthew Dawson explained why:

> sshd doesn't actually require the net_admin capability. libpam-systemd tries
> to use it if available to set the send/receive buffers size, but will fall
> back to a non-privileged version if it fails.

https://lists.ubuntu.com/archives/apparmor/2016-April/009586.html
2016-04-21 17:58:04 -04:00
Simon Deziel
2829aaf87b abstractions/user-mail: /var/mail/* should only be accessible to their owners 2016-04-14 15:15:36 -04:00
Simon Deziel
bb981d54f0 usr.bin.wireshark: refresh for Xenial
Bug: https://launchpad.net/bugs/1665535
2016-04-13 16:52:32 -04:00