Allow trusted host init scripts to preserve direct-script review
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 10.5k
- 派生
- 1.5k
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 129
描述
## Context
VS Code is adopting the public per-session `shell.initScripts` API so the SDK built-in shell tool can load the user's shell profile and activate the workspace-selected Python environment:
https://github.com/microsoft/vscode/pull/332593
## Observed behavior
With no init scripts configured, a direct script invocation can be reviewed using the script and interpreter content under the normal permission flow.
When the same session has any host-provided `shell.initScripts` entry, the direct script invocation instead requires explicit approval because the shell environment can alter the script action.
This is secure as a conservative default, but it means an SDK consumer cannot opt into a known, host-generated activation script without changing approval behavior for otherwise identical direct script commands.
## Ask
Please consider a public SDK contract for trusted host-provided init scripts that preserves safe direct-script review when possible.
Possible shapes include:
- allowing the SDK/runtime to incorporate the exact init-script content into the reviewed action/fingerprint; or
- adding explicit trust metadata for host-generated init scripts, with a conservative default for existing callers.
The behavior must remain secure when init scripts are user-controlled, mutable, unreadable, or otherwise cannot be bound to the reviewed action.
## Consumer requirements
- Per-session and updateable, matching `shell.initScripts`.
- Applies to the built-in shell tool.
- Does not weaken approval for arbitrary or unbound startup scripts.
- Works for Bash and PowerShell host activation scripts.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,沿着内置 shell 工具的审批和直接脚本审查流程进行追踪,同时查看公开的按会话划分的 shell.initScripts API。比较 Bash 和 PowerShell 主机激活脚本的表示方式,然后确定如何将精确内容或信任元数据绑定到已审查的操作,同时不削弱对用户控制或不可读脚本的审查;当能够为明确受信任且可更新的主机脚本保留安全的直接脚本审查时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, powershell, python, shell
- 领域
- developer-experience, security, tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100