Commit graph

4439 commits

Author SHA1 Message Date
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
Thorsten Kukuk
924983e702
disable write cache if filesystem is read-only
... and don't bail out

Patch by Thorsten Kukuk <kukuk@suse.com>

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1069906
            https://bugzilla.opensuse.org/show_bug.cgi?id=1074429
2018-01-14 21:33:01 +01:00
John Johansen
6344b8ecc3 parser: fix parser so that cache creation failure doesn't cause load failure
This is a minimal patch so that it can be backported to 2.11 and 2.10
which reverts the abort on error failure when the cache can not be
created and write-cache is set.

This is meant as a temporary fix for
https://bugzilla.suse.com/show_bug.cgi?id=1069906
https://bugzilla.opensuse.org/show_bug.cgi?id=1074429

where the cache location is being mounted readonly and the cache
creation failure is causing policy to not be loaded. And the
thrown parser error to cause issues for openQA.

Note: A cache failure warning will be reported after the policy load.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz apparmor@cboltz.de
(cherry picked from commit 42b68b65fe1861609ffe31e05be02a007d11ca1c)
2018-01-05 01:32:47 -08:00
John Johansen
7f72fd0fca Release: prepare for 2.12 release
update version and library version

Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:48:31 -08:00
Steve Beattie
0b719e4f86 infrastructure: support make tarball for gitlab patch
This patch supports rolling a tarball for a release, as well as doing
'make tag'. Only stuff that's been committed should get incorporated
into the tarball.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:31:34 -08:00
John Johansen
3afbfed9ee aa-decode: add the ability to support PROCTITLE string
buglink: https://bugs.launchpad.net/apparmor/+bug/1736841

Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:22:24 -08:00
John Johansen
e55583ff27 profile: fix syslog-ng startup for some configurations
buglink: https://bugs.launchpad.net/bugs/1739909

Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:13:58 -08:00
John Johansen
b5808e8aa8 Import translations from launchpad translations
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:08:28 -08:00
John Johansen
a3693f56f3 Merge branch 'cboltz-netstat' into 'master'
netstat: allow capability sys_ptrace,

See merge request apparmor/apparmor!46
2017-12-22 20:50:11 +00:00
Christian Boltz
81ca52d948
netstat: allow capability sys_ptrace,
Denying it means netstat -p (actually tested with -tulpen) can't find
out the program name.

sys_ptrace is "only" needed for tracing processes that run under a
different uid.

Also add  ptrace (read),  for systems that support ptrace rules.
2017-12-22 21:43:54 +01:00
John Johansen
4d8fb33335 Merge branch 'cboltz-regex-exception-msg' into 'master'
Improve exception message for #include rules

See merge request apparmor/apparmor!47


Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 20:42:47 +00:00
Christian Boltz
60f71930cd
Improve exception message for #include rules
This fixes one of the remaining issues in
https://gitlab.com/apparmor/apparmor/merge_requests/44
2017-12-22 21:40:18 +01:00
Christian Boltz
22fa0a3a77 Merge branch 'lp-1733700-fix-include-for-non-magicpath' into 'master'
update python tools to support includes with absolute paths

See merge request apparmor/apparmor!44

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-12-22 20:38:14 +00:00
John Johansen
c3b0a3e512 Merge branch 'cboltz-logprof-owner' into 'master'
let aa-logprof detect 'owner' events (again)

See merge request apparmor/apparmor!34
2017-12-22 20:16:16 +00:00
John Johansen
f8b208ee80 Merge branch 'cboltz-dovecot' into 'master'
Update /usr/lib/dovecot/* profiles

See merge request apparmor/apparmor!42

Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 19:20:07 +00:00
John Johansen
118ea834fd Merge branch 'cboltz-unused-UI_ask_mode_toggles' into 'master'
remove unused UI_ask_mode_toggles() in aa.py

See merge request apparmor/apparmor!41

Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 19:18:23 +00:00
John Johansen
f2a84e5f1d Merge branch 'cboltz-owner-buttons' into 'master'
Display "owner permissions on/off" buttons in aa-logprof

See merge request apparmor/apparmor!40

Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 19:06:34 +00:00
John Johansen
bcfb735b9a Merge branch 'cboltz-xauth' into 'master'
abstractions/X: add another location for .Xauthority

See merge request apparmor/apparmor!39

Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 19:00:36 +00:00
John Johansen
7159538fc8 Merge branch 'cboltz-libapparmor-revision' into 'master'
get libapparmor revision in sync with the 2.11.1 release

See merge request apparmor/apparmor!35

Acked-by: John Johansen <john.johansen@canonical.com>
2017-12-22 18:44:17 +00:00
Jamie Strandboge
99f144f8c2 clarify error message in regex.py (thanks to cboltz) 2017-12-21 15:29:52 -06:00
Jamie Strandboge
5c95e3bf39 don't strip() a quoted path (thanks to cboltz) 2017-12-21 15:27:09 -06:00
Jamie Strandboge
515e40ec7f abstract out abs path include to get_include_path() (thanks to cboltz) 2017-12-21 15:07:21 -06:00
Jamie Strandboge
a7e79ffa3d rename vague 'dir' variables (thanks to cboltz) 2017-12-21 14:36:35 -06:00
Jamie Strandboge
9bbef8e307 update python tools to support includes with absolute paths
For now we only allow quoted absolute paths without spaces in the name
due to:
- 1738877: include rules don't handle files with spaces in the name
- 1738879: include rules don't handle absolute paths without quotes in
  some versions of parser
- 1738880: include rules don't handle relative paths in some versions of
  the parser
2017-12-20 17:21:21 -06:00