Skip to content

Allow mapping a host file source to a different destination path in the sandbox #1366

Description

Description of the new feature / enhancement

Allow a filesystem policy to map a host source file to a different destination path inside the sandbox.

Today a policy can grant a path read-only or read-write access, or deny it. It cannot make the sandboxed process see a different file at a given path. Some callers need to give a process a file at the path where a tool expects it, with content prepared by the caller, without modifying the file on the host.

Example: a caller prepares /run/user/1000/app/config.prepared and wants the sandboxed process to see it as ~/.config/tool/config, while the real ~/.config/tool/config stays untouched on the host.

Proposed technical implementation details

A minimal shape could be a list of read-only mappings in the filesystem policy:

"filesystem": {
  "mappedPaths": [
    { "source": "/path/on/host", "destination": "/path/in/sandbox" }
  ]
}

Possible semantics:

  • Read-only mappings first; read-write could come later if needed.
  • The mapping takes precedence over other grants and denials for the destination path.
  • The source must exist when the sandbox starts; the destination may or may not exist on the host.
  • Expose it as a backend capability, so callers can detect support and fall back (for example, to denying the destination) where it is not available.

Backend notes:

  • Bubblewrap / LXC: a bind mount of the source onto the destination. Bubblewrap already does this internally (/dev/null over denied files, the /etc/hosts pin).
  • Windows: unsure what is feasible for process containers; input from maintainers welcome.
  • Seatbelt: probably not possible, since SBPL can only allow or deny access by path. The capability would be absent there.

Activity

  1. kanismohammed commented on Oct 2, 2026

    @kanismohammed
    Collaborator

    This is a virtualization ask. I would like to understand why would the caller not grant permission on the actual file /run/user/1000/app/config.prepared

  2. added
    Backend-ProcessContainerWindows ProcessContainer behavior, including BaseContainer and AppContainer isolation tiers.
    Backend-MicroVMNanVix-based micro-VM backend behavior or integration.
    Backend-WSLCWindows WSL Container backend behavior or integration.
    Backend-IsolationSessionWindows IsolationSession backend behavior or integration.
    Backend-SeatbeltmacOS process isolation implemented with Seatbelt.
    and removed
    Needs-TriageHas not yet been reviewed, classified, and routed.
    on Oct 5, 2026
  3. caarlos0 commented on Oct 8, 2026

    @caarlos0
    CollaboratorAuthor

    e.g. if the file contains a secret, we could mask it, and give the sandbox the masked version.

    this is came up when thinking about expanding masked secrets to files as well

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

    Backend-IsolationSessionWindows IsolationSession backend behavior or integration.Backend-MicroVMNanVix-based micro-VM backend behavior or integration.Backend-ProcessContainerWindows ProcessContainer behavior, including BaseContainer and AppContainer isolation tiers.Backend-SeatbeltmacOS process isolation implemented with Seatbelt.Backend-WSLCWindows WSL Container backend behavior or integration.Issue-FeatureA request for new or expanded product functionality.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions