feat: Additional VS Code hardening#108
feat: Additional VS Code hardening#108jakub-bochenski wants to merge 1 commit intomattolson:mainfrom
Conversation
|
Apparently devcontainer.json is actually JSONC, so you can have comments. |
Greptile SummaryThis PR applies additional VS Code Dev Container hardening across all three agent templates (claude, codex, copilot) by clearing credential-related environment variables (
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: 2fe4004 |
| // Prevent VS Code from copying host .gitconfig into the | ||
| // container, which can leak credential helpers and signing | ||
| // key references. | ||
| "dev.containers.copyGitConfig": false, |
There was a problem hiding this comment.
dev.containers.copyGitConfig may be ineffective in this location
The dev.containers.copyGitConfig setting controls a host-side action performed by the Dev Containers extension: copying .gitconfig into the container during startup. This copying happens on the host before the container's VS Code settings (from customizations.vscode.settings) are applied. As a result, placing this setting inside devcontainer.json's settings block may not actually prevent the gitconfig from being copied.
In contrast, the comment on terminal.integrated.allowLocalTerminal below correctly calls out the need to also set it in host user settings. The dev.containers.copyGitConfig setting likely needs the same treatment — it should be set in the host VS Code user settings (settings.json) to be reliably effective.
Consider updating the comment to reflect this limitation, similar to the note on terminal.integrated.allowLocalTerminal:
| // Prevent VS Code from copying host .gitconfig into the | |
| // container, which can leak credential helpers and signing | |
| // key references. | |
| "dev.containers.copyGitConfig": false, | |
| // Prevent VS Code from copying host .gitconfig into the | |
| // container, which can leak credential helpers and signing | |
| // key references. NOTE: for this to take effect, this must | |
| // also be set in your host user settings, as the copy occurs | |
| // before container settings are applied. | |
| "dev.containers.copyGitConfig": false, |
This same concern applies to cli/templates/codex/devcontainer/devcontainer.json (line 14–17) and cli/templates/copilot/devcontainer/devcontainer.json (line 14–17).
Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/templates/claude/devcontainer/devcontainer.json
Line: 14-17
Comment:
**`dev.containers.copyGitConfig` may be ineffective in this location**
The `dev.containers.copyGitConfig` setting controls a host-side action performed by the Dev Containers extension: copying `.gitconfig` into the container during startup. This copying happens on the **host** before the container's VS Code settings (from `customizations.vscode.settings`) are applied. As a result, placing this setting inside `devcontainer.json`'s settings block may not actually prevent the gitconfig from being copied.
In contrast, the comment on `terminal.integrated.allowLocalTerminal` below correctly calls out the need to also set it in host user settings. The `dev.containers.copyGitConfig` setting likely needs the same treatment — it should be set in the **host VS Code user settings** (`settings.json`) to be reliably effective.
Consider updating the comment to reflect this limitation, similar to the note on `terminal.integrated.allowLocalTerminal`:
```suggestion
// Prevent VS Code from copying host .gitconfig into the
// container, which can leak credential helpers and signing
// key references. NOTE: for this to take effect, this must
// also be set in your host user settings, as the copy occurs
// before container settings are applied.
"dev.containers.copyGitConfig": false,
```
This same concern applies to `cli/templates/codex/devcontainer/devcontainer.json` (line 14–17) and `cli/templates/copilot/devcontainer/devcontainer.json` (line 14–17).
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
@jakub-bochenski What do you think? At the least, we should update the comment. We also need to followup with #107
1a5c326 to
ee2e932
Compare
- Prevent VS Code from copying host .gitconfig - Block container extensions from opening a host-side terminal
ee2e932 to
2fe4004
Compare
|
@greptile |
mattolson
left a comment
There was a problem hiding this comment.
This needs to be rebased and updated to the new layered file layout.
| // Prevent VS Code from copying host .gitconfig into the | ||
| // container, which can leak credential helpers and signing | ||
| // key references. | ||
| "dev.containers.copyGitConfig": false, |
There was a problem hiding this comment.
@jakub-bochenski What do you think? At the least, we should update the comment. We also need to followup with #107
| // key references. | ||
| "dev.containers.copyGitConfig": false, | ||
| // Block container extensions from opening a host-side | ||
| // terminal, which would bypass the WireGuard tunnel entirely. |
There was a problem hiding this comment.
Update the comment to remove references to WireGuard
|
I’ve had limited time to work on this project recently. I'll update this ASAP |
#103