Commit graph

1410 commits

Author SHA1 Message Date
Hlib Korzhynskyy
841cedb976 Remove root listing 2024-11-29 09:05:23 -03:30
Hlib Korzhynskyy
e448885b76 Add lsblk profile 2024-11-28 15:37:48 -03:30
John Johansen
1979af7710 profiles: update bwrap profile
Update the bwrap profile so that it will attach to application profiles
if present.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2024-11-26 09:52:17 -08:00
pyllyukko
0a5a9c465f Dovecot profile: Allow reading of /proc/sys/kernel/core_pattern
See <https://dovecot.org/bugreport.html>
2024-11-21 16:21:17 +02:00
Paulo Flabiano Smorigo
74f7e9c295
remmina: add dconf abstraction and use {etc_ro} for /etc path
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>
2024-11-06 12:40:07 -03:00
Giampaolo Fresi Roglia
06dbaca1c8 apply suggestions from @georgiag 2024-11-06 11:29:14 +01:00
John Johansen
3c40aab1a0 Merge profiles: update dconf abstraction to use @{etc_ro}
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1402
Approved-by: Ryan Lee <rlee287@yahoo.com>
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-11-06 03:06:57 +00:00
Georg Pfuetzenreuter
f575817b68
php-fpm: widen allowed socket paths
It is common for packaged PHP applications to ship a PHP-FPM
configuration using a scheme of "$app.sock" or or "$app.socket" instead
of using a generic FPM socket.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-11-05 20:03:11 +01:00
Georgia Garcia
cbe8d295a5 profiles: update dconf abstraction to use @{etc_ro}
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-10-31 09:52:07 +01:00
Georgia Garcia
f7b5d0e783 Merge Improvements to Postfix profiles
* Support /usr/libexec/postfix/ path
* Added abstractions/{nameservice,postfix-common} to postfix-postscreen
* Added postfix-tlsproxy, postscreen & spawn to postfix-master
    * Added missing postfix-tlsproxy profile
* Added postscreen cache map (see <https://www.postfix.org/postconf.5.html#postscreen_cache_map>)
* Added /{var/spool/postfix/,}pid/pass.smtpd to postfix-smtpd

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1330
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-10-30 10:43:47 +00:00
Christian Pfeiffer
6a5432b2b0 profiles: add support for ArchLinux php-legacy package to php-fpm
ArchLinux ships a secondary PHP package called php-legacy with different
paths. As of now, the php-fpm profile will cover this binary but
inadequately restrict it.

Fixes: #454
2024-10-30 09:39:37 +01:00
pyllyukko
4ccf567d31 Improvements to Postfix profiles
* Support /usr/libexec/postfix/ path
* Added abstractions/{nameservice,postfix-common} to postfix-postscreen
* Added postfix-tlsproxy, postscreen & spawn to postfix-master
    * Added missing postfix-tlsproxy profile
* Added postscreen cache map (see <https://www.postfix.org/postconf.5.html#postscreen_cache_map>)
* Added /{var/spool/postfix/,}pid/pass.smtpd to postfix-smtpd
2024-10-29 20:35:28 +02:00
John Johansen
4fe3e30abc Merge abstractions/nameservice: include nameservice-strict
... and drop all rules it contains from abstractions/nameservice.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1373
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-10-29 15:26:43 +00:00
John Johansen
82a4e70248 Merge zgrep: deny passwd access
Bash will try to read the passwd database to find the shell of a user if
$SHELL is not set. This causes zgrep to trigger

```
apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/nsswitch.conf" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/passwd" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
```

if called in a sanitized environment. As the functionality of zgrep is
not impacted by a limited Bash environment, add deny rules to avoid the
potentially misleading AVC messages.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1361
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-10-29 13:50:06 +00:00
John Johansen
e48ab421b5 Merge Check if all profiles and abstractions contain abi/4.0
... and add abi/4.0 where it was missing

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1358
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-10-29 12:48:41 +00:00
John Johansen
ab16377838 Merge zgrep: allow reading /etc/nsswitch.conf and /etc/passwd
Seen on various VMs, my guess is that bash wants to translate a uid to a
username.

Log events (slightly shortened)

apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/nsswitch.conf" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/passwd" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

I propose this patch for 3.0..master

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1357
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-10-29 12:45:48 +00:00
Steve Beattie
4d3b094d9e profiles: transmission-daemon needs attach_disconnected
Systemd's PrivateTmp= in transmission service is causing mount namespaces to be used leading to disconnected paths

[395201.414562] audit: type=1400 audit(1727277774.392:573): apparmor="ALLOWED" operation="sendmsg" class="file" info="Failed name lookup - disconnected path" error=-13 profile="transmission-daemon" name="run/systemd/notify" pid=193060 comm="transmission-da" requested_mask="w" denied_mask="w" fsuid=114 ouid=0

Fixes: https://bugs.launchpad.net/bugs/2083548
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1355
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Steve Beattie <steve+gitlab@nxnw.org>
2024-10-18 21:47:09 +00:00
Ryan Lee
c1480d761f Merge Future-proof the Python abstraction for beyond Python 3.19
See https://gitlab.com/apparmor/apparmor/-/merge_requests/1376#note_2161284748

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1381
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Ryan Lee <rlee287@yahoo.com>
2024-10-16 22:27:21 +00:00
Ryan Lee
8eb7e7f63b Future-proof the Python abstraction for beyond Python 3.19
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2024-10-16 09:36:32 -07:00
Giampaolo Fresi Roglia
5be4295b5a
abstractions/nameservice: tighten libnss_libvirt file access 2024-10-16 10:48:03 +02:00
Paulo Flabiano Smorigo
2ff8ec918b
remmina: make access inside $HOME more restricted
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>
2024-10-14 12:24:42 -03:00
Nishit Majithia
fda39282bd socat: use upstream nameservice-strict
Signed-off-by: Nishit Majithia <nishit.nm@gmail.com>
2024-10-14 13:00:14 +05:30
Nishit Majithia
39bb6606a8 socat: add profile
Signed-off-by: Nishit Majithia <nishit.nm@gmail.com>
2024-10-14 13:00:14 +05:30
Paulo Flabiano Smorigo
d3dd7b6d40
remmina: Add ubuntu-helpers as required by ubuntu-browsers
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>
2024-10-11 16:15:15 -03:00
Paulo Flabiano Smorigo
4009fd77f1
remmina: Add child profile to enable browser calls, add more dbus
Also add a rule to import and export profiles and change abi to 4.0.

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@gmail.com>
2024-10-11 15:59:09 -03:00
Christian Boltz
372ad8f6b9
abstractions/nameservice: include nameservice-strict
... and drop all rules it contains from abstractions/nameservice.
2024-10-11 20:53:52 +02:00
Alexandre Pujol
1966c36c1d
abstraction: add missing abi in nameservice-strict. 2024-10-09 21:42:48 +01:00
Alexandre Pujol
62e7220271
abstraction: include nss-systemd in nameservice-strict. 2024-10-09 21:25:57 +01:00
Alexandre Pujol
1a8d8f3695
abstraction: add nameservice-strict.
Imported from gitlab.com/roddhjav/apparmor.d
2024-10-09 19:57:16 +01:00
Giampaolo Fresi Roglia
e53f300821
nameservice: add support for libnss-libvirt 2024-10-09 10:12:26 +02:00
Giampaolo Fresi Roglia
b496786a18
apparmor.d/tnftp: remove unnecessary includes 2024-10-08 10:11:29 +02:00
Giampaolo Fresi Roglia
6b0dcf9627
apparmor.d/tnftp: fix deny write rule 2024-10-07 11:33:44 +02:00
Giampaolo Fresi Roglia
aca065a208
apparmor.d/tnftp: add missing @{HOME} rule 2024-10-07 11:30:30 +02:00
Giampaolo Fresi Roglia
42cd79e3db
apparmor.d: add tnftp profile 2024-10-07 11:30:17 +02:00
Georg Pfuetzenreuter
48483f2ff8
zgrep: deny passwd access
Bash will try to read the passwd database to find the shell of a user if
$SHELL is not set. This causes zgrep to trigger

```
apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/nsswitch.conf" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/passwd" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
```

if called in a sanitized environment. As the functionality of zgrep is
not impacted by a limited Bash environment, add deny rules to avoid the
potentially misleading AVC messages.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-06 23:18:52 +02:00
Christian Boltz
8c80c56252
Check if all profiles and abstractions contain abi/4.0
... and add abi/4.0 where it was missing
2024-10-06 12:07:58 +02:00
Christian Boltz
68d42c3e37
zgrep: allow reading /etc/nsswitch.conf and /etc/passwd
Seen on various VMs, my guess is that bash wants to translate a uid to a
username.

Log events (slightly shortened)

apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/nsswitch.conf" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

apparmor="DENIED" operation="open" class="file" profile="zgrep" name="/etc/passwd" comm="zgrep" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2024-10-06 11:05:52 +02:00
Georgia Garcia
645320ae84 profiles: transmission-daemon needs attach_disconnected
Systemd's PrivateTmp= in transmission service is causing mount namespaces to be used leading to disconnected paths

[395201.414562] audit: type=1400 audit(1727277774.392:573): apparmor="ALLOWED" operation="sendmsg" class="file" info="Failed name lookup - disconnected path" error=-13 profile="transmission-daemon" name="run/systemd/notify" pid=193060 comm="transmission-da" requested_mask="w" denied_mask="w" fsuid=114 ouid=0

Fixes: https://bugs.launchpad.net/bugs/2083548
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-10-04 10:54:48 -03:00
Paulo Flabiano Smorigo
eeabac1db4
remmina: include more abstractions and fix permissions
- Use format "profile remmina /usr/bin/remmina";
 - Add more abstractions and remove network rules since they are include
   in nameservice;
 - Add thumbnails and gvfsd conditions after more tests;

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@gmail.com>
2024-10-03 10:57:22 -03:00
Paulo Flabiano Smorigo
b08d04dab9
Add remmina profile
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>
2024-10-02 18:21:30 -03:00
Christian Boltz
4b6df10fe3 Merge ping: allow reading /proc/sys/net/ipv6/conf/all/disable_ipv6
Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1082190

I propose this patch for 3.0..master.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1340
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2024-09-30 21:42:56 +00:00
Christian Boltz
df4d7cb8da
ping: allow reading /proc/sys/net/ipv6/conf/all/disable_ipv6
Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1082190
2024-09-27 12:05:29 +02:00
Christian Boltz
49b9a20997
abstractions/mesa: allow ~/.cache/mesa_shader_cache_db/
... which is used by Mesa 24.2.2

Reported by darix.

Fixes: https://bugs.launchpad.net/bugs/2081692
2024-09-24 16:39:52 +02:00
Alex Murray
3731488ab6
profiles/apparmor.d/tunables/rygel: add back include if exists
This allows a user to create this file if they wish even though we don't
actually ship it directly.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-09-06 20:30:14 +09:30
Alex Murray
c9f8c97021
profiles/apparmor.d/tunables: remove rygel.d tunable
This is unnecessary, users can just directly edit tunables/rygel if they wish to
customise the allowed paths.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-09-03 11:19:27 +09:30
John Johansen
74f254212a Merge profiles: enable php-fpm in /usr/bin and /usr/sbin
To enable the profile in distros that merge sbin into bin.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/421
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

Closes #421
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1301
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-08-29 18:46:47 +00:00
John Johansen
cf3428f774 Merge profiles: slirp4netns: allow pivot_root
`pivot_root` is required for running `slirp4netns --enable-sandbox` inside LXD.
- https://github.com/rootless-containers/slirp4netns/issues/348
- https://github.com/rootless-containers/slirp4netns/blob/v1.3.1/sandbox.c#L101-L234

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1298
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-08-29 18:44:15 +00:00
Alex Murray
df189243d1
profiles/apparmor.d/rygel: deny noise unneeded read of /sys
gst-plugin-scanner wants to try and scan hardware devices but since rygel itself
doesn't  actually use or need any access to such devices the access to these can
be denied and any log spam silenced via an explicit denial rule.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-08-23 19:45:30 +09:30
Alex Murray
37555e876c
profiles/apparmor.d/rygel: introduce rygel tunable
Allow more easy customisation of the paths allowed to rygel by introducing a
tunable which provides the @{rygel_media_dirs} variable and an example
site-local file to show how this can be easily extended. Essentially this
follows the same logic as the home tunable with @{HOME}.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-08-23 19:42:47 +09:30
Alex Murray
8ae0a531e2
profiles/apparmor.d: add rygel profile
Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-08-22 12:12:53 +09:30