2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-28 12:58:07 +00:00

8146 Commits

Author SHA1 Message Date
Christian Boltz
c5642f9d43 Merge utils: fix unix qualifier clean rule generation
The wrong clean rule is generated when unix rules contain qualifiers,
with the order inverted with the rule name.

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

Closes #511
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1639
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2025-04-18 19:11:39 +00:00
Ryan Lee
7461536d52 profiles: add a profile for notify-send
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-18 08:44:40 -07:00
Georg Pfuetzenreuter
675a99ac7b
abstractions/nameservice: allow kanidm-unixd
If kanidm is configured in nsswitch.conf(5), access to the kanidm-unixd
configuration is needed for applications to resolve entries.

For example:

```
type=AVC apparmor="DENIED" operation="open" class="file" profile="php-fpm"
name="/etc/kanidm/unixd" comm="php-fpm" requested_mask="r" denied_mask="r"
```

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2025-04-18 17:15:02 +02:00
Maxime Bélair
d4e795fe6d utils: Fix test-logprof.py for bin.ping profile
Update expected output to match the modifications on bin.ping profile.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-18 12:41:56 +02:00
Maxime Bélair
75959225b3 make check: verify attachment-path read permission in profiles
Extend `make check` to automatically ensure every AppArmor profile grants
explicit read access to its attachment path, preventing future omissions.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-18 12:41:56 +02:00
Maxime Bélair
072d17a237 profiles: Give all profiles read access to their attachment path
Grant explicit read permission on each profile’s attachment path. This
avoid issues when running them from a confined environment and makes
test_profile.sh pass.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-18 12:41:56 +02:00
Maxime Bélair
68c0dddf23 Add a script to verify attachment-path permissions
Unconfined delegates access to open file descriptors. Therefore when
running a confined binary from unconfined, it will work even when the
attachment path is not read-allowed.

However, as soon as these confined binaries are run from another
confined process, this delegation is not permitted anymore and the
program breaks.

This has been the cause of several bugs such as
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2107455 or
https://github.com/canonical/snapd/pull/15181 .

Introduce `test_profile.sh`, a helper script that ensures confining
AppArmor profiles explicitly allow (at least) read access to their
attachment path.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-18 12:41:54 +02:00
Maxime Bélair
5d7fe96fd0 apparmor_parser: show attachment in --debug output
When showing the content of profiles with `apparmor_parser --debug`, the
attachment path is now displayed within the 'Debugging built structures'
section.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-18 10:26:20 +02:00
Georgia Garcia
8c84b36b32 utils: fix unix qualifier clean rule generation
The wrong clean rule is generated when unix rules contain qualifiers,
with the order inverted with the rule name.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/511
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-17 20:39:58 -03:00
Maxime Bélair
cda9153772 Merge lsblk profile: Minor fixes
Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2107402

Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2107455

Allow `/usr/bin/lsblk mr` to make this profile work from confined
profiles. Also, allow css devices to work properly with lsblk.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1632
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-17 18:59:33 +00:00
carlosdem
d8ddd665fc fix typo 2025-04-17 00:10:00 +00:00
Maxime Bélair
7b8232fe29 lsblk profile: Minor fixes
Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2107402
Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2107455

Allow `/usr/bin/lsblk mr` to make this profile work from confined
profiles. Also, allow css devices to work properly with lsblk.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-16 14:32:45 +02:00
carlosdem
393444b7ba add path for plasmashell with qt6 based QtWebEngineProcess in debian derivatives 2025-04-16 11:34:13 +00:00
john-breton
0e8afc278d
Allow sys_admin capability
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-15 08:53:10 -04:00
Georgia Garcia
c25f2d3407 tests: detect if label is supported in the kernel
When label is detected in the kernel, the tests pass.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-14 09:48:15 -03:00
Georgia Garcia
b718c53b97 parser: add label to mqueue debug output
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-14 09:48:15 -03:00
Georgia Garcia
306b656ba2 parser: enable create perm when label is defined
Due to how labeling is implemented, during the creation it is not yet
defined, so we need to grant create permissions without attaching the
label yet.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-14 09:48:10 -03:00
John Johansen
ccf1b25d3d Merge fusermount3: allow ro mounts on /cvmfs
CVMFS ( the [CernVM File System](cernvm.cern.ch)) is a read-only fs used to distribute software that is widely used in scientific computing (at CERN and beyond, for example by the [EESSI project](eessi.io)).

CVMFS historically uses the mountpoint /cvmfs, but the new fusermount3 profile doesn't allow that. It's not really possibly to move the mountpoint to /mnt/cvmfs, because the software installed on CVMFS often uses the absolute path /cvmfs/... for linking.

We've added a /etc/apparmor.d/local/fusermount3 to our packages, but it'd be much appreciated if this could be fixed upstream!

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1587
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
2025-04-13 07:26:38 +00:00
John Johansen
f34a7d0b28 Merge parser: add an abi <default> that is equivalent to not specifying an abi
I am unsure how to test this equivalency due to how abi declarations interact with feature file command line arguments, so advice on that would be welcome.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1585
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-12 10:30:28 +00:00
John Johansen
491def4385 parser: make abi=<kenrel> respect the command line specied kernel features
Currently abi=<kernel> always grabs the kernels actual features but
it should respect --kernel-features=. This is causing the simple
tests to fail when abi=<kernel> is specified.

Fix it so abi=<kernel> respects the kernel abi specified in the configs
or on the command line.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-12 03:07:53 -07:00
John Johansen
8138bc60d1 Merge unprivileged_userns profile: Allow full file system access
Fixes https://gitlab.com/apparmor/apparmor/-/issues/505

The profile previously permitted access to `/**`, which excludes the root
directory (`/`). This commit also gives `/` access, aligning with the
intended behavior.

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

Closes #505
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1626
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
2025-04-12 09:19:25 +00:00
Christian Boltz
59d9d001a1 Merge Move the "unsafe" rules of front_perms_ok simple tests to separate test file
This enables us to exercise the front perms parse logic in the utils rule parsing through the simple tests as well

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1627
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2025-04-11 16:37:07 +00:00
Maxime Bélair
182db98c2a unprivileged_userns profile: Allow full file system access
Fixes https://gitlab.com/apparmor/apparmor/-/issues/505

The profile previously permitted access to `/**`, which excludes the root
directory (`/`). This commit also gives `/` access, aligning with the
intended behavior.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-11 09:02:49 +02:00
Ryan Lee
fe9c305ccd Move the "unsafe" rules of front_perms_ok simple tests to separate test file
This enables us to exercise the front perms parse logic in the utils rule parsing through the simple tests as well

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-10 11:19:05 -07:00
Alessandro Astone
c09501ad59 fusermount3: Include full nameservice rules for SSSD users
audit: type=1400 audit(1744218886.059:4484): apparmor="DENIED" operation="open" class="file" profile="fusermount3" name="/var/lib/sss/mc/passwd" pid=19539 comm="fusermount3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
audit: type=1400 audit(1744218886.059:4485): apparmor="DENIED" operation="open" class="file" profile="fusermount3" name="/var/lib/sss/mc/passwd" pid=19539 comm="fusermount3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
audit: type=1400 audit(1744218886.059:4486): apparmor="DENIED" operation="connect" class="file" profile="fusermount3" name="/var/lib/sss/pipes/nss" pid=19539 comm="fusermount3" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0

Fixes: http://bugs.launchpad.net/bugs/2106311
2025-04-10 17:26:39 +02:00
John Johansen
4e1a8feb03 lib: version sync
Sync version of library to match that of 4.1 release.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-10 02:15:53 -07:00
Ryan Lee
01d0cfbad9 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>
2025-04-09 15:39:14 -07:00
John Johansen
08a67f3e20 Merge tests/profiles/tinyproxy: add some functional tests for tinyproxy
Check that when using a HTTP client via tinyproxy that the expected Via header
is present and that the tinyproxy stats page works as expected.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1537
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-09 18:20:07 +00:00
john-breton
d37496073b
Prefer to allow non-attack surface impacting perms
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-09 11:18:06 -04:00
john-breton
ec2cb47a47
Add <abstractions/nameservice-strict> for /etc/resolv.conf resolution
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-08 13:40:00 -04:00
John Johansen
d9ecaf60bc Merge tests: regressions: fix unix_socket_pathname.sh for upstream kernels
FS based unix sockets have a complicatd interaction with socket
mediation some of the mediation happens in file hooks while other
parts happen in network hooks.

When the kernel doesn't have the unix socket mediation patches the
interactions become largely mediated through the network hooks, as
unix rules get downgraded to socket rules. However some filesystem
operations are needed, and some hooks like bind may be called
differently based on the unix socket type, and not just the address.
Without the kernel patches these variations are not taken into
account.

Changes in the parser networking permission mappings have also
affected the downgrade path, as the parser now supports permissions on
socket rules, downgrades can use permissions and be more faithful to
the original rule but this can also break tests that didn't add all
the permissions needed for the downgrade case.

update unix_socket_pathname.sh to detect whether rule downgrades are
being used, and adjust permissions and expectations based on this.

Fixes: 7ce768244 ("tests: regression: fix regression test for upstream kernels")

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1622
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Approved-by: Maxime Bélair <maxime.belair@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
v4.1.0-cherry-pick-point
2025-04-08 15:48:57 +00:00
John Johansen
2c784709b2 tests: regression: increase unix socket test timeout
The tests on slower systems are occassionally timing out leading to
inconsistent pass/fail runs. The time out failure depending on which
test it occurs in can result in false passes, or failres.

Double the timeout, which hopefully will be enough to avoid the
timeout issue without making the tests wait too long.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-08 06:42:17 -07:00
John Johansen
08f9466d1c tests: regressions: fix unix_socket_pathname.sh for upstream kernels
FS based unix sockets have a complicatd interaction with socket
mediation some of the mediation happens in file hooks while other
parts happen in network hooks.

When the kernel doesn't have the unix socket mediation patches the
interactions become largely mediated through the network hooks, as
unix rules get downgraded to socket rules. However some filesystem
operations are needed, and some hooks like bind may be called
differently based on the unix socket type, and not just the address.
Without the kernel patches these variations are not taken into
account.

Changes in the parser networking permission mappings have also
affected the downgrade path, as the parser now supports permissions on
socket rules, downgrades can use permissions and be more faithful to
the original rule but this can also break tests that didn't add all
the permissions needed for the downgrade case.

update unix_socket_pathname.sh to detect whether rule downgrades are
being used, and adjust permissions and expectations based on this.

Fixes: 7ce768244 ("tests: regression: fix regression test for upstream kernels")
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-08 06:42:11 -07:00
John Johansen
e4af4402c2 Merge Add support for running image-garden as a snap
The new image-garden snap offers a one-stop-shop for integration
testing, bundling qemu, spread and image-garden build recipes.

Extend the documentation, the run-spread.sh helper script as well as
spread.yaml to support this new method.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1588
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-08 12:05:20 +00:00
John Johansen
541c8ad94d Merge Check for mount rules with multiple 'options'
... and adjust the tools to raise an exception if such a rule is found.
While this is not nice, it's better than the previous behaviour where
only the last 'options' was kept, and the others were lost when writing
the rule.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1617
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-08 09:32:56 +00:00
John Johansen
ff2bd885e3 Merge profiles: remove the toybox profile
toybox is similar to busybox but is developed with Android development in
mind. Thus, it has the same issues as the busybox profile and should be
removed.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1620
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-08 09:32:18 +00:00
John Johansen
0a13a56f5c Merge tests: regression: fix regression test for upstream kernels
The attach_disconnected.sh and deleted.sh tests added expanded their
testing by using unix sockets. This however ever needs support of
unix socket mediation.

Provide a minimal fix by setting bailouts for the the tests if the
requirement is not present. Long term it would be better if the
expected/needed permissions sets could be tweaked to take into
account the permissions required by the use of unix sockets.

The fix f47d5c70a fix af_unix tests for v8 networking, was never
correct, though it worked and was closer before support for fine
grained inet mediation landed. Before finegrained inet mediation
landed unix rules would allow specifying the permission but inet would
not only allowing coarse socket mediation rules. While the backend
supported finegrained permissions in v8 socket mediation the parser
did not.

If af_unix mediation was not supported by the kernel the af_unix
mediation rule would be downgrade to a network rule. All network
socket rules allowed full permission because the parser didn't
support permissions on socket rules. So the "unix create," rule
was being downgraded to a "unix," rule. Thus the "unix create",
rule was enough permissions, in the downgrade even though it
actually wasn't enough permissions.

With support for fine grained inet permissions, support for permissions
on socket rules also landed. When this happend "unix create," was not
enough permissions any more because it was not downgraded to "unix,",
this resulted in failed mediation.

Fixes: cb4a397b1 ("tests: add attach_disconnected tests")
Fixes: f47d5c70a ("fix af_unix tests for v8 networking")

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1621
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-08 01:18:38 +00:00
John Johansen
7ce768244d tests: regression: fix regression test for upstream kernels
The attach_disconnected.sh and deleted.sh tests added expanded their
testing by using unix sockets. This however ever needs support of
unix socket mediation.

Provide a minimal fix by setting bailouts for the the tests if the
requirement is not present. Long term it would be better if the
expected/needed permissions sets could be tweaked to take into
account the permissions required by the use of unix sockets.

The fix f47d5c70a fix af_unix tests for v8 networking, was never
correct, though it worked and was closer before support for fine
grained inet mediation landed. Before finegrained inet mediation
landed unix rules would allow specifying the permission but inet would
not only allowing coarse socket mediation rules. While the backend
supported finegrained permissions in v8 socket mediation the parser
did not.

If af_unix mediation was not supported by the kernel the af_unix
mediation rule would be downgrade to a network rule. All network
socket rules allowed full permission because the parser didn't
support permissions on socket rules. So the "unix create," rule
was being downgraded to a "unix," rule. Thus the "unix create",
rule was enough permissions, in the downgrade even though it
actually wasn't enough permissions.

With support for fine grained inet permissions, support for permissions
on socket rules also landed. When this happend "unix create," was not
enough permissions any more because it was not downgraded to "unix,",
this resulted in failed mediation.

Fixes: cb4a397b1 ("tests: add attach_disconnected tests")
Fixes: f47d5c70a ("fix af_unix tests for v8 networking")

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-07 16:49:14 -07:00
Ryan Lee
aecb02a22e profiles: remove tests for the removed toybox profile
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-07 14:26:09 -07:00
Ryan Lee
f6042bf34d profiles: remove the toybox profile
toybox is similar to busybox but is developed with Android development in
mind. Thus, it has the same issues as the busybox profile and should be
removed.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-07 12:55:00 -07:00
john-breton
17b979cd55
Change @{pids} to @{pid} and use <abstractions/terminfo>
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-07 14:46:50 -04:00
john-breton
4118ced01a
profiles/apparmor.d: add nslookup profile
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-07 13:07:13 -04:00
John Johansen
90938de5c4 Merge parser: Fix special casing for detached move mounts
MR: 1561 Added the ability to specify special a keyword to allow
detached mounts. Unfortunately it updated remount to use the device
and devbuffer when remounts current encoding doesn't support it.

This caused the mount.sh regression test to fail in the following
way.

```
$ sudo bash mount.sh
[sudo] password for jj:
    using mount rules ...
Error: mount failed. Test 'MOUNT (confined cap bind mount remount rprivate conflict)' was expected to 'pass'. Reason for failure 'FAIL: mount /tmp/sdtest.358520-12403-ASaOnn/mountpoint2 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
    not supported by parser - skipping mount options=(nodirsync),
Error: mount failed. Test 'MOUNT (confined cap mount remount option)' was expected to 'pass'. Reason for failure 'FAIL: mount /dev/loop40 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
Error: mount failed. Test 'MOUNT (confined cap mount remount)' was expected to 'pass'. Reason for failure 'FAIL: mount /dev/loop40 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
Error: mount passed. Test 'MOUNT (confined cap mount remount deny option)' was expected to 'fail'
```

Revert the change to remount. This fixes the regression failure.
fa0746f2e parser: add special casing for detached move mounts
Signed-off-by: John Johansen <john.johansen@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1618
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-07 12:20:57 +00:00
john-breton
0dbfefc1a6
profiles/apparmor.d: add nslookup profile
Signed-off-by: john-breton <john.breton@canonical.com>
2025-04-07 07:25:12 -04:00
John Johansen
89e8fe9c1c parser: Fix special casing for detached move mounts
MR: 1561 Added the ability to specify special a keyword to allow
detached mounts. Unfortunately it updated remount to use the device
and devbuffer when remounts current encoding doesn't support it.

This caused the mount.sh regression test to fail in the following
way.

```
$ sudo bash mount.sh
[sudo] password for jj:
    using mount rules ...
Error: mount failed. Test 'MOUNT (confined cap bind mount remount rprivate conflict)' was expected to 'pass'. Reason for failure 'FAIL: mount /tmp/sdtest.358520-12403-ASaOnn/mountpoint2 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
    not supported by parser - skipping mount options=(nodirsync),
Error: mount failed. Test 'MOUNT (confined cap mount remount option)' was expected to 'pass'. Reason for failure 'FAIL: mount /dev/loop40 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
Error: mount failed. Test 'MOUNT (confined cap mount remount)' was expected to 'pass'. Reason for failure 'FAIL: mount /dev/loop40 on /tmp/sdtest.358520-12403-ASaOnn/mountpoint failed - Permission denied'
Error: mount passed. Test 'MOUNT (confined cap mount remount deny option)' was expected to 'fail'
```

Revert the change to remount. This fixes the regression failure.
fa0746f2e parser: add special casing for detached move mounts
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-07 03:07:06 -07:00
Christian Boltz
b5894687ed
Check for mount rules with multiple 'fstype'
... and adjust the tools to raise an exception if such a rule is found.
While this is not nice, it's better than the previous behaviour where
only the last 'fstype' was kept, and the others were lost when writing
the rule.
2025-04-06 15:19:30 +02:00
Christian Boltz
171e0b1fa9
Check for mount rules with multiple 'options'
... and adjust the tools to raise an exception if such a rule is found.
While this is not nice, it's better than the previous behaviour where
only the last 'options' was kept, and the others were lost when writing
the rule.
2025-04-06 15:19:01 +02:00
John Johansen
37666dd736 Merge mount: accept fstype and options in any order
Note: If multiple fstype= or options= are given, this is not detected as
an error (to keep the regex simpler). When writing back such a rule,
only one fstype and options will "survive".

Adjust the exclude list in test-parser-simple-tests.py accordingly:
- several valid mount rules no longer fail
- two invalid mount rules which so far accidentally raised an exception
  because of the fstype/options order no longer raise this exception
  (conflicting mount options, which are the real reason why these rules
  are invalid, are not detected in the tools)

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/501

I propose this fix for 4.0, 4.1 and master. (Note: excluding `mount/ok_opt_86.sd` was added in !1561, so we either need to also backport this, or have to slightly adjust this MR for backporting.)

Closes #501
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1616
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-06 06:56:22 +00:00
John Johansen
46a6c3b061 Merge remmina: add audit flag for writing autostart file
... as discussed in https://gitlab.com/apparmor/apparmor/-/merge_requests/1603

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1615
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-06 06:55:58 +00:00
Christian Boltz
7726c86b79
mount: accept fstype and options in any order
Note: If multiple fstype= or options= are given, this is not detected as
an error (to keep the regex simpler). When writing back such a rule,
only one fstype and options will "survive".

Adjust the exclude list in test-parser-simple-tests.py accordingly:
- several valid mount rules no longer fail
- two invalid mount rules which so far accidentally raised an exception
  because of the fstype/options order no longer raise this exception
  (conflicting mount options, which are the real reason why these rules
  are invalid, are not detected in the tools)

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/501
2025-04-05 19:18:09 +02:00