跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

yq_restrictions.go

35 行 · 1.1 KB历史下载
1// SPDX-FileCopyrightText: Copyright The Lima Authors
2// SPDX-License-Identifier: Apache-2.0
3
4package main
5
6import (
7 "github.com/spf13/cobra"
8)
9
10func newYQRestrictionsHelpCommand() *cobra.Command {
11 return &cobra.Command{
12 Use: "yq-restrictions",
13 Short: "Restrictions on yq expressions in Lima",
14 Long: `Lima uses yq (v4) syntax for the --set flag and provision mode "yq".
15
16Lima embeds yqlib (https://github.com/mikefarah/yq) as a library and
17disables several operators to prevent template expressions from reading
18the host environment or executing arbitrary commands:
19
20 Disabled by Lima:
21 - env (environment variable access)
22 - load, load_str (arbitrary file reads)
23
24 Disabled by yqlib default:
25 - system (arbitrary command execution)
26
27These restrictions exist because --set expressions and provision.yq
28expressions may come from untrusted template files. Allowing them to
29access environment variables, read files, or execute commands on the
30host would be a security risk.
31
32For full yq v4 expression syntax, see:
33 https://mikefarah.gitbook.io/yq/`,
34 }
35}