Commit graph

804 commits

Author SHA1 Message Date
Steve Beattie
237fc59ba8 user abstractions: fix for non-latin file/directory names
Merge from Vincas Dargis, approved by intrigeri
Fix user-write and user-download abstractions for non-latin file names.

Acked-by: Steve Beattie <steve@nxnw.org>
2017-08-09 12:46:04 -07:00
Steve Beattie
cfe2854740 traceroute profile: support TCP SYN for probes, quite net_admin request
Merge from Vincas Dargis, approved by intrigeri.
fix traceroute denies in tcp mode

Acked-by: Steve Beattie <steve@nxnw.org>
2017-08-09 08:57:36 -07:00
Jamie Strandboge
77c2e27e6c abstractions/ubuntu-browsers: support Debian's Firefox non-ESR path.
The updated rule covers the old-style /usr/lib/firefox/firefox.sh
wrapper and the current /usr/lib/firefox{,-esr}/firefox{,-esr} paths.

It is a tiny bit wide but let's lean on the side of compatibility with
whatever similar paths are used in the future. It doesn't grant access
to anything we don't want on a current Debian sid system.
2017-08-08 07:53:22 -05:00
intrigeri
cc5a23d4c1 ubuntu-browsers, ubuntu-helpers: support Debian's Chromium paths. 2017-08-07 17:03:05 -04:00
intrigeri
ff66ca9039 abstractions/ubuntu-browsers: support Debian's Firefox non-ESR path.
The updated rule covers the old-style /usr/lib/firefox/firefox.sh
wrapper and the current /usr/lib/firefox{,-esr}/firefox{,-esr} paths.

It is a tiny bit wide but let's lean on the side of compatibility with
whatever similar paths are used in the future. It doesn't grant access
to anything we don't want on a current Debian sid system.
2017-08-07 15:31:19 -04:00
Steve Beattie
0e6a9c54f2 abstractions/gnome: allow reading GLib schemas.
Merge from intrigeri based on original work by Cameron Norman.

Acked-by: Steve Beattie <steve@nxnw.org>
2017-08-07 10:37:50 -07:00
Steve Beattie
c519a1a9c1 wayland abstraction: allow wayland-cursor-shared-*
Merge from intrigeri.

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870807
Acked-by: Steve Beattie <steve@nxnw.org>
2017-08-07 10:26:13 -07:00
Christian Boltz
c086d280b9 update netstat profile
- allow reading @{PROC}/@{pid}/net/netstat and @{PROC}/@{pid}/net/snmp
- drop owner conditional - /proc/*/net/* is always owned by root, and
  the owner conditional means breaking netstat for non-root users
- drop "@{PROC}/@{pids}/fd r," - /proc/*/fd is a directory, so this rule
  would never apply


Acked-by: Steve Beattie <steve@nxnw.org>


Addition by Steve Beattie:
- also allow @{PROC}/@{pid}/net/udplite and  @{PROC}/@{pid}/net/udplit6


Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-08-07 18:05:09 +02:00
intrigeri
2d6fa07fd5 wayland abstraction: allow wayland-cursor-shared-* (Closes: Debian#870807). 2017-08-05 09:47:27 -04:00
Christian Boltz
e038b0fcff Remove duplicate rule from userdel profiles
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-07-28 12:51:50 +02:00
Jamie Strandboge
9f7eab039a Adjust python abstraction for python3.6
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-07-26 15:05:25 -05:00
Cameron Norman
52d41feeaf Merged two rule groups 2017-07-03 12:50:38 -07:00
Vincas Dargis
5b5da2b010 fix traceroute denies in tcp mode 2017-07-03 19:44:14 +03:00
intrigeri
89c0051304 abstractions/gnome: allow reading GLib schemas.
Based on Cameron Norman's initial work
(http://bazaar.launchpad.net/~cameronnemo/apparmor/gnome-abstraction/revision/3111) with the following changes:

 * don't include GTK+ 3.0 configuration: already done earlier
 * generalize to future GLib versions
 * support /usr/local
 * allow reading the parent directory as well, following the lead
   of usr.lib.telepathy: this is harmless and could be needed in some cases.
2017-07-03 09:44:43 +02:00
Christian Boltz
713b0d2b80 merge Jason Hennessey 2017-02-17 * Fix LP: #1665535 - Enable camera access in browser apparmor profile for WebRTC
https://code.launchpad.net/~henn/apparmor/fix-for-1665535/+merge/317680


Approved by Jamie Strandboge and intrigeri.

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-07-02 11:47:08 +02:00
Vincas Dargis
5d516bb4a9 fix user-write abstraction for non-latin file names 2017-07-02 12:22:21 +03:00
Christian Boltz
7360781a8f dovecot profile: add the attach_disconnected flag
Reported by pfak on IRC

[...] apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/dovecot" name="run/systemd/journal/dev-log" pid=20313 comm="dovecot" requested_mask="w" denied_mask="w" fsuid=0 ouid=0


Acked-by <timeout> for 2.9, 2.10, 2.11 and trunk.
2017-06-29 22:53:40 +02:00
Jamie Strandboge
e475e2d0b1 Author: Jamie Strandboge <jamie@canonical.com>
Description: adjust the multiarch alternation rule in the perl abstraction for
 modern Debian and Ubuntu systems which store some modules under the
 architecture-specific perl-base directory instead of perl or perl5.

Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
2017-06-26 14:04:52 -05:00
Vincas Dargis
c6386bb654 fix user_download abstraction for non-latin file names 2017-06-24 18:12:22 +03:00
Jamie Strandboge
4b3888751a don't var/ alternation with systemd 2017-05-03 16:04:05 -05:00
Jamie Strandboge
0699034db4 The base abstraction already allows write access to
/run/systemd/journal/dev-log but journald offers both:
- a native journal API at /run/systemd/journal/socket (see sd_journal_print(4))
- /run/systemd/journal/stdout for connecting a program's output to the journal
  (see systemd-cat(1)).

In addition to systemd-cat, the stdout access is required for nested container
(eg, LXD) logs to show up in the host. Interestingly, systemd-cat and LXD
containers require 'r' in addtion to 'w' to work. journald does not allow
reading log entries from this socket so the access is deemed safe.

Signed-off-by: Jamie Strandboge <jamie@canonical.com>
2017-04-27 08:28:46 -05:00
Simon McVittie
1b15425ea3 abstractions/base: Allow sysconf(_SC_NPROCESSORS_CONF)
glibc implements this by doing a readdir() and filtering.
We already allowed sysconf(_SC_NPROCESSORS_ONLN), which is
basically a read from /sys/devices/system/cpu/online.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-04-12 18:35:10 +01:00
Christian Boltz
68cba4fe27 update dovecot-lda profile
dovecot-lda needs
- the attach_disconnected flags
- read access to /usr/share/dovecot/protocols.d/
- rw for /run/dovecot/auth-userdb

References: https://bugs.launchpad.net/bugs/1650827


Acked-by: Steve Beattie <steve@nxnw.org> for 2.9, 2.10 and trunk.
2017-04-07 00:12:53 +02:00
Olivier Tilloy
71566d36e3 Specify device nodes instead of being too permissive. 2017-03-06 19:59:43 +01:00
Olivier Tilloy
fe421f6952 Update nvidia abstraction for newer nvidia drivers. 2017-03-06 19:46:43 +01:00
Jason Hennessey
7c50b9f2eb * Fix LP: #1665535 - Enable camera access in browser apparmor profile for WebRTC 2017-02-17 20:42:19 +00:00
Christian Boltz
2eee4d6acb Dovecot profile: change Px to mrPx for /usr/lib/dovecot/*
Some of the /usr/lib/dovecot/* rules already have mrPx permissions,
while others don't.

With a more recent kernel, I noticed that at least auth, config, dict,
lmtp, pop3 and ssl-params need mrPx instead of just Px (confirmed by the
audit.log and actual breakage caused by the missing mr permissions).

The mr additions for anvil, log and managesieve are just a wild guess,
but I would be very surprised if they don't need mr.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2017-01-30 20:43:47 +01:00
Christian Boltz
04240fe6de Dovecot profile update
Add several permissions to the dovecot profiles that are needed on ubuntu
(surprisingly not on openSUSE, maybe it depends on the dovecot config?)

As discussed some weeks ago, the added permissions use only /run/
instead of /{var/,}run/ (which is hopefully superfluous nowadays).


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


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2017-01-26 21:41:38 +01:00
Kees Cook
2c4119d98c glibc uses /proc/*/auxv and /proc/*/status files, too
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-01-20 17:01:50 -08:00
Kees Cook
2e3a871b11 Apache2 profile updates for proper signal handling, optional saslauth,
and OCSP stapling

Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-01-20 16:58:46 -08:00
Christian Boltz
dd27256bb3 sshd profile: drop local/ include
The local/ include in the sshd profile in extras causes some trouble:
- it breaks "make check" because the parser can't find the local/ file
- it results in a broken profile if someone uses this profile as
  starting point, but doesn't notice it needs the local include


Acked-by: Steve Beattie <steve@nxnw.org>
2017-01-12 22:01:11 +01:00
Christian Boltz
67b75e84d0 Update /etc/cron.daily/logrotate profile
Thanks to Daniel Curtis for working on this!


Acked-by: Seth Arnold <seth.arnold@canonical.com> for whichever branches
it makes sense for

-> trunk (includes 2.11) only - if we want it in 2.10 and 2.9, we'll
   also need to backport the usrMerge changes
2017-01-11 18:34:37 +01:00
Christian Boltz
49fe1f712c Update dovecot profiles
The dovecot/auth profile needs access to /run/dovecot/anvil-auth-penalty
and /var/spool/postfix/private/auth.

The dovecot/log profile needs the attach_disconnected flag.

Refences: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1652131


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-12-27 17:46:07 +01:00
Christian Boltz
444dbb4a23 Update nmbd profile and abstractions/samba
nmbd needs some additional permissions:
- k for /var/cache/samba/lck/* (via abstractions/samba)
- rw for /var/cache/samba/msg/ (the log only mentioned r, but that
  directory needs to be created first)
- w for /var/cache/samba/msg/* (the log didn't indicate any read access)

Reported by FLD on IRC, audit log on https://paste.debian.net/902010/



Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
2016-12-13 22:16:00 +01:00
Steve Beattie
106396289a build: make documentation at tarball creation time, not during build
The latex based techdoc in the parser/ tree adds a number of build
dependencies for downstreams to create it; it also is the primary
element to make the builds unrepeatable. Creating the techdoc and other
documentation when generating a tarball for distribution avoids all
that.

* Makefile: build documentation as part of the tarball creation. Skip
  the libraries/libapparmor directory as it needs to have configure run
  before the manpages can be made.
* changehat/mod_apparmor/Makefile, changehat/mod_apparmor/Makefile,
  utils/Makefile, profiles/Makefile: create separate docs target,
  some of them dummies.
* parser/Makefile: pull the techdoc out of the default build target, add
  an extra_docs target to create it.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-12-10 10:25:31 -08:00
Christian Boltz
5bdf25816d update lots of profiles for usrMerge
Merge lp:~intrigeri/apparmor/usrMerge:
  intrigeri@boum.org 2016-12-07 Adjust white-space back to "tabular style" and make one merged-/usr related rule look like the others.
  intrigeri@boum.org 2016-12-03 abstractions/base: drop 'ix' for ld-*.so and friends.
  intrigeri@boum.org 2016-12-03 abstractions/base: revert ix→Pix.
  intrigeri@boum.org 2016-12-03 abstractions/base: turn remaining ix rules into Pix.
  intrigeri@boum.org 2016-12-03 abstractions/base: turn merged-/usr-enabled ix rules into Pix, to avoid conflicts with other profiles.
  intrigeri@boum.org 2016-12-03 abstractions/base: drop obsolete rule, supersede by @{multiarch} a while ago.
  intrigeri@boum.org 2016-12-03 Make policy compatible with merged-/usr.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>



Additionally, I did some whitespace fixes in the dhclient and procmail
profile before commiting the merge.
2016-12-09 19:54:30 +01:00
Christian Boltz
d8ccde28d3 nscd profile: allow reading libvirt/dnsmasq/*.status
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1014463


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

Bug: https://launchpad.net/bugs/1322780
2016-12-09 17:49:54 +01:00
Christian Boltz
f6201926b5 abstractions/php: make comment version-independent
Note that this is needed only for trunk - in 2.10 and 2.9 the comment
already is version-independent.


Acked-by: Steve Beattie <steve@nxnw.org>
2016-12-07 21:24:30 +01:00
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