Skip to content

Secure Net::OpenSSH control sockets in backend containers - #120

Draft
rc9000 with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-permissions-issue
Draft

Secure Net::OpenSSH control sockets in backend containers#120
rc9000 with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-permissions-issue

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown

Net::OpenSSH rejects control-socket paths beneath the group-writable /home/netdisco. The image must retain support for OpenShift randomized UIDs that require writable runtime state.

  • Secure home directory

    • Set /home/netdisco to 0755, allowing Net::OpenSSH to create and validate ~/.libnet-openssh-perl.
  • Preserve randomized-UID runtime support

    • Add group-0-writable /home/netdisco/run.
    • Route backend and daemon PID files through symlinks into that directory.
chmod 755 /home/netdisco
mkdir /home/netdisco/run
chown netdisco:0 /home/netdisco/run && chmod 770 /home/netdisco/run
ln -s run/netdisco-backend.pid /home/netdisco/netdisco-backend.pid
  • Extend smoke coverage
    • Verify the secure home-directory mode and arbitrary-UID PID-file access.

Copilot AI changed the title [WIP] Fix permissions issue in netdisco-backend container for SSH jobs Secure Net::OpenSSH control sockets in backend containers Jul 23, 2026
Copilot AI requested a review from rc9000 July 23, 2026 12:20
Comment thread netdisco-base/Dockerfile
mkdir /home/netdisco/run && \
chown netdisco:0 /home/netdisco/run && chmod 770 /home/netdisco/run && \
ln -s run/netdisco-daemon.pid /home/netdisco/netdisco-daemon.pid && \
ln -s run/netdisco-backend.pid /home/netdisco/netdisco-backend.pid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work when the file is not there yet or later deleted and recreated?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts permissions and runtime paths in the Netdisco container images so Net::OpenSSH no longer rejects its control-socket directory under /home/netdisco, while still supporting OpenShift-style arbitrary UIDs by moving writable runtime state into a group-0-writable subdirectory and extending CI smoke checks.

Changes:

  • Make /home/netdisco non-group-writable (0755) to satisfy Net::OpenSSH security checks.
  • Add /home/netdisco/run (group 0 writable) and symlink PID files into it.
  • Extend the smoke workflow to validate home permissions and PID-file writability under an arbitrary UID.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
netdisco-base/Dockerfile Tightens home directory permissions, introduces /home/netdisco/run, and symlinks PID files into it.
.github/workflows/smoke-test.yml Adds smoke assertions for secure home mode and PID-file write access under an arbitrary UID.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +68 to +71
docker run --rm --user 1000050000 \
--entrypoint /bin/ash \
"localhost:5000/netdisco:$tag" \
-ec 'echo "checking secure home permissions"; test "$(stat -c %a /home/netdisco)" = 755; echo "checking PID file access"; : > /home/netdisco/netdisco-backend.pid; rm /home/netdisco/run/netdisco-backend.pid'
Comment thread netdisco-base/Dockerfile
RUN chgrp -R 0 /home/netdisco && chmod -R g=u /home/netdisco && \
chmod 755 /home/netdisco && \
mkdir /home/netdisco/run && \
chown netdisco:0 /home/netdisco/run && chmod 770 /home/netdisco/run && \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Permissions issue in netdisco-backend container prevents SSH jobs working

3 participants