Enforce execution profile sandbox settings (prevent manifest overrides)#13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e37bfc43a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| defp manifest_config_for_profile(config) do | ||
| config | ||
| |> stringify_map() | ||
| |> Map.drop(@openshell_keys) |
There was a problem hiding this comment.
Drop manifest-supplied sandbox CLI with profile
When an untrusted manifest selects an execution_profile and also sets sandbox_cli, this filtering keeps that key because it is not in @openshell_keys; OpenShell later uses Map.get(config, "sandbox_cli", ...) as the executable passed to System.cmd. That leaves the manifest able to choose the local OpenShell binary even though the profile is now supposed to own sandbox/security settings, so add this invocation control key to the profile-owned/drop set or otherwise prevent manifest override.
Useful? React with 👍 / 👎.
Motivation
execution_profileto preserve operator intent and placement semantics.Description
apply_to_config/1inlib/mirror_neuron/execution/profile.exto drop manifest-supplied OpenShell/secure keys before merging the trusted profile config so profile-owned keys take precedence.@profile_local_cli_path_keysand node-side expansion of profile-local CLI paths (policyandssh_key) so relative profile paths are resolved on the runtime node instead of against a submitted payload bundle.@openshell_keysfrom the manifest portion prior to merging.tests/unit/execution_profile_test.exsvalidating that manifest-supplied sandbox values cannot override profile-controlledfrom/policy/ssh_key/pool/pool_slots/reuse_shared_sandbox/persistent_workspace/sandbox_upload_path, and update README to document the profile immutability semantics and path resolution behavior.Testing
mix formatandgit diff --check, both completed with no formatting or diff-check errors.elixir -r lib/mirror_neuron/execution/profile.exwhich passed and validated that profile values override manifest-supplied values as intended.mix test tests/unit/execution_profile_test.exsbut dependency fetching failed due to environment network restrictions (Hex/GitHub fetch returned HTTP CONNECT 403), so full test suite could not be executed here.mix local.hex,mix archive.install ...,mix deps.get) but these operations were blocked by the same network policy and returned 403 errors.Codex Task