Commit graph

1145 commits

Author SHA1 Message Date
Octavio Galland
e296d5b04c follow rule ordering convention 2025-01-23 13:50:27 -03:00
Octavio Galland
790c795f90 always execute binaries under current profile 2025-01-23 13:50:27 -03:00
Octavio Galland
ef0d5b4cde allow networking 2025-01-23 13:50:27 -03:00
Octavio Galland
667816fe43 explictly allow binaries from certain directories 2025-01-23 13:50:27 -03:00
Octavio Galland
e7807b3761 allow any program to be executed 2025-01-23 13:50:27 -03:00
Octavio Galland
29637f19c9 allow more binaries and capabilities 2025-01-23 13:50:27 -03:00
Octavio Galland
5271d6a74a Fix syntax error, use l to specify executable link 2025-01-23 13:50:27 -03:00
Octavio Galland
486c8c26fe Initial profile for tar binary 2025-01-23 13:50:27 -03:00
Zygmunt Krynicki
5c17df0219 profiles: attach toybox profile to /usr/bin/toybox
This is the actual path used on Debian and derivatives.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2025-01-21 11:16:24 +01:00
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
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
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
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
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
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
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