Skip to content

Commit 3bb9d17

Browse files
fix(policy): add protocol/enforcement/tls to GitHub endpoints
Replace access: full on github.com and api.github.com with L7-enforced REST policies. Without protocol: rest the proxy treats these as L4-only connections and method/path rules cannot be evaluated. github.com: POST scoped to git-upload-pack/git-receive-pack only. api.github.com: writes scoped to PR/issue workflows and git ref/content operations. DELETE excluded to block destructive ops. Closes #1111 Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
1 parent 2746580 commit 3bb9d17

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

nemoclaw-blueprint/policies/openclaw-sandbox.yaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,42 @@ network_policies:
9494
github:
9595
name: github
9696
endpoints:
97+
# git transport (clone, fetch, push) over smart HTTP.
98+
# POST scoped to git-upload-pack / git-receive-pack only.
9799
- host: github.com
98100
port: 443
99-
access: full
101+
protocol: rest
102+
enforcement: enforce
103+
tls: terminate
104+
rules:
105+
- allow: { method: GET, path: "/**" }
106+
- allow: { method: POST, path: "/**/git-upload-pack" }
107+
- allow: { method: POST, path: "/**/git-receive-pack" }
108+
# REST API: GET is unrestricted; writes scoped to PR/issue
109+
# workflows and git ref/content operations. DELETE excluded to
110+
# block destructive ops (repo deletion, branch force-delete,
111+
# org membership changes).
100112
- host: api.github.com
101113
port: 443
102-
access: full
114+
protocol: rest
115+
enforcement: enforce
116+
tls: terminate
117+
rules:
118+
- allow: { method: GET, path: "/**" }
119+
# PR workflow
120+
- allow: { method: POST, path: "/repos/*/*/pulls" }
121+
- allow: { method: PATCH, path: "/repos/*/*/pulls/*" }
122+
- allow: { method: PUT, path: "/repos/*/*/pulls/*/merge" }
123+
- allow: { method: POST, path: "/repos/*/*/pulls/*/reviews" }
124+
- allow: { method: POST, path: "/repos/*/*/pulls/*/requested_reviewers" }
125+
# Issues
126+
- allow: { method: POST, path: "/repos/*/*/issues" }
127+
- allow: { method: PATCH, path: "/repos/*/*/issues/*" }
128+
- allow: { method: POST, path: "/repos/*/*/issues/*/comments" }
129+
# Branch creation and file commits via API
130+
- allow: { method: POST, path: "/repos/*/*/git/refs" }
131+
- allow: { method: PATCH, path: "/repos/*/*/git/refs/**" }
132+
- allow: { method: PUT, path: "/repos/*/*/contents/**" }
103133
binaries:
104134
- { path: /usr/bin/gh }
105135
- { path: /usr/bin/git }

0 commit comments

Comments
 (0)