Commit graph

3407 commits

Author SHA1 Message Date
Christian Boltz
d4fef5b63f
profiles: adjust abstractions/python for python 3.7
Python 3.7 was released yesterday - and to make the abstraction
future-proof, also cover 3.8 and 3.9 in advance ;-)

(cherry picked from commit 01f41fbff8)

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/139
2018-06-29 11:30:00 -07:00
Christian Boltz
3ae5be33e2
profiles: update samba profiles
- allow smbd to load new shared libraries
- allow winbindd to read and write new kerberos cache location

Based on a patch by "Samuel Cabrero" <scabrero@suse.com>

(cherry picked from commit 23b5f29b80)

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

Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/121
2018-05-09 14:19:15 -07:00
Christian Boltz
8c2371a7cd
utils: fix writing alias rules
write_pair() ignored the 'tail' parameter, which resulted in writing
invalid alias rules (without the trailing comma).

Also add an alias to test/cleanprof.* to ensure it doesn't break again.

(cherry picked from commit ae4ab62855)

Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/119
2018-05-08 08:08:55 -07:00
Christian Boltz
43285d69fe
utils: fix writing "link subset" rules
Writing a "link subset" rule missed a space, which resulted in something
like
  link subset/foo -> /bar,

Also add a test rule to tests/cleanprof.* to ensure this doesn't break
again.

[Fixed up conflicts in cleanpprof_test.in and .out -- @smb]

(cherry picked from commit 514535608f)

Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/117
2018-05-06 23:28:19 -07:00
Steve Beattie
e3e01943d4
mount regression test: convert mount test to use MS_NODEV
The mount regression test passes MS_MANDLOCK to the mount(2) syscall in
the test program. When the kernel is configured without
CONFIG_MANDATORY_FILE_LOCKING set, attempting to mount a filesystem with
this option always fails with EPERM. To fix, convert the test program to
use the MS_NODEV option instead.

(cherry picked from commit 49ba6af2bf)

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>

Bug: https://bugs.launchpad.net/apparmor/+bug/1765025
PR: https://gitlab.com/apparmor/apparmor/merge_requests/109
2018-04-30 13:42:35 -07:00
John Johansen
3f657164f2 Merge branch 'cboltz-dovecot-config' into 'master'
dovecot/config: allow dac_read_search and reading ssl-parameters.dat

See merge request apparmor/apparmor!95

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit 5d973c2657)

c4e60719 dovecot/config: allow dac_read_search and reading ssl-parameters.dat
2018-04-14 21:24:54 +00:00
Christian Boltz
f5c5b80c44 Merge branch 'cboltz-dovecot-profiles' into 'master'
Dovecot profile updates

See merge request apparmor/apparmor!90

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 6b78daf25b)

36bdd6ea add dovecot/stats profile, and allow dovecot to run it
26a8b722 allow dovecot/auth to write /run/dovecot/old-stats-user
2018-04-13 13:57:46 +00:00
Christian Boltz
3cdc2a4ad0 Merge branch 'master' into 'master'
Fix typo in apparmor_parser.pod

See merge request apparmor/apparmor!85

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master

(cherry picked from commit 47da50b7e6)

50ee50f9 Fix typo in apparmor_parser.pod
2018-03-26 19:51:24 +00:00
Christian Boltz
1614db2e78 Merge branch 'cboltz-fix-make-C-profiles' into 'master'
Fix $(PWD) when using "make -C profiles"

See merge request apparmor/apparmor!80

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 14096cb3a7)

20893382 Fix $(PWD) when using "make -C profiles"
2018-03-18 18:29:25 +00:00
Christian Boltz
f59f6052a2 Merge branch 'cboltz-skip-git-dir' into 'master'
ignore .git in is_skippable_dir()

See merge request apparmor/apparmor!77

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 3b5683be29)

f9eb3fea ignore .git in is_skippable_dir()
2018-03-16 21:36:50 +00:00
Steve Beattie
6cf7ef9599 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>

(cherry picked from commit 41b6182019)

8ef7b594 mlmmj-sub: fix moderated subscription
2018-02-22 23:06:52 +00:00
Christian Boltz
eb32ca1a86 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

(cherry picked from commit 0eefeeb0e7)

cb5cdf26 set DBUS_SESSION_BUS_ADDRESS, needed by notify-send
2018-02-17 16:04:09 +00:00
Christian Boltz
2d7b191575 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

(cherry picked from commit 21b0d14ea4)

11e7dab9 Allow to create .nv directory
2018-02-17 15:59:24 +00:00
Christian Boltz
c25c88d06c 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:03:16 +00:00
Christian Boltz
e37782efcd 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 23:00:20 +00:00
John Johansen
00d9997cdd 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>
(cherry picked from commit 3afbfed9ee)
2017-12-24 00:27:39 -08:00
John Johansen
728a622df1 profile: fix syslog-ng startup for some configurations
buglink: https://bugs.launchpad.net/bugs/1739909

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit e55583ff27)
2017-12-24 00:27:30 -08:00
John Johansen
1088961df8 Merge branch 'cboltz-netstat' into 'master'
netstat: allow capability sys_ptrace,

See merge request apparmor/apparmor!46

(cherry picked from commit a3693f56f3)

81ca52d9 netstat: allow capability sys_ptrace,
2017-12-22 21:09:15 +00:00
John Johansen
eaaf23a29c 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>


(cherry picked from commit bcfb735b9a)

bb96e38a abstractions/X: add another location for .Xauthority
2017-12-22 20:21:58 +00:00
John Johansen
39167593ea 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>


(cherry picked from commit f8b208ee80)

06928db1 Update /usr/lib/dovecot/* profiles
2017-12-22 20:20:56 +00:00
Christian Boltz
1a35611abc 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

(cherry picked from commit 6713f9d94a)

f73627cb Fix local pulseaudio config file access
2017-12-17 16:20:26 +00:00
Christian Boltz
bfcb7f8df1 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

(cherry picked from commit 6db30f8faf)

9f24650e Fix signal sending for usr.sbin.dovecot
2017-12-16 17:27:20 +00:00
Tyler Hicks
93336a5d93 Merge branch 'exit-from-Makefile-shell-snippets-2.9' into 'apparmor-2.9'
[2.9] parser, utils: Exit from Makefile shell snippets

See merge request apparmor/apparmor!30

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-12-05 18:46:29 +00:00
Tyler Hicks
29c418ae66 parser, utils: Exit from Makefile shell snippets
Exit rather than returning from shell snippets in Makefiles. It is
reported that returning causes the following error message with bash:

 /bin/sh: line 4: return: can only `return' from a function or sourced script

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Christian Boltz <apparmor@cboltz.de>
2017-12-05 17:56:23 +00:00
Steve Beattie
027e9ce7c9 dovecot: allow capability dac_read_search
Merge branch 'cboltz-dovecot-caps' into 'master'

See merge request 
https://gitlab.com/apparmor/apparmor/merge_requests/16

(cherry picked from commit ca983811fb)

4ef505a6 dovecot: allow capability dac_read_search
2017-12-01 21:21:03 +00:00
Christian Boltz
22fb1dbf08 Merge branch 'cboltz-remove-unknown-newline' into 'master'
Don't print a literal '\n' in aa-remove-unknown help

See merge request apparmor/apparmor!21

Acked-by: Tyler Hicks tyhicks@canonical.com for 2.9..trunk

(cherry picked from commit 3d40bc6f23)

4d4228d1 Don't print a literal '\n' in aa-remove-unknown help
2017-12-01 10:10:33 +00:00
Christian Boltz
4dd366c9c3 Merge branch 'cboltz-dovecot-auth' into 'master'
allow dac_read_search and dac_override for dovecot/auth

See merge request apparmor/apparmor!14


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk

(cherry picked from commit 42bd81df01)

6f6b3c57 allow dac_read_search and dac_override for dovecot/auth
2017-11-27 21:39:20 +00:00
Christian Boltz
800cc21950 Merge branch 'patch-1' into 'master'
Allow to read pulseaudio config subdirectories

See merge request apparmor/apparmor!12


Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9, 2.10, 2.11 and trunk

(cherry picked from commit 4b8b08562a)

9658471d Allow to read pulseaudio config subdirectories
2017-11-18 17:27:37 +00:00
Steve Beattie
c498117fbf
git conversion: move .bzrignore to .gitignore
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2017-10-27 22:46:04 -07:00
intrigeri
23868e3eb0 profiles: allow OpenAL HRTF support in audio abstraction
Merge from trunk commit 3726

The files are "head-related transfer function" data sets, used by
OpenAL for better spatialization of sounds when headphones are detected.

Acked-by: Steve Beattie <steve@nxnw.org>

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874665
2017-10-26 10:31:35 -07:00
Christian Boltz
9b70d50162 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:56:21 +02:00
John Johansen
da132a75fb Bump release version to 2.9.5
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-10-18 22:55:54 -07:00
John Johansen
3aea5913bf Fix af_unix downgrade of network rules
with unix rules we output a downgraded rule compatible with network rules
so that policy will work on kernels that support network socket controls
but not the extended af_unix rules

however this is currently broken if the socket type is left unspecified
(initialized to -1), resulting in denials for kernels that don't support
the extended af_unix rules.

cherry-pick: lp:apparmor r3700
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: timeout
2017-10-18 14:47:41 -07:00
Christian Boltz
6080d9b619 Allow /var/run/dovecot/login-master-notify* in dovecot imap-login profiles
Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.11, 2.10 and 2.9.
2017-09-28 17:49:14 +02:00
Christian Boltz
d62aaf0e1a Merge updated traceroute profile into 2.10 and 2.9 branch
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1057900


------------------------------------------------------------
revno: 3690 [merge]
committer: Steve Beattie <sbeattie@ubuntu.com>
branch nick: apparmor
timestamp: Wed 2017-08-09 08:57:36 -0700
message:
  traceroute profile: support TCP SYN for probes, quite net_admin request
  
  Merge from Vincas Dargis, approved by intrigeri.
  fix traceroute denies in tcp mode
  
  Acked-by: Steve Beattie <steve@nxnw.org>
------------------------------------------------------------


Backport to 2.10 and 2.9 branch

Acked-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-09-12 23:25:37 +02:00
Christian Boltz
051f68a662 abstractions/freedesktop.org: support /usr/local/applications; support subdirs of applications folder
Merge request by Cameron Norman 2015-06-07
https://code.launchpad.net/~cameronnemo/apparmor/abstraction-fdo-applications-fixups/+merge/261336

Acked-by: Christian Boltz <apparmor@cboltz.de> for trunk, 2.11, 2.10 and 2.9
2017-09-10 12:28:54 +02:00
Christian Boltz
85881a877e 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:32:57 +02:00
Christian Boltz
05de7e693e update some Postfix profiles
- change abstractions/postfix-common to allow /etc/postfix/*.db k
- add several permissions to postfix/error, postfix/lmtp and postfix/pipe
- remove superfluous abstractions/kerberosclient from all postfix
  profiles - it's included via abstractions/nameservice


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk
2017-08-22 12:45:14 +02:00
Christian Boltz
9c36523ca0 remove test_multi unconfined-change_hat.profile from 2.10 and 2.9 branch
2.10 branch r3387 and 2.9 branch r3052 (Ignore change_hat events
with error=-1 and "unconfined can not change_hat") accidently added
unconfined-change_hat.profile to the test_multi directory.

2.9 and 2.10 don't support the test_multi *.profile files and error out
in the tests saying "Found unknown file unconfined-change_hat.profile",
therefore delete this file.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-07-31 21:39:17 +02:00
Jamie Strandboge
8b3c98e044 update aa-status.pod for updated podchecker
Bug-Ubuntu: https://launchpad.net/bugs/1707614

Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-07-31 10:23:52 -05:00
Jamie Strandboge
ecab50f62a Adjust python abstraction for python3.6
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-07-26 15:13:24 -05:00
Christian Boltz
e6c890e336 Add --no-reload to various utils manpages
This option exists in several aa-* tools since 2.9, but isn't mentioned
in the manpage.

Also drop some trailing whitespace in the manpages.


Acked-by: John Johansen <john.johansen@canonical.com>
for 2.9, 2.10, 2.11 and trunk.
2017-07-23 21:32:29 +02:00
Christian Boltz
cf9c996cdc dovecot profile: add the attach_disconnected flag
Reported by pfak on IRC

[...] apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/dovecot" name="run/systemd/journal/dev-log" pid=20313 comm="dovecot" requested_mask="w" denied_mask="w" fsuid=0 ouid=0


Acked-by <timeout> for 2.9, 2.10, 2.11 and trunk.
2017-06-29 22:55:18 +02:00
Christian Boltz
69ba59f944 update dovecot-lda profile
dovecot-lda needs
- the attach_disconnected flags
- read access to /usr/share/dovecot/protocols.d/
- rw for /run/dovecot/auth-userdb

References: https://bugs.launchpad.net/bugs/1650827


Acked-by: Steve Beattie <steve@nxnw.org> for 2.9, 2.10 and trunk.
2017-04-07 00:15:40 +02:00
Tyler Hicks
e1415d35db utils: Add aa-remove-unknown utility to unload unknown profiles
https://launchpad.net/bugs/1668892

This patch creates a new utility, with the code previously used in the
init script 'restart' action, that removes unknown profiles which are
not found in /etc/apparmor.d/. The functionality was removed from the
common init script code in the fix for CVE-2017-6507.

The new utility prints a message containing the name of each unknown
profile before the profiles are removed. It also supports a dry run mode
so that an administrator can check which profiles will be removed before
unloading any unknown profiles.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2017-03-24 17:45:41 +00:00
Tyler Hicks
bb6818a8c1 parser: Preserve unknown profiles when restarting apparmor init/job/unit
CVE-2017-6507

https://launchpad.net/bugs/1668892

The common AppArmor 'restart' code used by some init scripts, upstart
jobs, and/or systemd units contained functionality that is no longer
appropriate to retain. Any profiles not found /etc/apparmor.d/ were
assumed to be obsolete and were unloaded. That behavior became
problematic now that there's a growing number of projects that maintain
their own internal set of AppArmor profiles outside of /etc/apparmor.d/.
It resulted in the AppArmor 'restart' code leaving some important
processes running unconfined. A couple examples are profiles managed by
LXD and Docker.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2017-03-24 17:44:38 +00:00
Seth Arnold
c71c36de2c parser: Fix delete after new[] -- patch from Oleg Strikov <oleg.strikov@gmail.com> 2017-03-21 21:46:51 -07:00
Christian Boltz
1e6897f458 Ignore change_hat events with error=-1 and "unconfined can not change_hat"
That's much better than crashing aa-logprof ;-)  (use the log line in
the added testcase if you want to see the crash)

Reported by pfak on IRC.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2017-02-23 01:03:35 +01:00
Christian Boltz
259d925619 Remove re.LOCALE flag
Starting with python 3.6, the re.LOCALE flag can only be used with byte
patterns, and errors out if used with str. This patch removes the flag
in get_translated_hotkey().


References: https://bugs.launchpad.net/apparmor/+bug/1661766


Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9
2017-02-21 18:48:35 +01:00
Steve Beattie
0bcdaa45c0 regression tests: fix environ fail case
merge from trunk commit revision 3630

In the environ regression test, when the exec() of the child process
fails, we don't report FAIL to stdout, so the regression tests consider
it an error rather than a failure and abort, short-circuiting the
test script.

This commit fixes this by emitting the FAIL message when the result
from the wait() syscall indicates the child process did not succeed.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-02-01 21:49:41 -08:00