Skip to content

[Bug]: SELinux breaks Docker Backend #45106

Description

@Xande-p

Bug Description

When using the docker backend, some volumes are binded automatically (ex: /workspace with cwd or ~/.hermes/sandboxes/docker/default/home with ~ (usually /root in default docker image).

In OSs like OpenSUSE, that has SELinux enforced, these binds fail (the folder is permission denied inside the container).

Steps to Reproduce

Setup hermes with docker backend, default config. Try to access /root inside the container.

Expected Behavior

ls /root should display the folder contents.

Actual Behavior

The folder is inaccessible.

Affected Component

Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/swWpf
agent.log    https://paste.rs/ueVbp
gateway.log  https://paste.rs/jBVyp

Operating System

OpenSUSE Tumbleweed

Python Version

No response

Hermes Version

0.16.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

In OSs that enforce SELinux:

@@ -330,6 +330,7 @@ _BASE_SECURITY_ARGS = [
+ "--security-opt", "label=disable",

in docker.py, or add :Z or ro:Z in the binds.

User should be informed of security impact, if, deemed necessary.

Activity

  1. added
    type/bugSomething isn't working
    comp/toolsTool registry, model_tools, toolsets
    P2Medium — degraded but workaround exists
    on Jun 12, 2026
  2. liuhao1024 commented on Jun 12, 2026

    @liuhao1024

    Fixed by #45111 — disable SELinux labeling for bind mounts on enforcing hosts.

  3. GottZ commented on Jul 28, 2026

    @GottZ

    This was generated by AI during triage.

    Summary

    Three PRs address #45106: #45111 disables SELinux labeling container-wide, while #45252 and #71459 relabel bind mounts with :z; #71459 applies the targeted fix across all internal sandbox mount sites, including the egress-proxy CA certificate.

    Related pull requests

    Duplicates

    #45252 and #71459 substantially duplicate the targeted :z relabeling approach, with #71459 superseding the closed predecessor through broader current-tree coverage and tests. #45111 addresses the same issue through a competing container-wide label-disable policy rather than the same change.

    Suggested consolidation

    Merge #71459 as the verified best fix: its diff targets the bind mounts that trigger #45106 while preserving SELinux labeling for the container. Close #45111 as superseded by the narrower policy-preserving fix; keep #45252 closed as the same-mechanism predecessor superseded by #71459.

    Complex graph

    flowchart LR
        classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
        classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
        classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
        classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
        classDef best stroke-width:3px,stroke:#b45309
        classDef target stroke-width:3px,stroke:#4338ca
        I45106(["issue #45106 (open)"])
        P45111["PR #45111 (open)"]
        subgraph Dup45252 ["PRs duplicating each other"]
            P45252["PR #45252 (closed)"]
            P71459["PR #71459 (open)"]
        end
        P45111 -->|fixes| I45106
        P45252 -->|fixes| I45106
        P71459 -->|best fix| I45106
        class I45106 open
        class I45106 target
        class P45111 open
        class P45252 closed
        class P71459 open
        class P71459 best
        click I45106 "https://github.com/NousResearch/hermes-agent/issues/45106"
        click P45111 "https://github.com/NousResearch/hermes-agent/pull/45111"
        click P45252 "https://github.com/NousResearch/hermes-agent/pull/45252"
        click P71459 "https://github.com/NousResearch/hermes-agent/pull/71459"
    
    Loading

    Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).

    Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 16 kB of PR diffs, 10 kB of issue/PR text, 1 kB of discussion (4 comments), 5 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  4. GottZ commented on Jul 30, 2026

    @GottZ

    This was generated by AI during triage.

    Delta since our previous triage comment

    @teknium1 extended our analysis by confirming that #71459 fixes the internal auto-mounted cwd while identifying an unresolved documented path: host-directory entries in terminal.docker_volumes remain forwarded without SELinux labeling. The new keep_open review also records that #71459 is currently conflicting and that its regression tests must be relocated to the current test layout, including a direct CA-mount assertion.

    Changed pull requests

    Suggested consolidation

    The recommendation remains #71459 as the consolidation target, but merge it only after the keep_open review findings are addressed; #45111 and the already-closed #45252 remain superseded alternatives.

    Complex graph unchanged since our previous triage comment.

    Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 16 kB of PR diffs, 10 kB of issue/PR text, 3 kB of discussion (6 comments), 5 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

  5. GloverChris commented on Nov 7, 2026

    @GloverChris

    I reproduced this on Bluefin (Fedora-based) with SELinux enforcing, Hermes v0.23.0 (2bd378ed), and the rootless Podman backend.

    • The container process had the container_t SELinux type.
    • The dedicated host directories bind-mounted at /workspace and /root had the user_home_t type, and writes inside the container failed.
    • Relabeling only those dedicated sandbox directories to the existing container's exact MountLabel resolved the tested failures: workspace/home write tests and the Hermes terminal tool succeeded afterward.

    I did not observe an AVC denial, so the SELinux diagnosis is inferred from the labels and the before/after tests, rather than confirmed by an audit record.

    This is a targeted workaround for the current container, with a few caveats:

    • Recreating the container can change its MCS categories, so a label copied from the previous container may no longer match.
    • Separately mounted skills/cache directories need their own checks; the workspace/home tests do not cover those mounts.
    • Relabeling should be limited to dedicated sandbox directories, not the entire host home directory.

    Sharing this as an additional reproduction on a newer Hermes version and a Fedora-based host.

  6. alt-glitch commented on Nov 10, 2026

    @alt-glitch

    #45111 aims to fix this: it starts the Docker sandbox with SELinux labeling disabled, so bind mounts like /workspace and /root stay readable on enforcing hosts.

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

    P2Medium — degraded but workaround existsbackend/dockerDocker container executioncomp/toolsTool registry, model_tools, toolsetstype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions