Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ something outside your opencode config say so in their description.
| `permissions-deny-destructive` | Permissions | merge | In the bundle. Hard-denies `sudo`, root/home-anchored `rm -rf`, `dd`, `mkfs`, force-push, `reset --hard` |
| `permissions-deny-cluster-write` | Permissions | merge | In the bundle. Hard-denies mutating and exec `oc`, `kubectl`, `helm` verbs — no prompt, not bypassable by `--auto` |
| `permissions-build-tools` | Permissions | merge | Not in the bundle. Build tools (node, npm, mvn, gradle, make, python, pip, cargo, go) |
| `permissions-cluster-info` | Permissions | merge | Not in the bundle. Read-only `oc` (OpenShift) inspection — grants read access to whichever cluster you are logged into |
| `permissions-cluster-info` | Permissions | merge | Not in the bundle. Read-only `oc` (OpenShift) inspection — grants read access to whichever cluster you are logged into. Printing the token (`oc whoami -t`, `oc config view --raw`) and streaming (`oc logs -f`, `oc get -w`) still ask; combined short flags such as `-cf` are not recognised |
| `permissions-webfetch-ask` | Permissions | merge | Not in the bundle. Requires approval before opencode uses the webfetch tool |
| `mcp-http` | MCP | replace | Add an HTTP MCP server (localhost or remote) with one custom header (prompts for id, URL, header name, header value) |
| `mcp-http-noauth` | MCP | replace | Add an HTTP MCP server (localhost or remote) without auth headers (prompts for id, URL) |
Expand Down
29 changes: 21 additions & 8 deletions presets/permissions-cluster-info.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @name: permissions-cluster-info
// @description: Auto-allows read-only oc (OpenShift) inspection commands. Split
// out of permissions-container-info in its 0.2.0 so cluster access is an
// explicit opt-in. Caveats: this grants read access to whichever cluster you
// happen to be logged into, including production, and oc get can dump
// base64-encoded secret values to your terminal. Pair with
// permissions-deny-cluster-write, installed after it.
// @description: Auto-allows read-only oc (OpenShift) inspection commands on
// whichever cluster you are logged into, production included; oc get can
// print base64-encoded Secrets. Printing the token and streaming (-f, -w)
// still ask. Install permissions-deny-cluster-write after it.
// @author: Jan <jan@trick77.com>
// @version: 0.1.0
// @version: 0.2.0
// @path: permission.bash
// @mode: merge
{
Expand All @@ -30,5 +28,20 @@
"oc config view": "allow",
"oc config view *": "allow",
"oc config get-contexts": "allow",
"oc config current-context": "allow"
"oc config current-context": "allow",

"oc whoami -t*": "ask",
"oc whoami * -t": "ask",
"oc whoami * -t *": "ask",
"oc whoami *-t=*": "ask",
"oc whoami *--show-token*": "ask",
"oc config view *--raw*": "ask",
"oc get -w*": "ask",
"oc get * -w": "ask",
"oc get * -w *": "ask",
"oc get *-w=*": "ask",
"oc get *--watch*": "ask",
"oc logs -f*": "ask",
"oc logs * -f*": "ask",
"oc logs *--follow*": "ask"
}