Commit graph

449 commits

Author SHA1 Message Date
David Disseldorp
b3c7f00669 profiles: permit clustered Samba access to CTDB socket and databases
When configured with "clustering = yes", Samba needs to be able to
connect to the local ctdbd daemon socket, and directly manipulate .tdb
database files managed by ctdb.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2014-07-04 12:09:58 +02:00
Steve Beattie
70926b5d55 profiles: add dovecot-common abstraction
This commit adds a dovecot-common abstraction, as well as adjusting
the profiles for dovecot's helper binaries to make use of it. The
important addition is the ability for the dovecot master process to
send signals to the helpers.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-06-27 12:14:53 -07:00
Steve Beattie
1b29c35db8 profiles: move postfix-common to abstractions/
Move postfix-common from program-chunks/ to abstractions/; remove
program-chunks directory since postfix-common was the last resident of
that directory (and had been since 2007), and adjust the includes of all
the profiles that include postfix-common.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-06-26 21:32:56 -07:00
Kees Cook
8f60678946 profiles: allow apache hats to receive signals from unconfined
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-06-24 11:06:06 -07:00
Kees Cook
2edbaca0bf profiles: Allow php5 abstraction to access Zend opcache files.
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-06-24 10:53:00 -07:00
Jamie Strandboge
999cb6e4f5 Adjust base abstraction for ptrace and signal mediation
- Allow reciprocal ptrace readby to everyone (requires peer unconfined or to
   ptrace read to us)
 - same for ptrace tracedby
 - allow us to ptrace read ourselves
 - receive all signals from unconfined
 - allow us to signal ourselves
 - allow sending and receiving "exists" (for pid existence)

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-06-23 16:11:03 -05:00
Jamie Strandboge
f9ea3d47a6 dnsmasq profile updates for signals and ptrace from libvirtd
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-06-23 15:31:40 -05:00
Kees Cook
84082805e0 profiles: adjust apache2 for signal mediation changes
Update the apache2 profile so that the parent apache process can kill
worker processes inside of hats. Update the example comments and the
DEFAULT_URI and HANDLING_UNTRUSTED_INPUT hats to include the
apache2-common abstraction to allow them to receive signals from the
parent process.

Author: Kees Cook <kees@ubuntu.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Bug: https://bugs.launchpad.net/apparmor/+bug/1322764
2014-06-12 16:36:47 -07:00
Kees Cook
c1e06843eb profiles: adjust apache2-common abstraction for signals/mod_apparmor changes
Update the apache2-common abstraction so that the parent apache process
can kill worker processes inside of hats, as well as handle the updated
mod_apparmor behavior that invokes aa_change_hatv() and then checks
which hat it ended up in via aa_getconn() (which reads from
{PROC}/@{pid}/attr/current).

Author: Kees Cook <kees@ubuntu.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Bug: https://bugs.launchpad.net/apparmor/+bug/1322764
2014-06-12 16:14:08 -07:00
Jamie Strandboge
f6f4ef7ee9 Description: update nvidia abstraction for additional /proc and ~/.nv/GLCache
access
Bug-Ubuntu: https://launchpad.net/bugs/1325050

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-06-06 13:50:58 -05:00
Simon Déziel
cf9a7287fe Improve cross-distro compatibility by supporting python 2.[4-7] and python 3.[0-4]. Fixes LP: #1198672 2014-06-05 19:43:59 -07:00
Seth Arnold
5fee376411 fix for starting chromium-browser from evince, 14.04
Ubuntu 14.04's chromium-browser has changed paths in a way that prevents
evince from opening clicked links in chromium-browser windows.

This patch adds a new path for the chrome-sandbox executable to the
sanitized_helper profile, so chromium will get its own tailored profile if
necessary.

The reporter who said this patch helped included some further DENIED lines
for signals that indicates this is probably not sufficient but did make
the links work as expected.

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

Signed-off-by: Seth Arnold <seth.arnold@canonical.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2014-05-21 22:49:22 -07:00
Jamie Strandboge
8c28481311 Description: allow access to egl libraries in X abstraction
Bug: https://launchpad.net/bugs/1320014

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-05-15 22:01:35 -05:00
Seth Arnold
62fdd3bd3a abstractions/mysql: allow access to mysqld.sock
From: Felix Geyer <debfx@ubuntu.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-04-28 14:07:17 -07:00
Christian Boltz
30b5eef230 update the usr.sbin.winbindd profile to
- allow rw access to /var/cache/krb5rcache/*
- treat passdb.tdb.tmp as passdb.tdb

Patch from Lars Müller <lmuelle@suse.com>

References: https://bugzilla.novell.com/show_bug.cgi?id=870607


Acked-by: Steve Beattie <steve@nxnw.org>
2014-04-21 22:10:51 +02:00
Alban Crequy
5a826d8a5c profiles/Makefile: grep: use [[:space:]] instead of \s
\s is a new feature of GNU grep 2.6 (released on 2010-03-23) and
it does not work in older versions. By using [[:space:]] instead,
AppArmor can compile on systems with older versions of grep.

Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-03-25 10:45:20 -07:00
Simon Deziel
212586fceb Support python 2.[4-7] and python 3.[0-4] for greater cross-distro
compatibility. Fixes LP: 1198672
2014-03-11 16:03:24 -04:00
Jamie Strandboge
429f077679 Add /var/www/html to abstractions/web-data, which is the path used on Debian
and its derivatives
Bug-Ubuntu: https://launchpad.net/bugs/1285653

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-02-27 14:49:54 -06:00
Simon Deziel
59e97687b1 Remove unneeded rule as this is already allowed by
the site-wide config rule.
2014-02-20 10:33:19 -05:00
Simon Deziel
96fd3f8bd0 Adapt path for python 3.{3,4} too 2014-02-20 10:31:47 -05:00
Simon Deziel
2eb7390aa2 Add missing directory read access rules 2014-02-20 10:31:07 -05:00
Christian Boltz
ea8e02412e dnsmasq profile - NetworkManager integration
This is an updated version of the previous dnsmasq profile patch, again 
from develop7 [at] develop7.info


Acked-by: John Johansen <john.johansen@canonical.com>
2014-02-17 22:56:02 +01:00
Christian Boltz
503d951673 update abstractions/winbind
- some *.dat files live in a different directory nowadays (at least in 
  openSUSE)
- the openSUSE smb.conf includes the (autogenerated) dhcp.conf, so this
  file also needs to be readable.

References: https://bugzilla.novell.com/show_bug.cgi?id=863226

Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-02-14 23:37:13 +01:00
Jamie Strandboge
6812e5e550 Update abstractions to use new XDG_*_DIR values. Thanks to Christian Boltz for
the suggestion to use @{XDG_DOWNLOAD_DIR} in abstractions/user-download as
well as the existing entries.

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Christian Boltz <apparmor@cboltz.de>
2014-02-14 16:28:16 -06:00
Jamie Strandboge
8a0951be18 = Background =
The xdg-user-dirs specification[1] allows for translatable and movable common
directories. While this may be beneficial for users who for example want to have
~/Pictures translated into their own language, this flexibility provides
challenges for AppArmor. Untranslated xdg user directories are typically (see
~/.config/user-dirs.dirs):

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

On an Ubuntu system with the fr_CA locale installed, these become:
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Musique"
XDG_PICTURES_DIR="$HOME/Images"
XDG_VIDEOS_DIR="$HOME/Vidéos"

While the kernel and AppArmor parser handle these translations fine, the
profiles do not.

As an upstream, we can vastly improve the situation by simply creating the
xdg-user-dirs tunable using the default 'C' xdg-user-dirs values:
$ cat /etc/apparmor.d/tunables/xdg-user-dirs
@{XDG_DESKTOP_DIR}=Desktop
@{XDG_DOWNLOAD_DIR}=Downloads
@{XDG_TEMPLATES_DIR}=Templates
@{XDG_PUBLICSHARE_DIR}=Public
@{XDG_DOCUMENTS_DIR}=Documents
@{XDG_MUSIC_DIR}=Music
@{XDG_PICTURES_DIR}=Pictures
@{XDG_VIDEOS_DIR}=Videos

# Also, include files in tunables/xdg-user-dirs.d for site-specific adjustments
# to the various XDG directories
#include <tunables/xdg-user-dirs.d>

and then create the /etc/apparmor.d/tunables/xdg-user-dirs.d directory. With
that alone, we can start using rules like this in policy:

  owner @{HOME}/@{XDG_MUSIC_DIR}/** r,

and users/admins can adjust /etc/apparmor.d/tunables/xdg-user-dirs or drop files
into /etc/apparmor.d/tunables/xdg-user-dirs.d, providing a welcome convenience.

This of course doesn't solve everything. Because users can modify their
~/.config/user-dirs.dirs file at will and have it point anywhere, so we can't
examine those files and do anything automatic there (when we have user policy we
can revisit this). This patch handles translations well though since use of
translations for these directories happens outside of the user's control. Users
who modify ~/.config/user-dirs.dirs can update policy like they need to now (ie,
this patch doesn't change anything for them).

[0] https://lists.ubuntu.com/archives/apparmor/2013-August/004183.html
[1] http://freedesktop.org/wiki/Software/xdg-user-dirs/

This patch adds basic support for XDG user dirs:

1. Update profiles/apparmor.d/tunables/global to include xdg-user-dirs.
2. Create the xdg-user-dirs tunable using the default 'C' xdg-user-dirs values
   and includes tunables/xdg-user-dirs.d
3. Add profiles/apparmor.d/tunables/xdg-user-dirs.d/site.local with commented
   out examples on how to use the directory.

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Christian Boltz <apparmor@cboltz.de>
2014-02-14 16:24:52 -06:00
Jamie Strandboge
e9c30a9361 libthai-data is used by LibThai which is the library used to deal with
Thai-specific functions like word-breaking, input and output methods and basic
character and string support. This is: https://launchpad.net/bugs/1278702

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-02-14 14:28:12 -06:00
Seth Arnold
35e79ef66d Author: Jamie Strandboge <jamie@canonical.com>
Description: Allow applications run under sanitized_helper to connect to DBus

This was originally 0076_sanitized_helper_dbus_access.patch in the Ubuntu
apparmor packaging.

jdstrand: +1 (this is in the Ubuntu namespace, so feel free to commit)
2014-02-13 18:11:54 -08:00
Seth Arnold
0aefb378f9 Subject: using webapps triggers firefox rejections
Bug: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1056418
From: Steve Beattie <steve.beattie@canonical.com>

Came from 0021-webapps_abstraction.patch in the Ubuntu apparmor packaging.

jdstrand: +1 (this is in the Ubuntu namespace, so feel free to commit)
2014-02-13 18:10:05 -08:00
Seth Arnold
3ee30ca14c Description: Remove access to pulseaudio debug socket from audio abstraction
Grant access to specific files in the /var/run/user/UID/pulse/ directory to
 remove access to potentially dangerous and non-essential files such as the
 debug (cli) socket provided by the module-cli-protocol-unix module.
Author: Tyler Hicks <tyhicks@canonical.com>
Bug-Ubuntu: https://launchpad.net/bugs/1211380
Acked-by: Steve Beattie <steve@nxnw.org>
2014-02-13 17:25:31 -08:00
Seth Arnold
b70d3fe48e Author: Jamie Strandboge <jamie@canonical.com>
Description: allow mmap of fglrx dri libraries
Bug-Ubuntu: https://launchpad.net/bugs/1200392
Acked-by: Steve Beattie <steve@nxnw.org>

Came from 0038-lp1200392.patch.
2014-02-13 17:23:56 -08:00
Seth Arnold
8e5f15c603 Author: Jamie Strandboge <jamie@canonical.com>
Description: update mod_apparmor man page for Apache 2.4 and add new
 apparmor.d/usr.sbin.apache2 profile (based on the prefork profile)
Acked-by: Steve Beattie <steve@nxnw.org>

Differs from original 0036-libapache2-mod-apparmor-profile-2.4.patch
ubuntu patch -- I've deleted the "delete the apache 2.2 profile" part of
the patch. So apache 2.2's profile is also still supported.
2014-02-13 17:21:41 -08:00
Seth Arnold
f88539d230 Description: /etc/vdpau_wrapper.cfg needed for Firefox 18+ on quantal
Author: Micah Gersten <micah@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>

Modified by Seth Arnold; nvidia nvpau_wrapper.cfg permission was hoisted
up into an nvidia abstraction.
2014-02-13 17:17:46 -08:00
Seth Arnold
37ecdcfce5 Description: Allow using sssd for group and password lookups
Author: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Steve Beattie <steve@nxnw.org>

This was originally patch 0018-lp1056391.patch in the Ubuntu apparmor
packaging; Steve noticed the now-redundant line for /var/lib/sss/mc/passwd
so I removed that at the same time.
2014-02-13 17:15:03 -08:00
Christian Boltz
311163203a dovecot profiles - use abstractions/nameservice
After testing the dovecot profiles on a new server, I noticed 
/usr/lib/dovecot/dict and /usrlib/dovecot/lmtp need more nameservice-
related permissions.

Therefore include abstractions/nameservice instead of adding more and 
more files.

Acked-by: John Johansen (on IRC)
2014-02-13 22:19:26 +01:00
Jamie Strandboge
46f5f51909 add support for python3.2 and python3.4 to the python abstraction
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-02-12 14:42:39 -06:00
Jamie Strandboge
0c5d6f4660 add ubuntu-unity7-* abstractions for Ubuntu desktop users 2014-02-05 23:44:04 -05:00
Christian Boltz
19038d063b /usr/lib/dovecot/auth reads the mysql config files, which is not covered by
abstractions/mysql.

This binary/profile seems to be the only one that needs to do this, so 
add it to this profile (instead of abstractions/mysql) to avoid superfluous
permissions for other programs with abstractions/mysql

Acked-by: John Johansen <john.johansen@canonical.com>
2014-02-02 15:16:25 +01:00
Christian Boltz
a38ce71813 update usr.bin.dovecot profile
after testing the dovecot profiles on a new server, I noticed 
/usr/sbin/dovecot needs some more permissions:
- mysql access
- execution permissions for /usr/lib/dovecot/dict and lmtp
- write access to some postfix sockets, used to
  - provide SMTP Auth via dovecot
  - deliver mails to dovecot via LMTP 
- and read access to /proc/filesystems

Acked-by: John Johansen <john.johansen@canonical.com>
2014-02-02 15:13:51 +01:00
Christian Boltz
0fa4676d30 [3/3] dovecot profiles: update usr.sbin.dovecot profile for dovecot 2.x
The usr.sbin.dovecot profile needs several updates for dovecot 2.x, 
including
- capability dac_override and kill
- Px for various binaries in /usr/lib/dovecot/

The patch also adds a nice copyright header (I hope I got the bzr log 
right ;-)


Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-26 22:48:02 +01:00
Christian Boltz
df94a355fc [2/3] dovecot profiles: add profiles for new dovecot 2.x binaries
dovecot 2.x comes with several new binaries in /usr/lib/dovecot. 
This patch adds profiles for

/usr/lib/dovecot/anvil 
/usr/lib/dovecot/auth 
/usr/lib/dovecot/config 
/usr/lib/dovecot/dict 
/usr/lib/dovecot/dovecot-lda 
/usr/lib/dovecot/lmtp 
/usr/lib/dovecot/log 
/usr/lib/dovecot/managesieve 
/usr/lib/dovecot/ssl-params

References: https://bugzilla.novell.com/show_bug.cgi?id=851984


Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-26 22:46:51 +01:00
Christian Boltz
86ed060f25 [1/3] dovecot profiles: introduce tunables/dovecot
Introduces tunables/dovecot (with @{DOVECOT_MAILSTORE}) and replace 
the mail storage location in various dovecot-related profiles with 
this variable.

Also add nice copyright headers (I hope I got the bzr log right ;-)


Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-26 22:43:42 +01:00
Felix Geyer
6733da5fcd nameservice abstraction: read permission to avahi socket
From: Felix Geyer <debfx@ubuntu.com>

AppArmor requires read and write permission to connect to
unix domain sockets but the nameservice abstraction only
grants write access to the avahi socket.
As a result mdns name resolution fails.

Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-26 12:16:54 -08:00
Christian Boltz
960a8aee87 several updates for the winbindd profile
(collected in the openSUSE package over the last months)

- add abstractions/samba to usr.sbin.winbindd profile
  (and cleanup things that are included in the abstraction - the cleanup 
  part is not in the openSUSE package)
- add capabilities ipc_lock and setuid to usr.sbin.winbindd profile 
  (bnc#851131)
- updates for samba 4.x and kerberos (bnc#846586#c12 and #c15, 
  bnc#845867, bnc#846054)
- drop always-outdated "Last Modified" comment

References: see the bnc# above (they are bug numbers at 
bugzilla.novell.com)

Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-23 15:04:12 +01:00
Christian Boltz
1886ab9f35 make sure all profiles have #include <local/...>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-01-20 23:35:13 +01:00
Christian Boltz
68fbe714a4 allow dnsmasq read config created by recent NetworkManager
(see  http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=d82669d3fdaa7ec70ef1b64941c101ac810c394b 
for details)

Patch by develop7 [at] develop7.info

Acked-by: Jamie Strandboge <jamie@canonical.com>
2014-01-17 20:58:21 +01:00
Tyler Hicks
2559b9cfd8 profiles: Add strict accessibility bus abstraction
Create a new strict accessibility bus abstraction.

The strict abstraction only allows for calling the Hello, AddMatch,
RemoveMatch, GetNameOwner, NameHasOwner, and StartServiceByName methods
that are exported by the D-Bus daemon.

The permissive abstraction reuses the strict abstraction and then allows
all communications on the accessibility bus.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-10 15:35:30 -06:00
Tyler Hicks
46685a5637 profiles: Add strict session bus abstraction
Move some of the file rules from the existing permissive session bus
abstraction into a new strict session bus abstraction. Leave the
dbus-launch rule in the permissive profile since not all applications
will need it.

The strict abstraction only allows for calling the Hello, AddMatch,
RemoveMatch, GetNameOwner, NameHasOwner, and StartServiceByName methods
that are exported by the D-Bus daemon.

The permissive abstraction reuses the strict abstraction and then allows
all communications on the session bus.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2014-01-10 15:35:09 -06:00
Tyler Hicks
38aae1d1f0 profiles: Add strict system bus abstraction
Move the file rule from the existing permissive system bus abstraction
into a new strict system bus abstraction.

The strict abstraction only allows for calling the Hello, AddMatch,
RemoveMatch, GetNameOwner, NameHasOwner, and StartServiceByName methods
that are exported by the D-Bus daemon.

The permissive abstraction reuses the strict abstraction and then allows
all communications on the system bus.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-01-10 15:34:45 -06:00
Christian Boltz
c37643e8a0 add FIPS support to abstractions/openssl
References: https://bugzilla.novell.com/show_bug.cgi?id=857122#c2

Acked-by: Steve Beattie <steve@nxnw.org>
2014-01-03 20:43:43 +01:00
Christian Boltz
aa6b86a1c3 samba (nmbd and smbd) need to create /var/run/samba and /var/cache/samba
at startup (at least on systems where /var/run is on a tmpfs)

References: https://bugzilla.novell.com/show_bug.cgi?id=856651

Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.8. Thanks!
2013-12-23 22:15:47 +01:00