tiny-container-user-seccomp automated
medium
- Image Types:
- tiny-lxc-armhf / tiny-lxc-arm64 / tiny-lxc-amd64
- Image Deployment:
- LXC
- Type:
- functional
Description
Test that the custom seccomp profile could be applied for unprivileged container started as user
Pre Conditions
- Clone the tests repository from another computer (Note that the branch being tested may change depending on the release, please make sure to clone the correct branch for the release in question):
- Copy the test directory tiny-image-recipes to the target device:
- Log into the target device:
$ git clone --branch apertis/v2022dev3 https://gitlab.apertis.org/infrastructure/tiny-image-recipes.git
$ DUT_IP=<device-ip>
$ scp -r tiny-image-recipes user@$DUT_IP:
$ ssh user@$DUT_IP
Execution Steps
- Enter test directory:
- Ensure we allow user mapping:
- Setup the AppArmor profile for container:
- Make sure user have correct mappings for test:
- Check that the simple seccomp profile for the container is loaded and works
$ cd tiny-image-recipes
$ sysctl -w kernel.unprivileged_userns_clone=1
$ sed s/__NAMESPACE_PLACEHOLDER__/lxc-apertis-tiny-userns/g lxc/lxc-tiny-connectivity-profile-template | apparmor_parser -qr
$ usermod --add-subuids 1000-1000 user
$ usermod --add-subuids 100000-165535 user
$ usermod --add-subgids 1000-1000 user
$ usermod --add-subgids 100000-165535 user
$ sudo -u user -H lavatests/test-seccomp-policy --ospack "$OSPACK" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-userns" -p "--seccomp $PWD/lavatests/test-minimal-policy.seccomp"
Expected
Test command should report "pass".