Commit graph

1442 commits

Author SHA1 Message Date
Jorge Sancho Larraz
78ea948e4b profiles/abstractions/frr: typo 2025-01-07 11:55:37 +01:00
Jorge Sancho Larraz
045bb7d77e profiles/*frr*: fix includes 2025-01-07 11:39:10 +01:00
Jorge Sancho Larraz
e20400f10f profiles/ospf6d: remove duplicated /etc/services r 2025-01-07 11:36:25 +01:00
Jorge Sancho Larraz
63e3a04e30 profiles/abstractions/frr: add owner to world-writable directories 2025-01-07 11:36:17 +01:00
Jörg Sommer
318fb30446 Allow write access to /run/user/*/dconf/user
Gtk applications like Firefox request write access to the file
`/run/user/1000/dconf/user`. The code in `dconf_shm_open` opens the file
with `O_RDWR | O_CREAT`.

4057f8c84f/shm/dconf-shm.c (L68)
2024-12-31 10:23:50 +01:00
Jörg Sommer
c3af6228fd cupsd: convert profile to @etc_ro/rw
While cups itself writes to /etc the others require only read-only access
and might therefore live in /usr/etc.
2024-12-31 10:12:16 +01:00
Jörg Sommer
97d7fa3f5f cupsd: Add /etc/paperspecs read access
Cups uses libpaper which accesses /etc/paperspecs.

ce42216e2e/lib/libpaper.c.in.in (L419)
2024-12-31 10:12:16 +01:00
John Johansen
8c799f4eec Merge Allow python cache under the @{HOME}/.cache/ dir
Starting with Python 3.8, you can use the PYTHONPYCACHEPREFIX environment
variable to define a cache directory for Python [1]. I think most people would set
this dir to @{HOME}/.cache/python/ , so the python abstraction should allow
writing to this location.

[1]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPYCACHEPREFIX

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1467
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-12-24 22:33:28 +00:00
Mikhail Morfikov
03b5a29b05
Allow python cache under the @{HOME}/.cache/ dir
Starting with Python 3.8, you can use the PYTHONPYCACHEPREFIX environment
variable to define a cache directory for Python [1]. I think most people would set
this dir to @{HOME}/.cache/python/ , so the python abstraction should allow
writing to this location.

[1]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPYCACHEPREFIX
2024-12-19 09:33:13 +01:00
Georgia Garcia
f9edc7d4c1 profiles: transmission-gtk needs attach_disconnected
From LP: #2085377, when using ip netns to torrent traffic through a
VPN, attach_disconnected is needed by the policy because ip netns sets
up a mount namespace.

Fixes: https://bugs.launchpad.net/bugs/2085377
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-12-17 09:32:18 -03:00
Alex Murray
3469c62b36
profiles/apparmor.d/rygel: enumerate specific bits for /sys and /dev
Instead of denying everything here, enumerate just the bits that are required
and also deny access to display devices since that is not actually needed by
rygel itself.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-12 13:05:52 +10:30
Alex Murray
472d002a96
profiles/apparmor.d/rygel: allow liborc bits for mx-extract child
mx-extract also uses these parts of gstreamer so allow it as well as for the
main rygel profile.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-12 13:05:06 +10:30
Alex Murray
459e5f9649
profiles/apparmor.d/rygel: allow to create gstreamer cache dir
It is possible this doesn't exist already so allow rygel to create it in that
case.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-12 13:04:33 +10:30
pyllyukko
76dcf46d4f
postfix-smtp profile fix
Allow locking for /var/spool/postfix/pid/unix.relay.
2024-12-10 19:32:49 +02:00
Alex Murray
00e4908d9f
profiles/apparmor.d/rygel: use fd.o abstraction for mx-extract child
This allows access to the freedesktop.org mime info amongst others which is
needed for rygel mx-extract to index files etc.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-10 12:03:14 +10:30
Alex Murray
62cdb6fd79
profiles/apparmor.d/rygel: add DBus rule for MountTracker
Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-10 12:03:00 +10:30
Alex Murray
6a23c26a12
profiles/apparmor.d/rygel: allow liborc temp files
Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-10 12:00:53 +10:30
Alex Murray
29e00fe11f
profiles/apparmor.d/rygel: silence unneeded /{dev,sys} accesses
Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-10 12:00:13 +10:30
Christian Boltz
d305028502
smbd: allow capability chown
This is neeed for "inherit owner = yes" in smb.conf.

From man smb.conf:

    inherit owner (S)

    The ownership of new files and directories is normally governed by
    effective uid of the connected user. This option allows the Samba
    administrator to specify that the ownership for new files and
    directories should be controlled by the ownership of the parent
    directory.

Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1234327
2024-12-09 20:45:42 +01:00
pyllyukko
3c2aae3a22
postfix-showq profile fix
Allow reading queue ID files from /var/spool/postfix/hold/.
2024-12-09 19:23:34 +02:00
Alex Murray
46d994ddcd
profiles/apparmor.d/rygel: allow specific access for /dev bits
It turns out we need to allow /dev/null for fd inheritance and /dev for reading
plus /dev/urandom, all of which are quite safe.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
2024-12-09 13:29:34 +10:30
Hlib Korzhynskyy
cd1dddc222 Remove read_search capability 2024-12-03 16:13:33 -03:30
Hlib Korzhynskyy
aba2d18eb3 Merge with other profile 2024-12-03 10:50:09 -03:30
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
Jorge Sancho Larraz
7ff8f21d04 profiles/*frr*: missing clean up after including abstractions/nameservice-strict to abstraction frr ( 8d644e0d18) 2024-11-07 12:03:57 +01:00
Jorge Sancho Larraz
142d72100c profiles/*frr*: update profiles name 2024-11-07 11:47:42 +01:00
Jorge Sancho Larraz
c63d37f193 profiles/*frr*: add owner to @{PROC}/@{pid}/task/@{tid}/comm rw, 2024-11-07 11:41:10 +01:00
Jorge Sancho Larraz
77b20c9ba1 profiles/*frr*: set # LOGPROF-SUGGEST: no
in frr specific profiles
2024-11-07 11:21:28 +01:00
Jorge Sancho Larraz
8d644e0d18 profiles/*frr*: include abstractions/nameservice-strict 2024-11-07 11:18:03 +01:00
Jorge Sancho Larraz
df917755f2 profiles/*frr*: replace @{DAEMON_NAME} with @{profile_name} 2024-11-07 11:07:17 +01: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
Jorge Sancho Larraz
d48cdea589 profiles/usr.lib.frr.ospfd: add missing rule and use @{pid} and @{tid} 2024-10-17 10:41:01 +02: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
f7c9932c11 Add a profile for ZNC
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2024-10-16 09:44:07 -07: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