feat: allow custom docker-compatible sandbox commands (nerdctl, etc.)#14499
feat: allow custom docker-compatible sandbox commands (nerdctl, etc.)#14499AkihiroSuda wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @AkihiroSuda, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement to the sandboxing feature by allowing users to define and utilize any Docker-compatible command-line interface for container operations. This change broadens the compatibility of the system with various container runtimes beyond the default Docker and Podman, offering greater flexibility and choice for developers. The update involves modifications to the configuration schema, validation logic, and user documentation to support this new capability. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enables the use of custom Docker-compatible CLIs for sandboxing by allowing the GEMINI_SANDBOX environment variable to be set to an arbitrary command. While this adds flexibility, I've identified a critical security vulnerability and a high-severity bug in the implementation.
The main issue is a command injection vulnerability created by removing the whitelist for sandbox commands. This allows arbitrary code execution if the GEMINI_SANDBOX environment variable is manipulated, for instance, through a malicious project's .env file. Additionally, the sandbox command from the environment variable is converted to lowercase, which will cause it to fail on case-sensitive systems if the command contains uppercase letters.
I've provided specific comments and suggestions in the code to address these issues.
Disagree. |
Allows users to specify Docker-compatible CLIs (like nerdctl, finch) via the GEMINI_SANDBOX environment variable (e.g. GEMINI_SANDBOX=nerdctl). Fixes issue 14484 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
4f57288 to
efe023a
Compare
|
Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request. To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues. If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding! |
Just 4 days ago @sehoon38 requested a review though? |
Originally posted by @olcan in #3216 @olcan Could you take a look at this PR? Any chance to get this PR reopened? |
Summary
Allows users to specify Docker-compatible CLIs
Details
The
GEMINI_SANDBOXenvironment variable can be now set to an arbitrary Docker-compatible CLI,e.g.,
nerdctl: contaiNERD CTL (Docker-compatible CLI for containerd): https://github.com/containerd/nerdctlnerdctl.lima: nerdctl wrapped in Lima VM: https://github.com/lima-vm/lima/blob/master/cmd/nerdctl.limafinch: Amazon's distribution of nerdctl + Lima: https://runfinch.comRelated Issues
Fixes #14484
How to Validate
Note
--rosettais needed on ARM Mac, as there is still no native ARM support inus-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:X.Y.Z:Pre-Merge Checklist
nerdctl.lima(new)