Commit graph

584 commits

Author SHA1 Message Date
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
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
c68d1b5795 usr.sbin.smbd: new lock dir used by recent versions (4.3.8) 2016-04-13 09:24:46 -04:00
Simon Deziel
245dd9b1b9 usr.sbin.smbd: give access to multiarch libs 2016-04-13 09:23:07 -04:00
Simon Deziel
9e680bd14f usr.sbin.smbd: sys_admin is needed when forcing ownership 2016-04-13 09:20:14 -04:00
Simon Deziel
0255afc67b usr.sbin.smbd: audit_write is needed when forcing perms 2016-04-13 09:19:51 -04:00
Tyler Hicks
184e2f8df8 profiles: Add attach_disconnected flag to dnsmasq profile
https://launchpad.net/bugs/1569316

When Ubuntu made the jump from network-manager 1.0.4 to 1.1.93, the
dnsmasq process spawned from network-manager started hitting a
disconnected path denial:

  audit: type=1400 audit(1460463960.943:31702): apparmor="ALLOWED"
    operation="connect" info="Failed name lookup - disconnected path"
    error=-13 profile="/usr/sbin/dnsmasq"
    name="run/dbus/system_bus_socket" pid=3448 comm="dnsmasq"
    requested_mask="wr" denied_mask="wr" fsuid=65534 ouid=0

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-04-12 16:36:43 -05:00
Simon Deziel
3d6843d975 usr.sbin.dnsmasq: add lxd-bridge rules 2016-04-08 16:23:47 -04:00
Christian Boltz
3e51e656b6 dovecot/auth: allow access to /var/run/dovecot/stats-user
Since the latest openSUSE Tumbleweed update (dovecot 2.2.21 -> 2.2.22),
dovecot/auth writes to /var/run/dovecot/stats-user.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-04-07 00:53:06 +02:00
Simon Deziel
cb011cd974 usr.sbin.sshd: remove commented-out hat related rules 2016-04-05 15:47:54 -04:00
Simon Deziel
3c21cd8a40 usr.sbin.sshd: allow ptrace tracing to cope with recent kernel/AA changes 2016-04-05 15:46:26 -04:00
Simon Deziel
aedce34542 usr.sbin.sshd: add cgroup-related rules 2016-04-05 15:46:05 -04:00
Christian Boltz
86017c770d Update abstractions/ssl_* for acmetool-generated certificates
acmetool is an alternative client for Let's Encrypt.
(https://github.com/hlandau/acme/)

It stores the certificates etc. in the following directory layout:

    /var/lib/acme/live/<domain> -> ../certs/<hash>
    /var/lib/acme/certs/<hash>/cert
    /var/lib/acme/certs/<hash>/chain
    /var/lib/acme/certs/<hash>/privkey -> ../../keys/<hash>/privkey
    /var/lib/acme/certs/<hash>/url
    /var/lib/acme/certs/<hash>/fullchain
    /var/lib/acme/keys/<hash>/privkey

This patch adds the needed permissions to the ssl_certs and ssl_keys
abstractions so that the certificates can be used.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-03-28 21:42:39 +02:00
Christian Boltz
fa35aaa1c4 nscd profile: allow paranoia mode
In /etc/nscd.conf there is an option allowing to restart nscd after a
certain time. However, this requires reading /proc/self/cmdline -
otherwise nscd will disable paranoia mode.


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


Acked-By: Jamie Strandboge <jamie@canonical.com> for trunk, 2.10 and 2.9
2016-03-21 21:30:19 +01:00
Tyler Hicks
c8fe0b2518 profiles: Allow CAP_CHOWN in usr.lib.apache2.mpm-prefork.apache2
https://launchpad.net/bugs/1210514

It looks plausible to me that prefork_open_logs() ->
ap_proc_mutex_create() -> ap_unixd_set_proc_mutex_perms() -> chown().

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2016-03-19 03:10:00 -05:00
Tyler Hicks
f16e6ad89a profiles: Add deluge-{gtk,console} to ubuntu-bittorrent-clients abstraction
https://launchpad.net/bugs/1501913

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2016-03-19 03:08:52 -05:00
Jamie Strandboge
0c6d50b81a profiles/apparmor.d/abstractions/ubuntu-unity7-base: update to use dbus
abstractions instead of repeating the rules here
2016-03-10 16:53:24 -06:00
Christian Boltz
9a0157cffd dovecot-lda profile: allow tempfiles and executing sendmail
dovecot-lda needs to read and write /tmp/dovecot.lda.*.

It also needs to be able to execute sendmail to send sieve vacation
mails.

For now, I'm using a child profile for sendmail to avoid introducing a
new profile with possible regressions. This child profile is based on
the usr.sbin.sendmail profile in extras and should cover both postfix'
and sendmail's sendmail.
I also mixed in some bits that were needed for (postfix) sendmail on my
servers, and dropped some rules that were obsolete (directory rules not
ending with a /) or covered by an abstraction.

In the future, we might want to provide a stand-alone profile for
sendmail (based on this child profile) and change the rule in the
dovecot-lda profile to Px.


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



Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-02-20 01:15:20 +01:00
Jamie Strandboge
8d0d84164b merge from intrigeri
support systems that use libnl-3-200 via libnss-gw-name.

Patch initially proposed by Simon McVittie <smcv@debian.org>.

Bug-Debian: #810888

Acked-By: Jamie Strandboge <jamie@canonical.com>
2016-02-10 10:02:52 -06:00
intrigeri
438ee9df26 abstractions/nameservice: support systems that use libnl-3-200 via libnss-gw-name.
Patch initially proposed by Simon McVittie <smcv@debian.org>.
Closes: Debian#810888
2016-02-10 11:19:04 +01:00
intrigeri
de9c5ed33b abstractions/nameservice: factorize to de-duplicate a bit. 2016-02-10 11:09:24 +01:00
intrigeri
4564d82d52 abstractions/nameservice: support systems with NetworkManager but no resolvconf where /etc/resolv.conf is a symlink to /var/run/NetworkManager/resolv.conf.
Patch proposed by Simon McVittie <smcv@debian.org>.
Closes: Debian#813835
2016-02-10 11:06:38 +01:00
Simon Deziel
1fcdad4f1e usr.sbin.sshd: refresh profile and add libpam-systemd abstractions 2016-01-08 20:43:56 -05:00
Jamie Strandboge
13ee637c55 allow read on /run/systemd/resolve/resolv.conf for systems using networkd
(LP: #1529074)

Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-01-05 17:03:06 -06:00
Christian Boltz
478eed9336 merge https://code.launchpad.net/~sdeziel/apparmor/dnsmasq.d-available/+merge/277075
by Simon Deziel:
  Allow reading conf snippets from /etc/dnsmasq.d-available

Acked-by: Christian Boltz <apparmor@cboltz.de>
2015-12-30 22:23:42 +01:00
Christian Boltz
9e6be07e7d merge https://code.launchpad.net/~intrigeri/apparmor/dnsmasq-better-confine-libvirt-leaseshelper/+merge/267822
from intrigery:
  dnsmasq profile: extract confinement of libvirt_leaseshelper into a dedicated sub-profile.

Acked-by: Christian Boltz <apparmor@cboltz.de>
2015-12-30 22:09:07 +01:00
Jamie Strandboge
c2865a92ae Description: update python abstraction for python 3.
Signed-off-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2015-11-19 08:51:05 -06:00
Christian Boltz
c97fd38b92 syslog-ng profile: allow /run/log/journal/
syslog-ng needs to access both the permanent /var/log/journal/ and the
non-permanent /run/journal/.

I also included /var/run/journal/ to stay consistent with supporting
both /run/ and /var/run/.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-11-11 16:44:47 +01:00
Simon Deziel
a88d86b988 Allow reading conf snippets from /etc/dnsmasq.d-available
Some packages like libvirt-bin and lxc drop conf snippets in /etc/dnsmasq.d-available
and make them available through symlinks in /etc/dnsmasq.d created during postinst.
2015-11-09 20:05:25 -05:00
Christian Boltz
756d622db3 Re-enable check-logprof in profiles 'make check' target
aa-logprof is able to parse all profiles, so there is no longer a
reason to skip this test.

This patch reverts r2097 and r2098 from 2013-01-02.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
(and now that the tests work even if logprof.conf doesn't exist,
Steve's NACK is no longer valid)
2015-10-20 23:42:41 +02:00
Christian Boltz
58782184a4 Change /bin/ paths in profiles to also match on /usr/bin/
oftc_ftw reported on IRC that Arch Linux has a symlink /bin -> /usr/bin.
This means we have to update paths for /bin/ in several profiles to also
allow /usr/bin/


Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
2015-10-20 23:12:35 +02:00
Christian Boltz
2c00e6de9b dnsmasq profile update: allow /dev/tty
This patch is based on a SLE12 patch to allow executing the
--dhcp-script. We already have most parts of that patch since r2841,
except /dev/tty rw which is needed for the shell's stdout and stderr.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=940749 (non-public)


Acked by Seth Arnold on IRC (with "owner" added)
2015-10-16 21:50:21 +02:00
Christian Boltz
807c2dccf0 several additions for the syslog-ng profiles
The latest syslog-ng version needs some more permissions:
- abstractions/openssl (for reading openssl.conf)
- reading /etc/syslog-ng/conf.d/
- reading the journal
- reading /etc/machine-id (it's unclear why this is needed, therefore
  I don't want abstractions/dbus-session-strict for now)
- write access to /run/syslog-ng.ctl

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


Acked-By: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9
2015-10-07 22:18:22 +02:00