Skip to content
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

ECS AppArmor Support (aka Ubuntu 22 support) #3941

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

SreeeS
Copy link
Contributor

@SreeeS SreeeS commented Oct 1, 2023

Summary

This change will introduce ecs-default apparmor profile which adds support for ubuntu22 platforms as with Ubuntu 22, Ubuntu defaults both to docker 20.10.x+ and CgroupsV2. Creating ECS’s cgroups require extra DBUSpermissions in CgroupsV2. This ecs-default apparmor profile will provide the required permissions.

Implementation details

The changs are in ecs-init:

  • engine.go is updated with PreStartAppArmor which checks if the host is apparmor supported and loadDefaultProfile if supported
  • app-armor.go is added to load the ecs-default profile:
    • checks of the profile is already loaded. If not it will create and write to the file and load the profile using apparmor_parser.
  • docker_config.go is updated to hostConfig.SecurityOpt if the host is apparmor supported
  • Removed ecs-init/config/development.go as it is no longer used by our team, it is interfering with our ecs-int development process for debugging and running ecs-init.

Testing

  • Added unit tests for engine.go and apparmor.go changes
  • Run complete functional test suite to make sure there is no availability risk
  • bot/test - tests run as part of git hub PR workflow
    New tests cover the changes: yes

Description for the changelog

Add apparmor support

Does this PR include breaking model changes? If so, Have you added transformation functions?

This PR is intended to support apparmor supported hosts. This PR can potentially break customers using a custom profile and the ecs-default profile permissions are insufficient (has been tested for availability risk). Given that currently we are not supporting apparmor, this change should not break existing customer.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@SreeeS SreeeS changed the title App armor test [WIP donot review]App armor support Oct 1, 2023
@SreeeS SreeeS force-pushed the app-armor-test branch 19 times, most recently from 94c7ec7 to 75aa213 Compare October 2, 2023 16:20
@SreeeS SreeeS changed the title [WIP donot review]App armor support [WIP donot review]Apparmor support Oct 2, 2023
@SreeeS SreeeS changed the title [WIP donot review]Apparmor support [WIP donot review]Add apparmor support Oct 2, 2023
@SreeeS SreeeS added the bot/test label Oct 2, 2023
@SreeeS SreeeS marked this pull request as ready for review October 2, 2023 16:59
@SreeeS SreeeS requested a review from a team as a code owner October 2, 2023 16:59
@SreeeS SreeeS changed the title [WIP donot review]Add apparmor support Add apparmor support Oct 2, 2023
@SreeeS SreeeS changed the title Add apparmor support ECS AppArmor Support (aka Ubuntu 22 support) Oct 2, 2023
ecs-init/apparmor/apparmor.go Show resolved Hide resolved
ecs-init/apparmor/apparmor_utils.go Outdated Show resolved Hide resolved
ecs-init/config/development.go Show resolved Hide resolved
@SreeeS SreeeS merged commit 96633a3 into aws:dev Oct 10, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants