2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00

1595 Commits

Author SHA1 Message Date
John Johansen
f8b5e5d9a4 Merge profiles: provide backwards compat for hwctl profile
The hwctl profile is being carried upstream, so we can keep it in
sync, but is being packaged from the regular profile set so that it
can be part of a package that is SRUed (ubuntu stable release update)
separate from the rest of apparmor, and its profiles.

Provide backwards compat with older parser to reduce the amount of
distro patching that is needed.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1705
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
2025-06-02 21:43:59 +00:00
John Johansen
df41185eb2 profiles: provide backwards compat for hwctl profile
The hwctl profile is being carried upstream, so we can keep it in
sync, but is being packaged from the regular profile set so that it
can be part of a package that is SRUed (ubuntu stable release update)
separate from the rest of apparmor, and its profiles.

Provide backwards compat with older parser to reduce the amount of
distro patching that is needed.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-05-30 13:24:17 -07:00
Ryan Lee
f826e1dbea Allow noexec mounts in fusermount3 profile
The permissive flags should be revisited once we have rule delegation

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-27 15:40:21 -04:00
Nadzeya H
cd7586776c
remove dpkg and lsb_release usage in usr.bin.hwctl 2025-05-23 17:16:55 +02:00
Maxime Bélair
97dc70606b Merge add apparmor profile for dig
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1525
Approved-by: Ryan Lee <rlee287@yahoo.com>
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-21 14:48:05 +00:00
Shishir Subedi
be143350fd add apparmor profile for dig 2025-05-21 14:48:05 +00:00
John Johansen
e55646c41c Merge profiles: only include tests extras/abstractions/ if it exists
profiles make check was showing an error because
profiles/extras/abstractions didn't exist, so only include tests for
it if it exists. This commit also deduplicates the abstractions test.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1687
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-14 12:15:57 +00:00
Georgia Garcia
52da04d951 profiles: only include tests extras/abstractions/ if it exists
profiles make check was showing an error because
profiles/extras/abstractions didn't exist, so only include tests for
it if it exists. This commit also deduplicates the abstractions test.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-05-14 12:08:01 +02:00
Ryan Lee
e36b57857f profiles: give lsof network netlink dgram permissions
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-14 09:45:53 +02:00
John Johansen
84c3e629e4 Merge unix-chkpwd: Add read capability to profile
Following the Security Technical Implementation Guide, it is better to
set the permissions to 0000 for the shadow file.
However, since PAM version 1.6.0, after this change [0], unix-chkpwd
will unconditionnaly read the shadow file. And with the previous
restriction, the binary has an access denied to the shadow which
blocks user authentications. Moreover the PAM changes is needed to fix
the CVE-2024-10041.
Giving the read caability to the unix-chkpwd profile allows it to
function properly. See bug report [1].

[0] - https://github.com/linux-pam/linux-pam/pull/686
[1] - https://bugzilla.suse.com/show_bug.cgi?id=1241678

Signed-off-by: vlefebvre <valentin.lefebvre@suse.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1685
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-13 16:00:21 +00:00
Maxime Bélair
c8dc701666 Merge Add netcat-openbsd profile
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1327
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-13 07:22:31 +00:00
vlefebvre
556396a172 unix-chkpwd: Add read capability to profile
Following the Security Technical Implementation Guide, it is better to
set the permissions to 0000 for the shadow file.
However, since PAM version 1.6.0, after this change [0], unix-chkpwd
will unconditionnaly read the shadow file. And with the previous
restriction, the binary has an access denied to the shadow which
blocks user authentications. Moreover the PAM changes is needed to fix
the CVE-2024-10041.
Giving the read caability to the unix-chkpwd profile allows it to
function properly. See bug report [1].

[0] - https://github.com/linux-pam/linux-pam/pull/686
[1] - https://bugzilla.suse.com/show_bug.cgi?id=1241678

Signed-off-by: vlefebvre <valentin.lefebvre@suse.com>
2025-05-12 15:53:33 +00:00
Maxime Bélair
2e875f22fe Merge profiles: small fix for gs profile
Allow gs to run from confined environment by explicitly allowing access
to /usr/bin/gs.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1684
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 14:43:13 +00:00
Maxime Bélair
672bfcb72b Merge ProFTPD Profile
Creates an AA profile for ProFTPD. The profile has been tested on Oracular with version `1.3.8.b+dfsg-2ubuntu1`, using the source integration/unit tests and via FTP commands. As an FTP package any directory can be used for manipulating files. I've included read/write permissions to several usual locations located at the end of the profile. However these are too loose, any suggestions for how they could be tightened is much appreciated. Thanks!

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1524
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 14:27:28 +00:00
bruce-canonical
e892093c06 ProFTPD Profile 2025-05-12 14:27:27 +00:00
Maxime Bélair
acc0811c37 profiles: small fix for gs profile
Allow gs to run from confined environment by explicitly allowing access
to @{exec_path}.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 16:23:04 +02:00
Maxime Bélair
16fd1dab67 Merge profiles: add a who profile
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1634
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 14:19:51 +00:00
Maxime Bélair
2a7b84cd73 Merge Initial lsof profile (+ comments)
Initial profile for review + extra descriptions to summarize why each rule / chunk is there.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1486
Approved-by: John Johansen <john@jjmx.net>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 14:19:20 +00:00
Maxime Bélair
c99a73f1a0 Merge Enforce Transmission Profile
The current Transmission related profiles are set to complain mode. I've tested on Oracular `transmission-daemon` and `transmission` with the profile enforced with no denials have occurred. This MR removes the complain flag on these profiles.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1534
Approved-by: John Johansen <john@jjmx.net>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 14:06:46 +00:00
Maxime Bélair
8652b61f67 Merge profiles: add a systemd-detect-virt profile
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1640
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 13:47:22 +00:00
Maxime Bélair
2800aaedd0 Merge profiles: add a profile for notify-send
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1635
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 13:46:55 +00:00
Ryan Lee
d0cf1bff72 Merge profiles: also confine Xorg.wrap in addition to Xorg
For now, also use a complain mode flag like with Xorg. However, it may be
possible for complain mode to be dropped from both in the future,
tightening confinement (especially since Xorg.wrap is setuid). A
complain-mode profile can still be useful for Xorg.wrap by giving it a
separate label.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1665
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Ryan Lee <rlee287@yahoo.com>
2025-05-12 06:43:27 -07:00
Ryan Lee
35275230a8 profiles: add a who profile
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-12 15:42:24 +02:00
Maxime Bélair
6da9502774 Merge Initial profile for qpdf
It doesn't seem to need a lot of rules, and I've tried running upstream test suite with this profile and it passed.

Signed-off-by: Allen Huang <allen.huang@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1660
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 13:41:01 +00:00
Ryan Lee
08f7fe6905 profiles: also confine Xorg.wrap in addition to Xorg
For now, also use a complain mode flag like with Xorg. However, it may be
possible for complain mode to be dropped from both in the future,
tightening confinement (especially since Xorg.wrap is setuid). A
complain-mode profile can still be useful for Xorg.wrap by giving it a
separate label.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-12 15:19:16 +02:00
Maxime Bélair
93c5a613b1 Merge profiles/apparmor.d: add gs profile
Add AA profile for ghostscript. This profile has been tested on the latest plucky gs version 10.05.0dfsg1-0ubuntu1 while the latest upstream version is 10.05.0. This profile limits file access (read and write) to specific file extensions, printer devices in /dev and directories in /tmp.
The profile has been tested against the regression test suite we use in Ubuntu and manually. Testing against devices has been performed in a limited fashion as I only have access to one usb printer.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1590
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 12:42:55 +00:00
Maxime Bélair
f38f156a76 Merge profiles/apparmor.d: add nslookup profile
Add AA profile for `nslookup`. This profile has been tested on the latest plucky `nslookup` version `9.20.4-3ubuntu1` (ultimately part of `dnsutils`). Functionality has been exercised as much as possible, including basic record lookups, querying specific DNS servers, performing reverse DNS lookups, querying a CNAME, querying an MX record, querying a txt record, querying a DNSSEC-related record, performing IPv4 & IPv6 lookups, and overriding to use a custom resolver. These tests were performed through command parsing and the interactive terminal mode. AFAIK, upstream does not have a test suite available for `nslookup`

Signed-off-by: john-breton <john.breton@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1619
Approved-by: Ryan Lee <rlee287@yahoo.com>
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 12:42:34 +00:00
Maxime Bélair
1ac569ca2b Merge profiles: add profile for hostname
- Tested with different flags manually
- apparmor.d also have a profile for `hostname` which includes `<abstractions/consoles>` but was not needed while testing for plucky

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1650
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 12:35:28 +00:00
Shishir Subedi
0429251776 profiles: add profile for hostname 2025-05-12 12:35:27 +00:00
Maxime Bélair
05237241cc Merge apparmor.d: add locale profile
Add AA profile for /usr/bin/locale. This profile has been tested on the latest plucky version of locale (Ubuntu GLIBC 2.41-6-ubuntu1). This profile prevents write access to any file, limits read access to all files necessary for locale to work and limits execution of any other file other than the compressors (gzip/bzip2), which are also limited by a specific subprofile..
The profile has been tested manually.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1646
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 12:35:15 +00:00
John Johansen
2a81dfce1a Merge profiles: remove CAP_SYS_ADMIN from iotop_c profile
See the comment for an explanation of why CAP_SYS_ADMIN was being checked and why it isn't actually necessary for setting ionice values for processes

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1683
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-12 12:02:17 +00:00
Maxime Bélair
37a82e8b17 profiles: automate attachment-path check
`make check-parser` in profiles now verifies that all profiles allow at
least a read access to their attachment path.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-05-12 12:19:05 +02:00
Ryan Lee
05a48f676b profiles: remove CAP_SYS_ADMIN from iotop_c profile
See the comment for an explanation of why CAP_SYS_ADMIN was being checked and why it isn't actually necessary for setting ionice values for processes

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-12 10:47:55 +02:00
John Johansen
fba1ced1bc fixup profile 2025-05-09 04:53:35 -07:00
John Johansen
6e9ff1fa61 profiles: update the rest of the profiles to use @{exec_path}
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-05-09 03:53:05 -07:00
John Johansen
6d0834da8e profiles: update set of profiles updated in MR:1637 to use @{exec_path}
This patch updates the set of profiles updated by MR:1637, this is split
off from the rest of the profile updates because that set is explicity
recently set apart.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-05-09 03:53:05 -07:00
John Johansen
eda0461d58 Merge profiles: expand set of flags allowed for fusermount3
fuse_overlayfs requires noatime, but we should also allow more flags than
just that to preempt future breakage from flags not included in the rules.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1673
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 11:04:06 +00:00
John Johansen
763c0d9d61 Merge profiles: replace the unconfined ipa_verify profile with a proper one
ipa_verify is a simple libcamera tool that does not use the portion of
libcamera that creates user namespaces. This simple profile should be
enough to replace the previous unconfined profile.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1624
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 11:02:32 +00:00
John Johansen
e8d5401a18 Merge profiles: fix more wpa_supplicant denials
In particular, the dbus rules were completely rebuilt based on reading through wpa_supplicant's dbus source code.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1630
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 08:47:05 +00:00
John Johansen
717e019928 Merge abstractions/gnome: include abstractions/gtk
... and drop rules that are part of abstractions/gtk

Note that abstractions/gtk contains more than the rules dropped here,
which means it effectively extends the permissions granted by
abstractions/gnome.

Idea by darix.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1678
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 06:15:56 +00:00
John Johansen
3f37b671c3 Merge abstractions/mesa: more radv_builtin_shaders files
reported by darix

The initial radv_builtin_shaders rule was added in 4.1, therefore I propose this patch for at least 4.1 and master.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1677
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 06:14:57 +00:00
John Johansen
b1097077f5 Merge abstractions/wutmp: allow access to lastlog2.db
Reported by darix, seen with comm="sshd-session"

I propose this for master and 4.x (optionally also 3.x even if it's less likely that systems using these branches already use lastlog2)

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1676
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: John Johansen <john@jjmx.net>
2025-05-08 06:14:26 +00:00
John Johansen
95036df4a1 Merge profiles: give iotop-c additional accesses
- iotop-c fails with permission errors in nl_init without network netlink
  raw.
- iotop-c also needs access to the iotop config directory instead of just
  the iotoprc file within.
- iotop-c uses CAP_SYS_NICE to set ionice values. For some reason, no
  audit log is generated without the capability present, but include it
  anyways in case this allowance is due to a parser or kernel bug that
  needs to be squashed later.


Fixes: https://bugs.launchpad.net/bugs/2107727

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1675
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-05-07 23:13:22 +00:00
Ryan Lee
09218c3d2f profiles: give iotop-c additional accesses
- iotop-c fails with permission errors in nl_init without network netlink
raw.
- iotop-c also needs access to the iotop config directory instead of just
  the iotoprc file within.
- iotop-c uses CAP_SYS_NICE to set ionice values. For some reason, no
  audit log is generated without the capability present, but include it
  anyways in case this allowance is due to a parser or kernel bug that
  needs to be squashed later.

Fixes: https://bugs.launchpad.net/bugs/2107727

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-07 10:21:58 -07:00
Christian Boltz
89c1aac5af
abstractions/gnome: include abstractions/gtk
... and drop rules that are part of abstractions/gtk

Note that abstractions/gtk contains more than the rules dropped here,
which means it effectively extends the permissions granted by
abstractions/gnome.

Idea by darix.
2025-05-07 00:08:15 +02:00
Christian Boltz
521a81ebfb
abstractions/mesa: more radv_builtin_shaders files
reported by darix
2025-05-06 23:36:38 +02:00
Christian Boltz
f8532f2d20
abstractions/wutmp: allow access to lastlog2.db
Reported by darix, seen with comm="sshd-session"
2025-05-06 23:28:17 +02:00
Ryan Lee
1d7a9c6765 profiles: expand set of flags allowed for fusermount3
fuse_overlayfs requires noatime, but we should also allow more flags than
just that to preempt future breakage from flags not included in the rules.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-05-06 11:58:17 -07:00
Evan Caville
004dc61959 profiles/apparmor.d: remove file access
Signed-off-by: Evan Caville <evan.caville@canonical.com>
2025-05-06 08:57:57 +10:00
Evan Caville
260ef98a95 profiles/apparmor.d: add ssh-keyscan profile
Signed-off-by: Evan Caville <evan.caville@canonical.com>
2025-05-06 08:57:57 +10:00