Commit graph

4412 commits

Author SHA1 Message Date
John Johansen
8b3997aa0e README.md: fix Bad Header in the README file
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-06 07:20:59 -08:00
John Johansen
7f643fbc31 Move the README file to README.md
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-06 07:17:30 -08:00
John Johansen
275c7c0d50 Add core infrastructure badge and build status and coverage badges
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-06 07:12:02 -08:00
Steve Beattie
d66720ef07 build: support coverity python scan
Coverity now supports scanning python (and other languages). Apply the
fs-capture-search option to the libapparmor and utils directpries to
capture the python source.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-05 23:58:43 -08:00
intrigeri
22e94633c3 dnsmasq profile: allow chown capability.
dnsmasq on Debian sid now chown's its PID file.

Bug-Debian: https://bugs.debian.org/889806
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-05 23:51:23 -08:00
John Johansen
ccef9161a8 Merge branch 'master' into 'master'
Add custom notification

See merge request apparmor/apparmor!72

Acked-by: John Johansen <john.johansen@canonical.com>
2018-03-06 07:42:37 +00:00
John Johansen
b21b28f486 Merge branch 'aa-status-exe' into 'master'
aa-status: split profile from exec name

See merge request apparmor/apparmor!73

Acked-by: John Johansen <john.johansen@canonical.com>
2018-03-01 22:23:25 +00:00
Kees Cook
735afbc947 aa-status: split profile from exec name
Right now, if you have a named profile with regular expressions to
match binaries, the profile will be shown in aa-status under the
"process list", which doesn't make sense. Instead, show the actual
executable name, and if the profile name differs, report it at the
end (or as a separate field in the json output mode).

Signed-off-by: Kees Cook <keescook@chromium.org>
2018-03-01 14:17:57 -08:00
Nicolas Videla
1c3839c39a Update man page and default configuration for notify.conf 2018-02-26 14:43:19 +11:00
Nicolas Videla
86db2263b8 Adding custom notification on AppArmor. 2018-02-26 14:34:58 +11:00
Steve Beattie
41b6182019 mlmmj-sub: fix moderated subscription
Merge branch 'cboltz-mlmmj-sub' into 'master'

See merge request apparmor/apparmor!70

Acked-by: Steve Beattie <steve@nxnw.org>
2018-02-22 22:55:06 +00:00
Christian Boltz
8ef7b59454
mlmmj-sub: fix moderated subscription
/var/spool/mlmmj/*/moderation/subscribe* rw, is needed for lists with
moderated subscription

References: http://bugzilla.opensuse.org/show_bug.cgi?id=1082230
2018-02-22 22:57:51 +01:00
Christian Boltz
0eefeeb0e7 Merge branch 'cboltz-notify-dbus-env' into 'master'
set DBUS_SESSION_BUS_ADDRESS, needed by notify-send

See merge request apparmor/apparmor!53


Acked-by: intrigeri <intrigeri@debian.org> for 2.9..master
2018-02-17 16:03:23 +00:00
Christian Boltz
21b0d14ea4 Merge branch 'fix-nvidia-dir' into 'master'
Allow to create .nv directory

See merge request apparmor/apparmor!69

Acked-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master
2018-02-17 15:58:32 +00:00
Vincas Dargis
11e7dab95e Allow to create .nv directory
Update nvidia abstraction to allow creating NVIDIA-specific user directories in
case it is missing (due to fresh $HOME or if manually removed for any reason).
2018-02-16 16:54:32 +02:00
Christian Boltz
e88af93322 Merge branch 'update-base-abstraction' into 'master'
Update base abstraction for ld.so.conf and friends.

See merge request apparmor/apparmor!62

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master
2018-02-15 20:14:38 +00:00
John Johansen
ad5e988efb Merge branch 'refactor-and-update-dri' into 'master'
Refactor and update dri-specific rules

See merge request apparmor/apparmor!66

Acked-by: Jamie Strandboge <jamie.strandboge@canonical.com>
2018-02-08 08:35:56 +00:00
Vincas Dargis
b0456adbd8 Add dri-enumerate abstraction
Create new dri-enumerate abstraction with rules needed for some GUI applications
allowing to get GPU device information.
2018-02-04 16:01:27 +02:00
Vincas Dargis
8dd517f6dd Move DRI-specific rules into it's own abstraction
Add new dri-common abstraction to contain basic DRI-specific rules.

This refactoring is based on a decision to have set of dri-* abstractions for
fine grained control on case-by-case basis. While dri-common is included in X
abstraction by default, additional DRI-related abstractions can be introduced
(such as for enumerating graphics devices) while keeping them logically together
with same dri- prefix.
2018-02-04 14:21:16 +02:00
John Johansen
547708bc99 Update base network mediation patch with missing feature pinning fixup
apparmor: fix regression in network mediation when using feature pinning

When the 4.14-rc6 and earlier kernels are used with an upstream 4.13
or earlier pinned feature set, there is a regression in network
mediation where policy is not being correctly enforced, because the
compilation is completely dropping the af mediation table as expected
by pre 4.14 kernels but the 4.14 kernel is not accounting for this.

Resulting in network denials that can not be fixed by policy.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-02-01 09:43:37 +01:00
John Johansen
8f6d94bf44 Update base network mediation patch with missing feature pinning fixup
apparmor: fix regression in network mediation when using feature pinning

When the 4.14-rc6 and earlier kernels are used with an upstream 4.13
or earlier pinned feature set, there is a regression in network
mediation where policy is not being correctly enforced, because the
compilation is completely dropping the af mediation table as expected
by pre 4.14 kernels but the 4.14 kernel is not accounting for this.

Resulting in network denials that can not be fixed by policy.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-02-01 09:39:19 +01:00
John Johansen
0b93a7f991 add final kernel patches for 4.14 and 4.15
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-02-01 08:27:19 +01:00
John Johansen
e2c1b21dec Merge branch 'cboltz-simplfy-write-include' into 'master'
simplify write_include() and drop write_single()

See merge request apparmor/apparmor!64

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-31 15:13:01 +00:00
John Johansen
cb4f553d60 Merge branch 'lp1608075-clarify-effect-of-reloading-a-profile' into 'master'
apparmor(7): clarify the effect of reloading a profile.

See merge request apparmor/apparmor!65

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-31 09:46:10 +00:00
intrigeri
967d394ef4 apparmor(7): clarify the effect of reloading a profile.
LP: #1608075

Partly fixes: https://bugs.debian.org/826218
2018-01-29 11:29:35 +00:00
Christian Boltz
705ce5ca3e
simplify write_include() and drop write_single()
write_include() was the only user of write_single(), and write_single()
had some include-specific code. This patch gets rid of write_single().

write_include() gets a simplified version of the code instead of calling
write_single().
2018-01-28 15:55:41 +01:00
Vincas Dargis
6d22c871bf Update base abstraction for ld.so.conf and friends.
Fix denies for latest Thunderbird and Firefox on Debian Sid due to
missing access to /etc/ld.so.conf and /etc/ld.so.conf.d/*.
2018-01-26 19:55:31 +02:00
John Johansen
a3db7f8acb Merge branch 'cboltz-less-hashers' into 'master'
change 'profile_changes' and 'serialize_opts' to dict()

See merge request apparmor/apparmor!63

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-26 16:18:32 +00:00
Christian Boltz
7f1007d13e
change 'profile_changes' and 'serialize_opts' to dict()
The global 'profile_changes' and 'serialize_opts' in sync_profile() are
both used as a dict() - no need to make them a hasher()
2018-01-24 22:04:16 +01:00
John Johansen
f8a174c08b Merge branch 'cboltz-rename-profs' into 'master'
rename 'profs' variable to 'profiles' in two functions

See merge request apparmor/apparmor!60

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-24 08:24:42 +00:00
John Johansen
cab3210bd0 Merge branch 'cboltz-tools-exclude-multiple-rules-per-line' into 'master'
tools: Mark profiles with multiple rules in one line as known-failing

See merge request apparmor/apparmor!61

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-24 08:01:06 +00:00
Christian Boltz
85f8cace12 Merge branch 'cboltz-ntpd' into 'master'
allow access to ntp clockstats

See merge request apparmor/apparmor!54
2018-01-23 23:02:16 +00:00
Christian Boltz
26af640fda
tools: Mark profiles with multiple rules in one line as known-failing
The tools don't support having multiple rules in one line (they expect
\n after each rule), therefore mark some of the bare_include_tests as
known failures.
2018-01-23 22:40:07 +01:00
Christian Boltz
1bac9d2d79
rename 'profs' variable to 'profiles' in two functions
console_select_and_upload_profiles() and set_profiles_local_only() both
use a local variable named 'profs'. Rename it to 'profiles'.

This is the first baby step for rewriting how aa.py stores the profiles
internally. I plan to use 'profs' as variable name instead of 'aa', and
this commit gets the result for "grep -r profs" down to 0.
2018-01-23 22:09:22 +01:00
Christian Boltz
e1929298ac Merge branch 'master' into 'master'
abstractions/gnupg: allow pubring.kbx

See merge request apparmor/apparmor!58

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk
2018-01-20 22:59:17 +00:00
Rene Engelhard
8fc3dcb312 abstractions/gnupg: allow pubring.kbx 2018-01-20 23:54:08 +01:00
John Johansen
6f1d054468 regression tests: fix regression tests to pass on 4.14 upstream kernel
Some of the regression tests are missing conditionals or have the
wrong conditionals so that they fail on current upstream kernels.

Fix this by adding and changing conditionals and requires where
appropriate. With the patches the tests report passing on 4.14 and
4.15 kernels.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Time out
2018-01-20 01:34:54 -08:00
John Johansen
ef718df685 Merge branch 'conditional-include'
Documentation changes intrigeri <intrigeri@debian.org>

Acked-by: Time out
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:38:49 -08:00
John Johansen
2ea3309942 parser: add support for conditional includes
This is a minimal patch to add conditional includes to the profile
language.

The syntax for conditional includes is similar to regular includes
except with the addition of "if exists" after "include"

  include if exists <foo/bar>
  include if exists "foo/bar"
  include if exists "/foo/bar"
  include if exists foo/bar

Note: The patch is designed to be backportable with minimum
effort. Cleanups and code refactoring are planned for follow up
patches that won't be back ported.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:32:20 -08:00
John Johansen
8d142809f5 parser tests: fix includes to allow white space
includes were not handling WS in path names correctly. Allow WS within
quotes. Eg
  include "foo bar"
  include <"foo bar">

BugLink: http://bugs.launchpad.net/bugs/1738880
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:32:20 -08:00
John Johansen
efd8eedd52 parser tests: add tests for relative path includes
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:32:20 -08:00
John Johansen
62dbd29656 Merge branch 'dovecot-lda-protocols' into 'master'
Allow dovecot-lda to read anything under /usr/share/dovecot/protocols.d/

See merge request apparmor/apparmor!57

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-20 08:18:07 +00:00
intrigeri
1b51dac4c9 Allow dovecot-lda to read anything under /usr/share/dovecot/protocols.d/.
On current Debian sid it needs to read
/usr/share/dovecot/protocols.d/imapd.protocol, which is not surprising given it
already needed read access to /usr/share/dovecot/protocols.d/.
2018-01-20 06:25:25 +00:00
John Johansen
1361116542 Merge branch 'cboltz-dovecot-lmtp-dac' into 'master'
dovecot/lmtp: allow dac_read_search

See merge request apparmor/apparmor!55

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-19 09:10:48 +00:00
John Johansen
8b17fd1fa6 Merge branch 'pam_apparmor-less-restrictive-permissions' into 'master'
Install pam_apparmor.so with write permission for its owner.

See merge request apparmor/apparmor!56

Acked-by: John Johansen <john.johansen@canonical.com>
2018-01-19 08:48:36 +00:00
intrigeri
6ab19ea82f Install pam_apparmor.so with write permission for its owner.
I could not find the reason why the upstream Makefile has been installing it
with permissions 555: this predates the migration from SVN.

Regardless, at least on Debian and derivatives, dh_fixperms has been
changing these permissions to 755 forever so it was causing problems,
likely we would know about it by now.

The initial motivation for this change is supporting rootless builds on Debian
and derivatives, also known as "Rules-Requires-Root:  no":

 - /usr/share/doc/dpkg-dev/rootless-builds.txt* on a Debian system
   with a sufficiently recent dpkg-dev installed
 - https://nthykier.wordpress.com/2017/10/29/building-packages-without-fakeroot/
 - https://lists.debian.org/debian-devel/2017/10/msg00520.html

With this change applied upstream, Debian-based downstreams don't need to adjust
their debian/rules to make this work with "Rules-Requires-Root: no":

	chrpath -d $(CURDIR)/debian/tmp/lib/security/pam_apparmor.so
2018-01-19 08:22:35 +00:00
Christian Boltz
1541175c36
dovecot/lmtp: allow dac_read_search
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=887591
2018-01-18 18:15:43 +01:00
Christian Boltz
cb5cdf2656
set DBUS_SESSION_BUS_ADDRESS, needed by notify-send
This is needed by new versions of notify-send, as found on openSUSE
Tumbleweed. Without this, desktop notifications don't work anymore, and
notify-send starts to eat up CPU.

If DBUS_SESSION_BUS_ADDRESS is already set, it won't be changed.
2018-01-18 10:57:50 +01:00
Christian Boltz
1b58f226ce
allow access to ntp clockstats
References: http://bugzilla.opensuse.org/show_bug.cgi?id=1076247
2018-01-16 21:15:41 +01:00
John Johansen
d71e46baaa Merge branch 'parser-readonly-fs' into 'master'
disable write cache if filesystem is read-only

See merge request apparmor/apparmor!52
2018-01-16 19:29:33 +00:00