Restrict OCI bind-mount sources to configured directories and check the launch command username - #9010
Open
reiabreu wants to merge 2 commits into
Open
Restrict OCI bind-mount sources to configured directories and check the launch command username#9010reiabreu wants to merge 2 commits into
reiabreu wants to merge 2 commits into
Conversation
…he launch command username run-oci-container parses the launch command file before setup_dir_permissions changes the worker directory's ownership, and requires the command file's username to match the user passed to the worker-launcher. run_oci_container now takes the parsed oci_launch_cmd, which main owns and frees. Bind-mount sources must be absolute paths with no "." or ".." component, equal to or under a directory listed in the new worker.launcher.oci.allowed.mount.source.dirs config key; if none are configured, all sources are rejected. Adds test_mount_path_helpers and test_mount_source_allowed_dirs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds an OCI-support.md section describing worker.launcher.oci.allowed.mount.source.dirs (set in worker-launcher.cfg): OCI/runc bind-mount sources must be equal to or under one of the configured directories, and OCI workers do not start when it is unset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run-oci-container parses the launch command file before setup_dir_permissions changes the worker directory's ownership, and requires the command file's username to match the user passed to the worker-launcher. run_oci_container now takes the parsed oci_launch_cmd, which main owns and frees. Bind-mount sources must be absolute paths with no "." or ".." component, equal to or under a directory listed in the new
worker.launcher.oci.allowed.mount.source.dirsconfig key; if none are configured, all sources are rejected.How this was tested
Built the worker-launcher native tree with
autoreconf -i && ./configure && make check(autotools, compiled with-Werror); the test suite passes. Addstest_mount_path_helpersandtest_mount_source_allowed_dirs.