Commit graph

40 commits

Author SHA1 Message Date
Christian Boltz
4c14516341
Convert abstractions from /{usr/,}etc/ to @{etc_ro}
The authentication, base and nameservice abstraction used /{usr/,}etc/
in several rules. Switch that to the more readable (and tunable)
@{etc_ro} variable.
2020-07-23 20:51:25 +02:00
Christian Boltz
9aa5e3f388
Change #include to include in abstractions and tunables 2020-06-09 23:28:41 +02:00
Christian Boltz
9fc8e43c67
abstractions: remove '#' from 'include if exists'
This matches what we use in the profiles for local abstractions.

Also adjust the check in the Makefile to expect the variant without '#'.
2020-05-30 19:53:49 +02:00
John Johansen
730db17607 policy: tag policy with the AppArmor 3.0 abi
Tag profiles and abstractions with abi information.

Tagging abstractions is not strictly necessary but allows the parser
to detect when their is a mismatch and that policy will need an
update for abi.

We do not currently tag the tunables because variable declarations
are not currently affected by abi.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/491
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2020-05-29 00:23:17 -07:00
Jamie Strandboge
5583569a29 allow accessing the libnss-systemd VarLink sockets and DBus APIs
https://systemd.io/USER_GROUP_API/ describes the libnss-systemd VarLink
socket APIs:

"
When a client wants to look up a user or group record, it contacts all
sockets bound in this directory in parallel, and enqueues the same query
to each. The first positive reply is then returned to the application,
or if all fail the last seen error is returned instead. (Alternatively
a special Varlink service is available, io.systemd.Multiplexer which
acts as frontend and will do the parallel queries on behalf of the
client, drastically simplifying client development.)
"

This updates the nameservice abstraction to allow read/write on
well-known systemd VarLink named sockets.

In addition, allow lookups for systemd-exec's DynamicUsers via D-Bus

References:
- https://systemd.io/USER_GROUP_API/
- https://systemd.io/USER_RECORD/
- https://www.freedesktop.org/software/systemd/man/nss-systemd.html
- https://www.freedesktop.org/software/systemd/man/systemd.exec.html
- https://launchpad.net/bugs/1796911
- https://launchpad.net/bugs/1869024

Modified by John Johansen by:
- moving rules nss-systemd include
- replacing /proc/ with @{proc}/
- moving and merging commit 16f9f688 rules into nss-systemd include

PR: https://gitlab.com/apparmor/apparmor/-/merge_requests/480
PR: https://gitlab.com/apparmor/apparmor/-/merge_requests/474
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-04-16 10:21:04 -07:00
nl6720
16f9f6885a
abstractions/nameservice: allow accessing /run/systemd/userdb/
On systems with systemd 245, nss-systemd additionally queries NSS records from systemd-userdbd.service. See https://systemd.io/USER_GROUP_API/ .

Signed-off-by: nl6720 <nl6720@gmail.com>
2020-03-29 11:08:38 +03:00
nl6720
7a9a4824d4 Use "run" variable in profiles
Signed-off-by: nl6720 <nl6720@gmail.com>
2020-02-13 11:02:49 +02:00
Christian Boltz
cf15b241e7
adjust abstractions/base and nameservice for /usr/etc/ move
References: http://bugzilla.opensuse.org/show_bug.cgi?id=1161756
2020-02-03 22:23:15 +01:00
Matthew Garrett
d9ab83281b Add support for local additions to abstractions
Local policy may want to extend or override abstractions, so add support for including local updates to them.

Acked-by: Christian Boltz <apparmor@cboltz.de>
Acked-by: intrigeri <intrigeri@boum.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2019-01-24 03:06:03 -08:00
Marius Tomaschewski
b0bacba9db abstractions/nameservice: allow /run/netconfig/resolv.conf
Latest netconfig in openSUSE writes /run/netconfig/resolv.conf, and only
has a symlink to it in /etc

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1097370
Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2019-01-24 02:43:02 -08:00
Christian Boltz
1d896e014c Allow reading /etc/netconfig in abstractions/nameservice
/etc/netconfig is required by the tirpc library which nscd and several
other programs use.

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


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk
2017-10-20 22:53:09 +02:00
Jamie Strandboge
59660c4650 Description: allow access to stub resolver configuration
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-09-15 15:47:26 -05:00
Christian Boltz
84cd523d8c Samba profile updates for ActiveDirectory / Kerberos
The Samba package used by the INVIS server (based on openSUSE) needs
some additional Samba permissions for the added ActiveDirectory /
Kerberos support.

As discussed with Seth, add /var/lib/sss/mc/initgroups read permissions
to abstractions/nameservice instead of only to the smbd profile because
it's probably needed by more than just Samba if someone uses sss.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk.
2017-08-29 13:31:20 +02:00
intrigeri
f9ca24c293 Make policy compatible with merged-/usr. 2016-12-03 10:59:01 +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
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
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
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
534148d9aa fix filename for .../nscd/hosts (which was accidently changed to "host" 3 years ago)
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-18 00:27:10 +01:00
Jamie Strandboge
1f003c0120 abstraction updates for abstract, anonymous and netlink
- the base abstraction for common abstract and anonymous rules (comments
  included per rule)
- dbus-session-strict to add a rule for connecting to the dbus session
  abstract
  socket. I used 'peer=(label=unconfined)' here, but I could probably lose the
  explicit label if people preferred that
- X to add a rule for connecting to the X abstract socket. Same as for
  dbus-session-strict
- nameservice to add a rule for connecting to a netlink raw. This change could
  possibly be excluded, but applications using networking (at least on Ubuntu)
  all seem to need it. Excluding it would mean systems using nscd would need to
  add this and ones not using it would have a noisy denial

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-09-03 14:21:31 -05:00
Jamie Strandboge
ac481f142e Allow /var/lib/extrausers/group and /var/lib/extrausers/passwd 'read' in order
to work with libnss-extrausers

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-08-21 07:27:07 -05:00
Christian Boltz
dd3df80f01 abstractions/nameservice should allow /run/nscd/passwd etc. in addition
to /var/run/nscd/passwd.

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


Acked-by: Seth Arnold <seth.arnold@canonical.com> for both trunk and 2.8.
2014-07-09 10:14:14 +02: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
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
Steve Beattie
1cc0885890 Subject: profiles - use @{pid} tunable
This patch adds the kernelvars tunable to the global set that is usually
included by default in apparmor policies. It then converts the rules
that are intended to match /proc/pid to use this tunable.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Seth Arnold <seth.arnold@canonical.com>
2013-01-02 15:34:38 -08:00
Christian Boltz
091ec763f9 split off abstractions/ldapclient from abstractions/nameservice
Original openSUSE changelog entry:

Thu Jan  6 16:23:19 UTC 2011 - rhafer@suse.de

- Splitted ldap related things from nameservice into separate
  profile and added some missing paths (bnc#662761)
2011-11-01 17:08:37 +01:00
Jamie Strandboge
20f117500f update for /var/run -> /run udev transition. For compatibility, distributions
(eg Ubuntu) are providing a symlink from /var/run to /run, so our profiles
should handle both situations.
2011-07-14 07:57:57 -05:00
Steve Beattie
83007d7600 Author: Jamie Strandboge <jamie@canonical.com>,
Steve Langasek <steve.langasek@linaro.org>,
 Steve Beattie <sbeattie@ubuntu.com>
Description: add multiarch support to abstractions
Bug-Ubuntu: https://bugs.launchpad.net/bugs/736870

This patch add multiarch support for common shared library locations, as
well as a tunables file and directory to ease adding addiotional
multiarch paths.

Bug: https://launchpad.net/bugs/736870
2011-03-23 12:24:11 -07:00
Kees Cook
723a20ba7d as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
Kees Cook
34f5510faf network interface enumeration 2010-06-04 17:44:59 -07:00
Jamie Strandboge
694c9916b9 pull in Ubuntu updates to profiles/apparmor.d 2009-11-04 14:25:42 -06:00
John Johansen
748e398c21 - various patches and cleanups from kees@ubuntu.com 2008-06-11 20:19:36 +00:00
Seth Arnold
7486b2bbb0 Bug 288960 - nscd with nss_ldap and sasl/gss bind to ldap server failed 2007-08-23 23:22:06 +00:00
Steve Beattie
4cc2f981a3 [https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/132468]
Dur, I put the wrong entry for resolvconf in the nameservice
abstraction, fixing.
2007-08-21 21:53:27 +00:00
Dominic Reynolds
cd007f1162 Updates for cups, add inet|inet6 dgram|stream to nameservice abstraction 2007-08-17 21:46:56 +00:00
Steve Beattie
1f0169a5f9 Launchpad bug #132468: Nameservice abstraction should also include
/var/run/resolvconf/resolv.conf:

  The Nameservice abstraction configuration file
  (/etc/apparmor.d/abstractions/nameservice) permits reads access to
  (amongst other paths) /etc/resolv.conf.

  However, on systems using resolvconf, this is a symbolic link to
  /etc/resolvconf/run/resolv.conf -- where /etc/resolvconf/run itself
  is a symlink to /var/run/resolvconf.
2007-08-14 14:50:09 +00:00
Seth Arnold
2e9a82868f Grand profile repository re-organization. Move directories around to
make the final install layout match the layout in the repository (at
long last :) -- now we can use a single 'make check' target to check the
profiles in the repository against both apparmor_parser and logprof.
2007-05-16 18:51:46 +00:00
Renamed from profiles/abstractions/nameservice (Browse further)