Commit graph

4270 commits

Author SHA1 Message Date
intrigeri
e0249e219e apparmor(7): clarify the effect of reloading a profile.
LP: #1608075

Partly fixes: https://bugs.debian.org/826218

(cherry picked from commit 967d394ef4)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-31 10:59:45 +01:00
Christian Boltz
441ecdd434 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.

(cherry picked from commit 26af640fda)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-24 00:18:11 -08:00
Christian Boltz
0a657f4acd Merge branch 'cboltz-ntpd' into 'master'
allow access to ntp clockstats

See merge request apparmor/apparmor!54

(cherry picked from commit 85f8cace12)

1b58f226 allow access to ntp clockstats
2018-01-23 23:02:31 +00:00
Christian Boltz
6eac722531 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

(cherry picked from commit e1929298ac)

8fc3dcb3 abstractions/gnupg: allow pubring.kbx
2018-01-20 22:59:35 +00:00
John Johansen
5578276177 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
(cherry picked from commit 6f1d054468)
2018-01-20 01:46:40 -08:00
John Johansen
520dd4fab0 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>
(cherry picked from commit 2ea3309942)
2018-01-20 00:44:56 -08:00
John Johansen
84391104f4 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>
(cherry picked from commit 8d142809f5)
2018-01-20 00:44:42 -08:00
John Johansen
f7f3d4e6f2 parser tests: add tests for relative path includes
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit efd8eedd52)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:44:07 -08:00
Thorsten Kukuk
e3d4200453 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

(cherry picked from commit 924983e702)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-16 11:34:22 -08:00
John Johansen
6f31a83c5a 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:14:57 -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
Tyler Hicks
ebf0cfe838 Merge branch 'update-README-for-python' into 'master'
update README for python on (at least) Ubuntu systems. Setup thanks to tyhicks

See merge request apparmor/apparmor!45

Acked-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-19 00:28:22 +00:00
Jamie Strandboge
b8195dad31 update README for python on (at least) Ubuntu systems. Setup thanks to tyhicks 2017-12-18 16:02:34 -06:00
Christian Boltz
c803c34558 Merge branch 'gitignore-additions' into 'master'
.gitignore additions for libapparmor tests, binutils, and the vim syntax highlighting files

See merge request apparmor/apparmor!43

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-12-18 16:12:42 +00:00
Christian Boltz
06928db1ce
Update /usr/lib/dovecot/* profiles
- dict needs abstractions/openssl (seen with dovecot 2.2.31 since
  using openssl 1.1)
- imap needs to write tempfiles (seen with dovecot 2.2.31)
- managesieve-login needs access to the login-master-notify socket
  (seen with dovecot 2.2.33)
- pop3-login needs access to the anvil socket (reported by pfak on
  IRC some months ago)
2017-12-18 17:00:35 +01:00
Tyler Hicks
426990cfaf .gitignore: Add files to ignore in utils/vim/
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-18 15:50:59 +00:00
Tyler Hicks
e325e74b0f .gitignore: Add files to ignore from libapparmor test runs
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-18 15:48:59 +00:00
Tyler Hicks
ba0cdbc013 .gitignore: Add files to ignore in binutils/
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-18 15:45:48 +00:00
Tyler Hicks
da6db0c2b9 Merge branch 'cboltz-gitignore' into 'master'
.gitignore: add several parser/**.o and utils/**.pyc files

See merge request apparmor/apparmor!37

Acked-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-18 15:42:32 +00:00
Christian Boltz
566218612c
remove unused UI_ask_mode_toggles() in aa.py 2017-12-17 17:38:46 +01:00
Christian Boltz
6713f9d94a Merge branch 'fix-pulse-config' into 'master'
Fix local pulseaudio config file access

See merge request apparmor/apparmor!38


Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk
2017-12-17 16:19:42 +00:00
Christian Boltz
23220af3b9
.gitignore: add several parser/**.o and utils/**.pyc files
Also ignore parser/libapparmor_re/libapparmor_re.a and the utils
coverage report.
2017-12-17 16:55:10 +01:00
Christian Boltz
2431b1884a
Display "owner permissions on/off" buttons in aa-logprof
- extend available_buttons() to display an "owner permissions on/off"
  button if the rule supports it
- extend ask_the_questions() to handle these buttons
- add some tests to test-translations.py to avoid hotkey conflicts with
  the newly added buttons
2017-12-17 16:45:49 +01:00
Christian Boltz
11147f965a
split set_options_audit_mode() and add set_options_owner_mode()
- move the code of set_options_audit_mode() to a new function
  set_options_mode() and make set_options_audit_mode() a wrapper for it.
- add set_options_owner_mode() as another wrapper for set_options_mode()
  and add code to switch the owner flag to set_options_mode()
- add tests for set_options_owner_mode()
2017-12-17 16:42:12 +01:00
Christian Boltz
24eaea19e3
Add 'can_owner' flag to *Rule
This flag defines if the "Owner permissions on/off" button gets
displayed in aa-logprof.

False by default for all rule types (most of them don't support the
owner conditional). Also false for non-owner FileRule.

True only for FileRule if owner=True.
2017-12-17 16:31:05 +01:00
Christian Boltz
bb96e38a90
abstractions/X: add another location for .Xauthority
With the latest sddm, .Xauthority is now located at
  @{HOME}/.local/share/sddm/.Xauthority
2017-12-17 15:38:26 +01:00
Vincas Dargis
f73627cbb5 Fix local pulseaudio config file access
Add rules to allow reading .conf files from $HOME/.config/pulse
and $HOME/.config/pulse/client.conf.d directories.
2017-12-17 15:56:21 +02:00
Christian Boltz
6db30f8faf Merge branch 'dovecot-signals' into 'master'
Fix signal sending for usr.sbin.dovecot

See merge request apparmor/apparmor!36

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk
2017-12-16 17:26:08 +00:00
Vincas Dargis
9f24650ef9 Fix signal sending for usr.sbin.dovecot
Add signal rules to allow dovecot master daemon to send signals
to various child daemons (for reloading/restarting).
2017-12-15 18:17:48 +02:00
Christian Boltz
5653697df2
get libapparmor revision in sync with the 2.11.1 release
This commit applies the libapparmor revision set in bzr r3681 (2.11 branch)
  bump release version to 2.11.1
to the master branch.
2017-12-13 20:35:50 +01:00