Skip to content

[Ubuntu2404] Only enforce valid profile to avoid apparmor issue #12953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

# Ensure all AppArmor Profiles are enforcing
apparmor_parser -q -r /etc/apparmor.d/
{{% if 'ubuntu' in product %}}
# Current version of apparmor-utils has issue https://gitlab.com/apparmor/apparmor/-/issues/411 and we're waiting for https://gitlab.com/apparmor/apparmor/-/merge_requests/1218 to be landed on noble
find /etc/apparmor.d -maxdepth 1 ! -type d -exec aa-enforce "{}" \;
{{% else %}}
aa-enforce /etc/apparmor.d/*
{{% endif %}}

{{% if 'ubuntu' in product %}}
UNCONFINED=$(aa-status | grep "processes are unconfined" | awk '{print $1;}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
#Replace apparmor definitions
apparmor_parser -q -r /etc/apparmor.d/
#Set all profiles in enforce mode
{{% if 'ubuntu' in product %}}
find /etc/apparmor.d -maxdepth 1 ! -type d -exec aa-enforce "{}" \;
{{% else %}}
aa-enforce /etc/apparmor.d/*
{{% endif %}}

# rsyslogd apparmor profile is disabled in focal and jammy.
# Reloading the profile results in an unconfined process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
#Replace apparmor definitions and force profiles into compliant mode
apparmor_parser -q -r /etc/apparmor.d/
#Set all profiles in complain mode
{{% if 'ubuntu' in product %}}
find /etc/apparmor.d -maxdepth 1 ! -type d -exec aa-complain "{}" \;
{{% else %}}
aa-complain /etc/apparmor.d/*

{{% endif %}}
# rsyslogd apparmor profile is disabled in focal and jammy.
# Reloading the profile results in an unconfined process
# which fails the SCE, so we need to restart the process manually.
Expand Down
Loading