- 19 Apr, 2022 1 commit
-
-
John Johansen authored
The snap_browsers abstraction requires more permissions due to updates on snaps. Some of the permissions are not required in older versions of Ubuntu that use 2.12 and 2.13, but are introduced for unification and ease of maintenance purposes. These include: ``` all dbus permissions, @{PROC}/sys/kernel/random/uuid r, owner @{PROC}/@{pid}/cgroup r, /var/lib/snapd/sequence/{chromium,firefox,opera}.json r, ``` I also propose a cherry-pick of this commit to 2.12, 2.13 and 3.0 MR: !877 Approved-by:
John Johansen <john@jjmx.net> Merged-by:
John Johansen <john@jjmx.net> (cherry picked from commit bfa67b36 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 25 Mar, 2022 1 commit
-
-
Christian Boltz authored
similar to commit 2f9d172c we discovered that there was a service outage when dovecot tried to send a usr1 signal type=AVC msg=audit(1648024138.249:184964): apparmor="DENIED" operation="signal" profile="dovecot" pid=1690 comm="dovecot" requested_mask="send" denied_mask="send" signal=usr1 peer="dovecot-imap-login" MR: !865 Approved-by:
Christian Boltz <apparmor@cboltz.de> Merged-by:
Christian Boltz <apparmor@cboltz.de> (cherry picked from commit 83685ba7) f0919f83 Allow dovecot to use all signals
-
- 17 Mar, 2022 1 commit
-
-
Georgia Garcia authored
Whenever the evince deb package tries to open a snap browser which was selected as the default, we get the following denial: audit[2110]: AVC apparmor="DENIED" operation="exec" profile="/usr/bin/evince" name="/usr/bin/snap" pid=2110 comm="env" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0 As a short-term solution, we are adding a snap-browsers profile which restricts what snaps opened by evince can do. The long-term solution is currently not available, but could be accomplished by using enhanced environment variable filtering/mediation and delegation of open fds. Bug: https://launchpad.net/bugs/1794064 Signed-off-by:
Georgia Garcia <georgia.garcia@canonical.com> (cherry picked from commit fb3283f3) MR: !863 Signed-off-by:
Georgia Garcia <georgia.garcia@canonical.com>
-
- 13 Mar, 2022 1 commit
-
-
John Johansen authored
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1195463#c10 I propose this patch for 3.0 and master. (<= 2.13 don't have the samba-bgpd profile - if we want to backport to 2.x, we'll have to pick only the smbd part.) Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1195463#c10 MR: !862 Approved-by:
John Johansen <john@jjmx.net> Merged-by:
John Johansen <john@jjmx.net> backport: drop ../profiles/apparmor.d/samba-bgqd (cherry picked from commit c3f64513 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 10 Mar, 2022 1 commit
-
-
John Johansen authored
If apparmor_parser -N (in profiles_names_list()) fails, aa-remove-unknown possibly gets an incomplete list of profiles in /etc/apparmor.d/ and therefore might remove more profiles than it should. Replace the profiles_names_list() call with a direct apparmor_parser call, and abort aa-remove-unknown if it exits with $? != 0 Before: ``` aa-remove-unknown -n AppArmor parser error for /etc/apparmor.d/broken in profile /etc/apparmor.d/broken at line 1: syntax error, unexpected TOK_ID, expecting TOK_OPEN Would remove 'delete_me' ``` After: ``` ./aa-remove-unknown -n AppArmor parser error for /etc/apparmor.d in profile /etc/apparmor.d/zbroken at line 1: syntax error, unexpected TOK_ID, expecting TOK_OPEN apparmor_parser exited with failure, aborting. ``` And of course, after fixing the broken profile: ``` ./aa-remove-unknown -n Would remove 'delete_me' ``` (cherry picked from commit 5053a01d) This backports the fix in `aa-remove-unknown` from !836, but doesn't backport the cleanup in `rc.apparmor.functions`. I propose this patch for 3.0 and all 2.x branches. MR: !859 Approved-by:
Georgia Garcia <georgia.garcia@canonical.com> Merged-by:
John Johansen <john@jjmx.net> (cherry picked from commit c6324c2a ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 17 Jan, 2022 1 commit
-
-
John Johansen authored
These directories were introduced in openssl in https://patchwork.ozlabs.org/project/openwrt/patch/20210429153530.10020-2-cotequeiroz@gmail.com/ I propose this patch for 3.0 and master. Optionally also for older branches, even if it's unlikely that systems using 2.13.x or older get a new-enough openssl to need this ;-) MR: !818 Acked-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 2b270216 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 30 Oct, 2021 1 commit
-
-
John Johansen authored
Fixes: #203 MR:!811 Acked-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit ee9e61aa ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 26 Aug, 2021 1 commit
-
-
Adding everything up to 3.19 should make the file future-proof for a while ;-) Fixes: #193 MR: !795 Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 4559a299 ) Signed-off-by:
Steve Beattie <steve.beattie@canonical.com>
-
- 20 Aug, 2021 1 commit
-
-
Christian Boltz authored
add a missing slash at the end of the sys rule See merge request !791 Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.12..master (cherry picked from commit 4fd7bcc2) b3dcd02d add a missing slash at the end of the sys rule
-
- 17 Aug, 2021 1 commit
-
-
Christian Boltz authored
Fix typo in manpage Closes #192 See merge request !789 Acked-by: Acked-by: Seth Arnold <seth.arnold@canonical.com> for all branches (cherry picked from commit 131ae842) 1459f49b Fix typo in manpage
-
- 13 Aug, 2021 1 commit
-
-
John Johansen authored
Add support for python 3.10 in abstractions and profiles. Fixes: #187 MR: !783 Acked-by:
John Johansen <john.johansen@canonical.com> (backported from commit 31fda3ee ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 21 Jul, 2021 1 commit
-
-
John Johansen authored
Patch by Michael Ströder <michael@stroeder.com> MR: !776 Acked-by:
John Johansen <john@jjmx.net> (cherry picked from commit d8ec3daf ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 14 Jul, 2021 1 commit
-
-
John Johansen authored
Currently for directory includes the directory timestamp is ignored. This is wrong as operations like removing a file from the dir won't be considered in the timestamp check. Fix this by updating the timestamp check to include the included directories timestamp. MR: !760 Signed-off-by:
John Johansen <john@jjmx.net> Acked-by:
Georgia Garcia <georgia.garcia@canonical.com> (cherry picked from commit 3d1232e6)
-
- 28 Jun, 2021 1 commit
-
-
Georgia Garcia authored
The following errors are happening on the regression tests of i18n.sh on arm64 hirsute/impish: Error: open failed. Test 'i18n (194) OPEN (octal) "/tmp/sdtest.3654-6536-J2ZwFM/file__post" RW' was expected to 'pass'. Reason for failure 'FAIL: open /tmp/sdtest.3654-6536-J2ZwFM/file__post failed - Permission denied' ... The cause is a bash bug handling UTF-8 on subshells. Fixes: https://bugs.launchpad.net/apparmor/+bug/1932331 MR: !765 Signed-off-by:
Georgia Garcia <georgia.garcia@canonical.com> Acked-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 458a981b ) Signed-off-by:
Georgia Garcia <georgia.garcia@canonical.com>
-
- 24 May, 2021 1 commit
-
-
Christian Boltz authored
Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1186267 MR: !755 (cherry picked from commit 5853f522 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 31 Mar, 2021 1 commit
-
-
John Johansen authored
dhclient wants to set its thread names to functional names for introspection purposes. Eg. $ pstree -at 3395 dhclient ens3 ├─{isc-socket} ├─{isc-timer} └─{isc-worker0000} When denied this can result in dhclient breaking and failing to obtain IPv4 addresses. Fixes: https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1918410 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Christian Boltz <apparmor@cboltz.de> (cherry picked from commit c7348395 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 16 Mar, 2021 1 commit
-
-
John Johansen authored
The following AppArmor denial errors are shown on startup: Oct 25 00:52:00 xxx kernel: [ 556.231990] audit: type=1400 audit(1603601520.710:32): apparmor="DENIED" operation="open" profile="/usr/sbin/dhcpd" name="/proc/sys/net/ipv4/ip_local_port_range" pid=1982 comm="dhcpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 Oct 25 00:52:00 xxx kernel: [ 556.232257] audit: type=1400 audit(1603601520.710:33): apparmor="DENIED" operation="open" profile="/usr/sbin/dhcpd" name="/proc/sys/net/ipv4/ip_local_port_range" pid=1982 comm="dhcpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 Fixes: https://bugs.launchpad.net/bugs/1901373 MR: !726 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 277677da ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 15 Mar, 2021 1 commit
-
-
John Johansen authored
The parser is failing to properly filter the slashes in the link name after variable expansion. Causing match failures when multiple slashes occur. Fixes: #153 MR: !723 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 2852e1ec ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 14 Mar, 2021 3 commits
-
-
Mikhail Morfikov authored
Currently the wutmp abstraction has the following rules: /var/log/lastlog rwk, /var/log/wtmp wk, @{run}/utmp rwk, According to what I see in my apparmor profiles, just a few apps want to interact with the files listed above, especially with the /var/log/wtmp . But when the apps do this, they sometimes want the read access to this file. An example could be the last command. Is there any reason for not having the r in the rule? The second thing is the file /var/log/btmp (which isn't included in the abstracion). Whenever I see an app, which wants to access the /var/log/wtmp file, it also tries to interact with the /var/log/btmp file, for instance lightdm/sddm or su . Most of the time they need just wk permissions, but sometimes apps need also r on this file, an example could be the lastb command, which is just a link to last. Fixes: #152 MR: !724 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit d4e0a945 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
John Johansen authored
The backport of 855dbd4a parser: fix rule downgrade for unix rules using the rule_t::warn_once which doesn't exist in the 2.x parser series. Switch this the the static function warn_once. 8b481b5f parser: fix rule downgrade for unix rules Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
John Johansen authored
Rule downgrades are used to provide some confinement when a feature is only partially supported by the kernel. Eg. On a kernel that doesn't support fine grained af_unix mediation but does support network mediation. unix (connect, receive, send) type=stream peer=(addr="@/tmp/.ICE-unix/[0-9]*"), will be downgraded to network unix type=stream, Which while more permissive still provides some mediation while allowing the appication to still function. However making the rule a deny rule result in tightening the profile. Eg. deny unix (connect, receive, send) type=stream peer=(addr="@/tmp/.ICE-unix/[0-9]*"), will be downgraded to deny network unix type=stream, and that deny rule will take priority over any allow rule. Which means that if the profile also had unix allow rules they will get blocked by the downgraded deny rule, because deny rules have a higher priority, and the application will break. Even worse there is no way to add the functionality back to the profile without deleting the offending deny rule. To fix this we drop deny rules that can't be downgraded in a way that won't break the application. Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1180766 MR: !700 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 855dbd4a ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 12 Feb, 2021 2 commits
-
-
Rose Kunkel authored
My main user account is managed by systemd-homed. When I enable AppArmor and have nscd running, I get inconsistent behavior with my user account - sometimes I can't log in, sometimes I can log in but not use sudo, etc. This is the output of getent passwd: $ getent passwd root:x:0:0::/root:/usr/bin/zsh bin:x:1:1::/:/sbin/nologin daemon:x:2:2::/:/sbin/nologin mail:x:8:12::/var/spool/mail:/sbin/nologin ftp:x:14:11::/srv/ftp:/sbin/nologin http:x:33:33::/srv/http:/sbin/nologin nobody:x:65534:65534:Nobody:/:/sbin/nologin dbus:x:81:81:System Message Bus:/:/sbin/nologin [...] rose:x:1000:1000:Rose Kunkel:/home/rose:/usr/bin/zsh But getent passwd rose and getent passwd 1000 both return no output. Stopping nscd.service fixes these problems. Checking the apparmor logs, I noticed that nscd was denied access to /etc/machine-id. Allowing access to that file seems to have fixed the issue. MR: !707 Fixes: #145 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit ee5303c8 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
Seth Arnold authored
Ubuntu 18.04, Firefox 60.0.1+build2-0ubuntu0.18.04.1 Running firefix, then going to netflix.com and attempting to play a movie. The widevinecdm plugin crashes, the following is found in syslog: Jun 15 19:13:22 xplt kernel: [301351.553043] audit: type=1400 audit(1529046802.585:246): apparmor="DENIED" operation="file_mmap" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/xav/.mozilla/firefox/wiavokxk.default-1510977878171/gmp-widevinecdm/1.4.8.1008/libwidevinecdm.so" pid=16118 comm="plugin-containe" requested_mask="m" denied_mask="m" fsuid=1000 ouid=1000 Jun 15 19:13:22 xplt kernel: [301351.553236] audit: type=1400 audit(1529046802.585:247): apparmor="DENIED" operation="ptrace" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" pid=24714 comm="firefox" requested_mask="trace" denied_mask="trace" peer="/usr/lib/firefox/firefox{,*[^s][^h]}" Jun 15 19:13:22 xplt kernel: [301351.553259] plugin-containe[16118]: segfault at 0 ip 00007fcdfdaa76af sp 00007ffc1ff03e28 error 6 in libxul.so[7fcdfb77a000+6111000] Jun 15 19:13:22 xplt snmpd[2334]: error on subcontainer 'ia_addr' insert ... Fixes: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1777070 Reported-by:
Xav Paice <xav.paice@canonical.com> MR: !684 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 656f2103 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 11 Feb, 2021 1 commit
-
-
John Johansen authored
job scaling allows the parser to resample the number of cpus available and increase the number of jobs that can be launched if cpu available increases. Unfortunately job scaling was being applied even when a fixed number of jobs was specified. So --jobs=2 doesn't actually clamp the compile at 2 jobs. Instead job scaling should only be applied when --jobs=auto or when jobs are set to a multiple of the cpus. MR: !703 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 65ba20b9)
-
- 11 Dec, 2020 1 commit
-
-
Christian Boltz authored
MR: !690 (cherry picked from commit c421fcd3 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 28 Nov, 2020 1 commit
-
-
Christian Boltz authored
So far, aa-autodep "accidently" loaded the abstractions when parsing the existing profiles. Obviously, this only worked if there is at least one profile in the active or extra profile directory. Without any existing profiles, aa-autodep crashed with KeyError: '/tmp/apparmor.d/abstractions/base' Prevent this crash by explicitely loading the abstractions on start. Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1178527#c1 [1] MR: !682 (cherry picked from commit f6b3de71 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 17 Nov, 2020 1 commit
-
-
Christian Boltz authored
... (/var/cache/libx11/compose/*), and deny any write attempts Reported by darix, https://git.nordisch.org/darix/apparmor-profiles-nordisch/-/blob/master/apparmor.d/teams MR: !685 (cherry picked from commit 78bd811e ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 03 Nov, 2020 1 commit
-
-
John Johansen authored
This is needed to catch conflicts between uppercase and lowercase hotkeys of the same letter, as seen with `(B)enannt` and `A(b)lehnen` in the german utils translations. (cherry picked from commit 07bd1139) Also fix hotkey conflict in utils id.po (cherry picked from commit 7cf54f2c / ca0d9f75) Note that the original commit also included fixes for de.po and sv.po which are not needed in the 2.12 branch. This is the 2.12 variant of MR: !675. MR: !679 Acked-by:
John Johansen <john.johansen@canonical.com>
-
- 01 Nov, 2020 2 commits
-
-
Christian Boltz authored
(cherry picked from commit 7cf54f2c / ca0d9f75) Note that the original commit also included fixes for de.po and sv.po which are not needed in the 2.12 branch.
-
Christian Boltz authored
This is needed to catch conflicts between uppercase and lowercase hotkeys of the same letter, as seen with `(B)enannt` and `A(b)lehnen` in the german utils translations. (cherry picked from commit 07bd1139)
-
- 26 Oct, 2020 2 commits
-
-
Vincas Dargis authored
Dovecot is hit with this denial on Debian 10 (buster): ``` type=AVC msg=audit(1603647096.369:24514): apparmor="DENIED" operation="open" profile="dovecot" name="/usr/share/dovecot/dh.pem" pid=28774 comm="doveconf" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 ``` This results in fatal error: ``` Oct 25 19:31:36 dovecot[28774]: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 50: ssl_dh: Can't open file /usr/share/dovecot/dh.pem: Permission denied ``` Add rule to allow reading dh.pem. MR: !671 (cherry picked from commit 9d8e111a ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
Vincas Dargis authored
Dovecot might try to kill related processes: ``` type=AVC msg=audit(1601314853.031:9327): apparmor="DENIED" operation="signal" profile="dovecot" pid=21223 comm="dovecot" requested_mask="send" denied_mask="send" signal=kill peer="/usr/lib/dovecot/auth" type=AVC msg=audit(1601315453.655:9369): apparmor="DENIED" operation="signal" profile="dovecot" pid=21223 comm="dovecot" requested_mask="send" denied_mask="send" signal=kill peer="/usr/lib/dovecot/pop3" type=AVC msg=audit(1602939754.145:101362): apparmor="DENIED" operation="signal" profile="dovecot" pid=31632 comm="dovecot" requested_mask="send" denied_mask="send" signal=kill peer="/usr/lib/dovecot/pop3-login" ``` This discovered on low-power high-load machine (last resort timeout handling?). Update signal rule to allow SIGKILL. MR: !671 (cherry picked from commit 2f9d172c ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 15 Oct, 2020 1 commit
-
-
Christian Boltz authored
MR: !656 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 2c2dbdc3)
-
- 09 Oct, 2020 3 commits
-
-
John Johansen authored
The mnt_point and devices conditionals in mount rules are generally paths and should have slashes filtered after variable expansion. MR: !607 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit a1978fb1 ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
John Johansen authored
Similar to unix addr rules, the dbus path conditional is more a path than a profile name and should get its slashes filtered after variable expansion. MR: !607 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 35f6d49e ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
John Johansen authored
Currently mount options type= and options= do not expand variables but they should. Fix it. Note: this does not treat either as paths because their use is too device dependent for it to be safe to filter slashes. Fixes: #99 MR: !638 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 882380ad ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
- 03 Oct, 2020 2 commits
-
-
Patrick Steinhardt authored
While `include/sys/apparmor.h` makes use of `socklen_t`, it doesn't include the `<sys/socket.h>` header to make its declaration available. While this works on systems using glibc via transitive includes, it breaks compilation on musl libc. Fix the issue by including the header. Signed-off-by:
Patrick Steinhardt <ps@pks.im> (cherry picked from commit 47263a3a ) Signed-off-by:
John Johansen <john.johansen@canonical.com>
-
Patrick Steinhardt authored
While `_aa_asprintf` is supposed to be of private visibility, it's used by apparmor_parser and thus required to be visible when linking. This commit thus adds it to the list of private symbols to make it available for linking in apparmor_parser. MR: !643 Signed-off-by:
Patrick Steinhardt <ps@pks.im> (cherry picked from commit 9a8fee6b)
-
- 29 Sep, 2020 2 commits
-
-
John Johansen authored
The parser is not treating unix addr as a path and filtering slashes after variable expansion. This can lead to errors where @{foo}=/a/ unix bind addr=@{foo}/bar, will always fail because addr is being matched as /a//bar instead of /a/bar. MR: !607 Fixes: https://bugs.launchpad.net/apparmor/+bug/1856738 Signed-off-by:
John Johansen <john.johansen@canonical.com> (cherry picked from commit 6af05006)
-
John Johansen authored
sys/sysctl.h is not guaranteed to exist anymore since https://sourceware.org/pipermail/glibc-cvs/2020q2/069366.html which is a follow on to the kernel commit 61a47c1ad3a4 sysctl: Remove the sysctl system call While the syscall_sysctl currently checks if the kernel supports sysctrs before running the tests. The tests can't even build if the kernel headers don't have the sysctl defines. Fixes: #119 Fixes: https://bugs.launchpad.net/apparmor/+bug/1897288 MR: !637 Signed-off-by:
John Johansen <john.johansen@canonical.com> Acked-by:
Steve Beattie <steve.beattie@canonical.com> (cherry picked from commit 2e5a266e)
-