Skip to content

Conversation

mikhailkoliada
Copy link
Contributor

Description

Strictly speaking we do not need any means of 3rd party hardening on runners (selinux/apparmor) so lets just disable it so it does not change system's behaviour.

Related issue: #10015

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

@mikhailkoliada
Copy link
Contributor Author

/azp run ubuntu2004,ubuntu2204,ubuntu2404

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@DaanDeMeyer
Copy link
Contributor

@mikhailkoliada Note that systemctl stop apparmor.service was not sufficient in my case and only running aa-teardown fully disabled apparmor. Note that the exit status of aa-teardown has to be ignored because of https://gitlab.com/apparmor/apparmor/-/issues/403.

@mikhailkoliada mikhailkoliada force-pushed the ubuntu_disable_apparmor branch from 2125740 to 20da757 Compare June 10, 2024 07:39
@mikhailkoliada
Copy link
Contributor Author

mikhailkoliada commented Jun 10, 2024

@DaanDeMeyer oh, it is a good catch, but does aa-teardown saves its states somehow anywhere? I mean we reboot the vm even during the build process several times so if it does not save its state we'll have to patch it different way if aa-teardown does not survive reboots :(

@DaanDeMeyer
Copy link
Contributor

@mikhailkoliada I am not sure, I'm not very familiar with apparmor. As a workaround I currently run aa-teardown and then uninstall the apparmor package. That would prevent anything from ever getting enabled again. Note that snapd has a hard dependency on apparmor so it would be uninstalled as well, not sure if that's acceptable for the base images.

@mikhailkoliada
Copy link
Contributor Author

mikhailkoliada commented Jun 10, 2024

@DaanDeMeyer hmm, from what I've read in the docs aa-teardown is indeed needed to unload apparmor profiles but it seems if only you do not need / want to reboot your system while we can just reboot. I'm gonna run more tests to see if disabling on systemd's side + reboot does the trick.

@mikhailkoliada
Copy link
Contributor Author

/azp run ubuntu2004,ubuntu2204,ubuntu2404

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mikhailkoliada
Copy link
Contributor Author

/azp run ubuntu2004,ubuntu2204,ubuntu2404

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants