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

Support Landlock LSM #6056

Closed
BoardzMaster opened this issue Sep 27, 2021 · 4 comments
Closed

Support Landlock LSM #6056

BoardzMaster opened this issue Sep 27, 2021 · 4 comments
Labels
kind/feature Stale status/more-info-needed Awaiting contributor information

Comments

@BoardzMaster
Copy link

BoardzMaster commented Sep 27, 2021

What is the problem you're trying to solve

Adding Landlock support in containerd.
Landlock is a stackable LSM providing unprivileged access control for a set of processes.
It was merged in mainline Linux 5.13. Its author Mickaël Salaün @l0kod, https://landlock.io/.
I suppose Landlock will bring better sandboxing with unprivileged features and improve container security.

Describe the solution you'd like

Now Landlock's integration works (for runtime-spec and runc) have been in progress for some time:

  1. Proposal: add Landlock LSM support opencontainers/runtime-spec#1110
  2. Support Landlock LSM? opencontainers/runc#2859, libcontainer: add support for Landlock opencontainers/runc#3194

Containerd Landlock implementation depends on runtime-spec --> runc solutions, so it's just a start. I'm going to show my point of view on architecture a bit later.

Additional context

No response

@AkihiroSuda AkihiroSuda added the status/more-info-needed Awaiting contributor information label Sep 28, 2021
@BoardzMaster
Copy link
Author

BoardzMaster commented Oct 6, 2021

For Containerd Landlock integration I suggest the next steps:

  1. Adding to ctr additional command for loading a standalone Landlock profile JSON file which must correspond to runtime-spec OCI specification like in: specs-go/config: add Landlock LSM support opencontainers/runtime-spec#1111

Example of LandlockProfile.json
image

Command example: cli.stringFlag { Name: "Landlock-profile" Usage: "enable Landlock with a custom profile },

Notes: Landlock profile could be parsed into runtime-spec Spec.Process structure and passed to runc.

  1. Landlock integration into containerd CRI plugin ( for Kubernetes or any other orchestrator support).

Notes: Adding generateLandlockSpecOpts() function which could be used by containerSpecOprt() one in /cri/server/container_create_linux.go

     CreateContainer() ------>RUNC
                  |
                  --->containerSpecOpt()
                                     |
                                     ---> generateLandlockSpecOpts()

image

There are also several questions that pop up:

  1. Landlock isEnable() function?
    Before applying Landlock policy there should be checking whether the host has been configured to support Landlock.

  2. Containerd Landlock default profile necessity?
    In the case of AppArmor support in containerd there is default AppArmor profile creation and loading. Do we need a default Landlock profile in a case when the host supports Landlock LSM?

Colleagues, please share your comments and opinions.
I'm going to prepare the PoC patch for further discussion ASAP.

@BoardzMaster
Copy link
Author

Dear colleagues, @l0kod, @gnoack!
Please take a look at the issue and related MR #6120
Looking forward to your opinion and comments!

@github-actions
Copy link

github-actions bot commented Sep 2, 2023

This issue is stale because it has been open 90 days with no activity. This issue will be closed in 7 days unless new comments are made or the stale label is removed.

@github-actions github-actions bot added the Stale label Sep 2, 2023
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Stale status/more-info-needed Awaiting contributor information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants