Commit graph

6762 commits

Author SHA1 Message Date
John Johansen
ca3afe1691 Merge add more unconfined profiles
These applications need to use user namespaces, hence it needs an
unconfined profile when user namespaces are restricted from unconfined
like other applications in MR #1123

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify them instead
of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1149
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-02-07 09:37:08 +00:00
Christian Boltz
2577fbf077 Merge abstractions/openssl: allow version specific engdef & engines paths
Some openssl distributions use version specific engdef and engines paths
to support multi-version installations.

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1219571

Signed-off-by: David Disseldorp <ddiss@suse.de>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1147
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2024-02-07 08:49:58 +00:00
David Disseldorp
2b8cf1be80 abstractions/openssl: allow version specific engdef & engines paths
Some openssl distributions use version specific engdef and engines paths
to support multi-version installations.

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1219571
Signed-off-by: David Disseldorp <ddiss@suse.de>
2024-02-07 10:31:34 +11:00
Georgia Garcia
89a9f76733 add more unconfined profiles
These applications need to use user namespaces, hence it needs an
unconfined profile when user namespaces are restricted from unconfined
like other applications in MR #1123

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify them instead
of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-06 15:10:20 -03:00
Georgia Garcia
48d475036a Merge add keybase unconfined profile
Keybase needs to use user namespaces, hence it needs an unconfined
profile when user namespaces are restricted from unconfined like other
applications in MR #1123

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify keybase
instead of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1145
Approved-by: John Johansen <john@jjmx.net>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 21:23:34 +00:00
Georgia Garcia
0e378f52a8 add keybase unconfined profile
Keybase needs to use user namespaces, hence it needs an unconfined
profile when user namespaces are restricted from unconfined like other
applications in MR #1123

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify keybase
instead of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 16:53:58 -03:00
Georgia Garcia
15337db4af Prepare for AppArmor 4.0 alpha 4 release
- update version file

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 15:21:41 -03:00
Georgia Garcia
ce3c97df0f Merge add profiles for applications that create user namespaces
These are profiles for applications that create user namespaces, both
the actual policy and unconfined profiles, like it was done in MR
1123.

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify these
applications instead of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1144
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 18:18:40 +00:00
Georgia Garcia
789cda2f08 add special unprivileged_userns profile
Unprivileged user namespace creation is allowed an will result in a
transition into the unprivileged_userns profile. The
unprivileged_userns profile with then deny all capabilities within the
profile. Execution of applications is allowed within the
unprivileged_userns profile but, they will result in a stack with the
unprivileged_userns profile, that is to say the unprivileged_userns
profile can not be dropped (capabilities can not be gained).

If the unprivileged_userns profile does not exist, unprivileged user
namespace creation is denied as before.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 10:52:26 -03:00
Georgia Garcia
6add80d83f add profiles for applications that create user namespaces
These are profiles for applications that create user namespaces, both
the actual policy and unconfined profiles, like it was done in MR
1123.

https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify these
applications instead of unconfined to peers in policy.

Note that unconfined mode should be changed for default_allow when
https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is merged.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-02-02 10:51:06 -03:00
John Johansen
3e28d0a254 Merge doc(fix): Fix wrong syntax for profile stacking
Add missing change_profile entry required for the example

Signed-off-by: Mostafa Emami <mustafaemami@gmail.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1141
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-30 09:45:36 +00:00
John Johansen
e63c1e3a76 Merge Prevent ANSI terminal injection in aa-unconfined
/proc/$pid/cmdline can be changed by an application, therefore escape it
before printing.

The program name in /proc/$pid/exe can also contain any characters
(except \0 and shashes) and needs escaping.

Note: repr() wraps the string into single quotes, which we have to
remove to avoid changing the output format.

The test program from issue 364 now gets displayed as

    28443 /path/to/issue364 (/\x1b]0;X\x07) not confined

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

I propose this patch for 2.13..master

Closes #364
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1142
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-30 09:43:23 +00:00
John Johansen
b03abbd75f Merge manpages: Add ENOPROTOOPT error in aa_getcon() manpage
The call aa_getpeercon() can return ENOPROTOOPT error in some cases, specifically when the kernel lacks 'fine grained unix mediation'. Currently, this capability isn't available in upstream kernels, but only in patched ones (for example, the regular Ubuntu kernels). Unfortunately, the manpage lacks this info. This patch fixes this.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/366
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1143
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-30 09:33:48 +00:00
Sergio Costas
6e81104bbf manpages: Add ENOPROTOOPT error in aa_getcon() manpage 2024-01-30 09:33:47 +00:00
Christian Boltz
6cc3a3642d
Prevent ANSI terminal injection in aa-unconfined
/proc/$pid/cmdline can be changed by an application, therefore escape it
before printing.

The program name in /proc/$pid/exe can also contain any characters
(except \0 and shashes) and needs escaping.

Note: repr() wraps the string into single quotes, which we have to
remove to avoid changing the output format.

The test program from issue 364 now gets displayed as

    28443 /path/to/issue364 (/\x1b]0;X\x07) not confined

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/364
2024-01-20 23:42:30 +01:00
Mostafa Emami
166ebdb3bc doc(fix): Fix wrong syntax for profile stacking
Add missing change_profile entry required for the example

Signed-off-by: Mostafa Emami <mustafaemami@gmail.com>
2024-01-17 22:15:41 +01:00
John Johansen
253eace573 Merge tests: parse result of multiple lines in output
There are some tests like attach_disconnected and posix_mq that can
have a program that calls another. For example, posix_mq_rcv calls
posix_mq_snd. Both of them write to the same output file, but the code
that checks the result expects only one line. This change enables
checking multiple lines in the output file and passing or failing
accordingly.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1140
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-17 10:28:15 +00:00
Georgia Garcia
c2487f017f tests: cleanup debugging message from unix_fd_server.sh
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-15 17:51:49 -03:00
Georgia Garcia
dc73f0fc0b tests: parse result of multiple lines in output
There are some tests like attach_disconnected and posix_mq that can
have a program that calls another. For example, posix_mq_rcv calls
posix_mq_snd. Both of them write to the same output file, but the code
that checks the result expects only one line. This change enables
checking multiple lines in the output file and passing or failing
accordingly.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-15 17:51:49 -03:00
Georgia Garcia
3578b07aeb Merge tests: fix move_mount test failure caused by returned error
The move_mount tests were returning -1 in case of failure causing it
to become 255 in some systems, but checktestbg in the testsuite
considers any return value greater than 128 to be a signal error.
That would cause tests that should fail to display the following test
error:
... was expected to 'fail'. Reason for failure 'killed by
signal 127'

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1139
Approved-by: Steve Beattie <steve+gitlab@nxnw.org>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-12 21:39:48 +00:00
Georgia Garcia
28e67c7ba8 tests: fix move_mount test failure caused by returned error
The move_mount tests were returning -1 in case of failure causing it
to become 255 in some systems, but checktestbg in the testsuite
considers any return value greater than 128 to be a signal error.
That would cause tests that should fail to display the following test
error:
... was expected to 'fail'. Reason for failure 'killed by
signal 127'

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-12 17:12:43 -03:00
John Johansen
c8a2dc34d9 Merge firefox: remove owner restrictions for /proc/$pid/net/*
On openSUSE, these files are owned by root.

This partially reverts 70809fc716 / https://gitlab.com/apparmor/apparmor/-/merge_requests/1131

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1132
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-12 08:32:00 +00:00
John Johansen
350f9cf3dd Merge tests: add move_mount regression tests
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1138
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-01-12 08:31:17 +00:00
Georgia Garcia
f889f9f434 tests: add move_mount regression tests
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-04 18:18:58 -03:00
Georgia Garcia
5ca2ea3621 Merge ask_exec(): no longer skip exec events in hats
Instead of ignoring all exec events that happen in a hat/child profile,
only disallow child exec. ix and px are valid options inside a hat and
are now offered to the user.

(When the tools support nested child profiles one day, we can even allow
child exec again.)

[This MR is for master only. I opened separate MRs for 3.1 and 3.0]

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1133
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-03 13:38:33 +00:00
Christian Boltz
2c5bc5a09b Merge profiles: add brave browser to the snap_browsers abstraction
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1137
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2024-01-02 18:33:57 +00:00
Georgia Garcia
dc821ef762 profiles: add brave browser to the snap_browsers abstraction
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-01-02 15:25:49 -03:00
Christian Boltz
31c9cf6845 Merge regression tests: fix stack tests for new proc interface
the stacking tests need to be able to read and write the new apparmor
dir in proc, if that interface has been selected. Update the tests to
make sure they have the permissions needed.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1136
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2023-12-30 12:02:47 +00:00
John Johansen
66484687e8 regression tests: fix stack tests for new proc interface
the stacking tests need to be able to read and write the new apparmor
dir in proc, if that interface has been selected. Update the tests to
make sure they have the permissions needed.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-12-29 14:55:10 -08:00
Christian Boltz
dfb6f90aee
ask_exec(): no longer skip exec events in hats
Instead of ignoring all exec events that happen in a hat/child profile,
only disallow child exec. ix and px are valid options inside a hat and
are now offered to the user.

(When the tools support nested child profiles one day, we can even allow
child exec again.)
2023-12-28 23:12:10 +01:00
Christian Boltz
fcd46063fd
firefox: remove owner restrictions for /proc/$pid/net/*
On openSUSE, these files are owned by root.

This partially reverts 70809fc716 / https://gitlab.com/apparmor/apparmor/-/merge_requests/1131
2023-12-24 17:19:10 +01:00
John Johansen
f10e106a08 Merge parser: Add support for a default_allow mode
Add support for a default_allow mode that facillitates writing profiles
in that allow everything by default. This is not normally recomended
but fascilitates creating basic profiles while working to transition
policy away from unconfined.

This mode is being added specifically to replace the use of the
unconfined flag in these transitional profiles as the use of unconfined
in policy is confusing and does not reflect the semantics of what is
being done.

Generally the goal for policy should be to remove all default_allow
profiles once the policy is fully developed.

Note: this patch only adds parsing of default_allow mode. Currently
it sets the unconfined flag to achieve default allow but this
prevents deny rules from being applied. Once dominance is fixed a
subsequent patch will transition default_allow away from using
the unconfined flag.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1109
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2023-12-23 08:38:18 +00:00
John Johansen
d778fbef57 Merge firefox: add "owner" keywords, updates from usage monitoring
Happy holidays, been meaning to push these updates out for some time:

* Add `owner` keyword to several rules to tighten them up. I've tested these for several months in normal usage and encountered no denials;

* Add new DBus access rules for the following:

  ```
  Oct 18 06:26:06 darkstar kernel: [4369444.223230] audit: type=1107 audit(1697624766.349:2448): pid=745 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.1" mask="receive" pid=1484746 label="firefox" peer_pid=773 peer_label="unconfined"

  Oct 19 19:18:20 darkstar kernel: [4502177.573224] audit: type=1107 audit(1697757500.040:2456): pid=745 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.1" pid=1677547 label="firefox" peer_pid=773 peer_label="unconfined"

  Oct 19 19:18:20 darkstar kernel: [4502177.700071] audit: type=1107 audit(1697757500.168:2457): pid=745 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/timedate1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.5878" pid=1484746 label="firefox" peer_pid=1677582 peer_label="unconfined"
  ```

* Deny write access to `/etc/**`, due to this odd bit:
  ```
  Jul 27 15:23:21 darkstar kernel: [6530015.183715] audit: type=1400 audit(1690485801.308:128963): apparmor="DENIED" operation="mknod" profile="firefox" name="/etc/igfx_user_feature_next.txt" pid=2618266 comm="vaapitest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
  ```

* Allow read access to a cgroup `cpu.max` variable. I lost the relevant log bit here, I'm afraid;

* Relocate the ptrace rule, as it relates to the crash reporter, not (as far as I've found) the Widevine plugin.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1131
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2023-12-23 08:36:47 +00:00
Daniel Richard G
70809fc716 firefox: add "owner" keywords, updates from usage monitoring
Also relocate the ptrace rule so it belongs to the crash reporter,
not the Widevine plugin
2023-12-22 19:25:01 -05:00
John Johansen
15d8e21945 Merge Fix typo in apparmor_parser manpage
man apparmor_parser gives examples for the --warn command line option as

             apparmor_parser --warn=rules-not-enforced ...
and
             apparmor_parser --warn=no-rules-not-enforced ...

but the actual --warn options are rule-not-enforced / no-rule-not-enforced
(without s)

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057453

I propose this fix for 2.13..master

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1128
Merged-by: John Johansen <john@jjmx.net>
2023-12-05 12:43:08 +00:00
Christian Boltz
3ee47af402
Fix typo in apparmor_parser manpage
man apparmor_parser gives examples for the --warn command line option as

             apparmor_parser --warn=rules-not-enforced ...
and
             apparmor_parser --warn=no-rules-not-enforced ...

but the actual --warn options are rule-not-enforced / no-rule-not-enforced
(without s)

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057453
2023-12-05 13:27:09 +01:00
John Johansen
eb6fa02251 Merge fix subprofile name in profile serialization
Given the following profile:
    
profile foo {
  profile bar {
    profile baz {
    }
  }
}
    
The parser would correctly serialize the "foo" profile and the
"foo//bar" profile, but it would incorrectly name "bar//baz" when it
should be "foo//bar//baz". This would cause issues loading the profile
in certain kernels causing a "parent does not exist" error.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1127
Merged-by: John Johansen <john@jjmx.net>
2023-12-04 09:09:32 +00:00
Georgia Garcia
923cbcf3be parser: fix subprofile name in profile serialization
Given the following profile:

profile foo {
  profile bar {
    profile baz {
    }
  }
}

The parser would correctly serialize the "foo" profile and the
"foo//bar" profile, but it would incorrectly name "bar//baz" when it
should be "foo//bar//baz". This would cause issues loading the profile
in certain kernels causing a "parent does not exist" error.

Partially addresses #346.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-12-01 16:14:19 -03:00
Georgia Garcia
78a2c9f5f3 parser: constify unchanged strings in sd_write_*
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-12-01 15:18:51 -03:00
Christian Boltz
81bc26c934 Merge add steam profile for applications in unconfined mode
Steam needs to use user namespaces, hence it needs an unconfined
profile when user namespaces are restricted from unconfined like other
applications in MR1123

  https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify stream
instead of unconfined to peers in policy.

    Note that unconfined mode should be changed for default_allow
    when https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is
    merged.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1125
Merged-by: Christian Boltz <apparmor@cboltz.de>
2023-11-26 16:30:41 +00:00
Christian Boltz
71e28e9357 Merge profiles: convert local include to match profile name
The recently added unconfined profiles use the binary name for the
local include instead of the profile name. Switch to using the
profile name for the local include.

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

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1126
Merged-by: Christian Boltz <apparmor@cboltz.de>
2023-11-26 16:29:14 +00:00
John Johansen
7c684f9d22 profiles: convert local include to match profile name
The recently added unconfined profiles use the binary name for the
local include instead of the profile name. Switch to using the
profile name for the local include.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-11-24 18:53:51 -08:00
John Johansen
6c01b90c13 add steam profile for applications in unconfined mode
Steam needs to use user namespaces, hence it needs an unconfined
profile when user namespaces are restricted from unconfined like other
applications in MR1123

  https://gitlab.com/apparmor/apparmor/-/merge_requests/1123

In addition this serves as a handle to uniquely identify stream
instead of unconfined to peers in policy.

    Note that unconfined mode should be changed for default_allow
    when https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is
    merged.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-11-24 15:48:53 -08:00
John Johansen
832bb8f417 parser: Add support for a default_allow mode
Add support for a default_allow mode that facillitates writing profiles
in that allow everything by default. This is not normally recomended
but fascilitates creating basic profiles while working to transition
policy away from unconfined.

This mode is being added specifically to replace the use of the
unconfined flag in these transitional profiles as the use of unconfined
in policy is confusing and does not reflect the semantics of what is
being done.

Generally the goal for policy should be to remove all default_allow
profiles once the policy is fully developed.

Note: this patch only adds parsing of default_allow mode. Currently
it sets the unconfined flag to achieve default allow but this
prevents deny rules from being applied. Once dominance is fixed a
subsequent patch will transition default_allow away from using
the unconfined flag.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-11-24 15:38:19 -08:00
John Johansen
e0bc90f5cf Merge Add profiles for applications in unconfined mode
Adding profiles for applications even if they allow all operations
will allow them to be referenced as peer by other policies. This is
a step towards a more comprehensive system policy, adding names,
instead of just unconfined, to peers of existing policy and to
applications that are known to use unprivileged user namespaces.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1123
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2023-11-23 23:14:22 +00:00
John Johansen
6a96067938 Merge parser: fix regex parser leak on parsing failure
When the regex parser failed, the Chars objects created/used in rules
charset and cset_chars would not be cleaned up properly and would
leak.

Closes #361

Closes #361
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1124
Merged-by: John Johansen <john@jjmx.net>
2023-11-23 23:12:21 +00:00
Georgia Garcia
dcad01ccc3 parser: fix regex parser leak on parsing failure
When the regex parser failed, the Chars objects created/used in rules
charset and cset_chars would not be cleaned up properly and would
leak.

Closes #361

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-11-23 17:37:46 -03:00
Georgia Garcia
2594d936ad add profiles for applications in unconfined mode
Adding profiles for applications even if they allow all operations
will allow them to be referenced as peer by other policies. This is a
step towards a more comprehensive system policy, adding names, instead
of just unconfined, to peers of existing policy and to applications
that are known to use unprivileged user namespaces.

Note that unconfined mode should be changed for default_allow
when https://gitlab.com/apparmor/apparmor/-/merge_requests/1109 is
merged.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-11-23 10:34:20 -03:00
Christian Boltz
9bba464d93 Merge Allow reading /run/systemd/sessions/
Several applications use it now that utmp and wtmp are
being removed because they are not Y2038 compliant

This is the case for example in openSUSE Tumbleweed and
openSUSE MicroOS:
https://microos.opensuse.org/blog/2023-11-06-utmp-and-wtmp-are-gone/

Closes https://gitlab.com/apparmor/apparmor/-/issues/360

Closes #360

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1216878

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1121
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2023-11-08 18:16:47 +00:00
Julio Gonzalez Gil
96b1aa549b
Allow reading /run/systemd/sessions/
Several applications use it now that utmp and wtmp are
being removed because they are not Y2038 compliant

This is the case for example in openSUSE Tumbleweed and
openSUSE MicroOS:
https://microos.opensuse.org/blog/2023-11-06-utmp-and-wtmp-are-gone/

Closes https://gitlab.com/apparmor/apparmor/-/issues/360
2023-11-08 18:13:03 +01:00