Skip to content

Create LUKS encrypted wrap #535

Closed as not planned
Closed as not planned

Description

@cayolblake

@rusty-snake how would I approach creating a LUKS encrypted wrapped environment?

Something similar to creating a LUKS encrypted file based disk and moving to it.

Is this theoretically possible, or, eventually since the process would be starting on the host machine all the root file system view will be available through/proc/$pid/root so it doesn't make any sense to start with?

Activity

  1. rusty-snake commented on Oct 13, 2022

    @rusty-snake
    Contributor

    What do you want? And why do you want it?

    Do you want to protect the programs running inside bwrap from the host? That's not in the thread model that bubblewrap can solve.

    /proc/$pid/root can only be read/dereferenced by programs which have PTRACE_MODE_READ_FSCREDS on $pid.

    Bubblewarp has no LUKS support and will never get it.

  2. cayolblake commented on Oct 13, 2022

    @cayolblake
    Author

    What do you want? And why do you want it?

    Create a protected environment from host / datacenter access, when creating an encrypted filesystem for the host is not possible.

    /proc/$pid/root can only be read/dereferenced by programs which have PTRACE_MODE_READ_FSCREDS on $pid.

    Is there a way to disallow the host apps from accessing such space for processes inside wraps?

  3. rusty-snake commented on Oct 13, 2022

    @rusty-snake
    Contributor

    Create a protected environment from host / datacenter access, when creating an encrypted filesystem for the host is not possible.
    Is there a way to disallow the host apps from accessing such space for processes inside wraps?

    bubblewrap works the other way around, processes in it are less privileged than processes outside of it.

    You can not reasonable protect a less privileged domain from a more privileged domain.

    Try the following:

    • Make sure kernel.yama.ptrace_scope has value 1 or 2.
    • Start a bash, show it's pid (echo $$) and leave it open.
    • Try to run strace -p $pid.
      • You should get strace: attach: ptrace(PTRACE_SEIZE, $pid): Operation not permitted
    • Now start a bash inside bubblewrap bwrap --unshare-user --dev-bind / / bash, show it's pid (echo $$) and leave it open.
    • Try to run strace -p $new_pid.
      • You should be able to attach to it and debug it.

    As you see, using bubblewrap gives outside processes (with same uid) more permission over inside processes and not equal or less.

  4. smcv commented on Oct 13, 2022

    @smcv
    Collaborator

    This is an issue tracker, not a discussion forum, and this is not an actionable issue.

    It is not possible to use bubblewrap (or basically any other tool) to protect processes inside the sandbox from processes outside the sandbox: it is only for working in the other direction, protecting trusted processes outside the sandbox from untrusted processes inside the sandbox. For instance, if you look at how Flatpak uses bubblewrap, that's the intended use.

    Processes outside the sandbox have total control over the parameters that get passed to bubblewrap, so they are trusted (with the information-security meaning of "trusted": a trusted component is a component that has the technical ability to break your security policy if it wants to). For anything clever that you try to think of in this direction, processes outside the sandbox will either have the ability to prevent you from doing that clever thing, or the ability to get access to credentials (like an encryption key), or both.

  5. rusty-snake commented on Oct 13, 2022

    @rusty-snake
    Contributor

    OT: @smcv do you think it makes sense to enable GitHub Discussion for bubblewrap?

  6. cayolblake commented on Oct 13, 2022

    @cayolblake
    Author

    @smcv There is no Discussion board available in the project, that's why the only route is using the Issue tracker.

  7. cayolblake commented on Oct 13, 2022

    @cayolblake
    Author

    It is not possible to use bubblewrap (or basically any other tool) to protect processes inside the sandbox from processes outside the sandbox: it is only for working in the other direction, protecting trusted processes outside the sandbox from untrusted processes inside the sandbox. For instance, if you look at how Flatpak uses bubblewrap, that's the intended use.

    Yeah that's clear. I'm trying to protect what's inside, that's it.

    Processes outside the sandbox have total control over the parameters that get passed to bubblewrap, so they are trusted (with the information-security meaning of "trusted": a trusted component is a component that has the technical ability to break your security policy if it wants to). For anything clever that you try to think of in this direction, processes outside the sandbox will either have the ability to prevent you from doing that clever thing, or the ability to get access to credentials (like an encryption key), or both.

    Yeah that's also obvious, however, I thought there might be a way Kernel-side, to control the abilities of host processes for example, or the isolation of sandboxes whichever, reaching the same target.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions