Skip to content

Conversation

iceweasel-oai
Copy link
Contributor

Summary

  • add a new codex-windows-sandbox workspace crate that builds the codex-windows-sandbox executable for launching commands in a Windows AppContainer
  • implement the AppContainer command runner with CLI argument parsing, profile management, writable root ACL updates, and security capability wiring
  • register the helper crate and the shared windows crate dependency in the workspace and document the tool in a short README

Testing

  • cargo test -p codex-windows-sandbox -- --nocapture

https://chatgpt.com/codex/tasks/task_i_68e594cbdb9c8327828648e82576299a

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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

Comment on lines +169 to +170
configure_writable_roots(sandbox_policy, sandbox_policy_cwd, sid.sid())?;
configure_writable_roots_for_command_cwd(&command_cwd, sid.sid())?;
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Avoid granting write access in read-only sandboxes

The helper unconditionally invokes configure_writable_roots_for_command_cwd(&command_cwd, …) immediately after applying the policy. That function calls grant_path_with_flags(..., true) and adds a FILE_GENERIC_WRITE ACE for the AppContainer SID on the working directory regardless of whether the policy is ReadOnly. As a result, a policy that is supposed to provide only read access still allows the sandboxed process to modify files in its CWD, which violates the semantics of SandboxPolicy::ReadOnly and weakens the sandbox (a read‑only tool call can still write into the workspace).

Useful? React with 👍 / 👎.

Comment on lines +442 to +450
let permissions = if write {
(FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE).0
} else {
(FILE_GENERIC_READ | FILE_GENERIC_EXECUTE).0
};
let explicit = EXPLICIT_ACCESS_W {
grfAccessPermissions: permissions,
grfAccessMode: SET_ACCESS,
grfInheritance: SUB_CONTAINERS_AND_OBJECTS_INHERIT | OBJECT_INHERIT_ACE,
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge read_only_subpaths remain writable

When a writable root contains subpaths marked as read‑only, the code first grants the root FILE_GENERIC_READ|WRITE|EXECUTE with inheritance and then calls grant_path_with_flags for each subpath with write=false. However grant_path_with_flags always uses SET_ACCESS to add another allow ACE (lines 442‑450) and never removes or denies the previously inherited write ACE. Consequently the AppContainer SID still inherits write permissions from the root and directories meant to stay read‑only (e.g. .git) remain writable. Enforcing read‑only subpaths requires adding a deny ACE or preventing inheritance from the writable root.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant