Skip to content

Commit 334be03

Browse files
fix(policy): add protocol/enforcement/tls to GitHub endpoints
Replace access: full with scoped L7 rules in the github preset (moved from base policy to presets/github.yaml by #1583). github.com gets GET + POST scoped to git-upload-pack / git-receive-pack. api.github.com gets GET + PR/issue/refs/contents writes; DELETE excluded to block destructive ops. Closes #1111 Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
1 parent d3c1e49 commit 334be03

1 file changed

Lines changed: 34 additions & 2 deletions

File tree

nemoclaw-blueprint/policies/presets/github.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,44 @@ network_policies:
1919
github:
2020
name: github
2121
endpoints:
22+
# git transport (clone, fetch, push) over smart HTTP.
23+
# POST scoped to git-upload-pack / git-receive-pack only.
2224
- host: github.com
2325
port: 443
24-
access: full
26+
protocol: rest
27+
enforcement: enforce
28+
tls: terminate
29+
rules:
30+
- allow: { method: GET, path: "/**" }
31+
- allow: { method: POST, path: "/**/git-upload-pack" }
32+
- allow: { method: POST, path: "/**/git-receive-pack" }
33+
# REST API: GET is unrestricted; writes scoped to PR/issue
34+
# workflows and git ref/content operations. DELETE excluded to
35+
# block destructive ops (repo deletion, branch force-delete,
36+
# org membership changes).
2537
- host: api.github.com
2638
port: 443
27-
access: full
39+
protocol: rest
40+
enforcement: enforce
41+
tls: terminate
42+
rules:
43+
- allow: { method: GET, path: "/**" }
44+
# PR workflow
45+
- allow: { method: POST, path: "/repos/*/*/pulls" }
46+
- allow: { method: PATCH, path: "/repos/*/*/pulls/*" }
47+
- allow: { method: PUT, path: "/repos/*/*/pulls/*/merge" }
48+
- allow: { method: POST, path: "/repos/*/*/pulls/*/reviews" }
49+
- allow: { method: POST, path: "/repos/*/*/pulls/*/requested_reviewers" }
50+
# Issues
51+
- allow: { method: POST, path: "/repos/*/*/issues" }
52+
- allow: { method: PATCH, path: "/repos/*/*/issues/*" }
53+
- allow: { method: POST, path: "/repos/*/*/issues/*/comments" }
54+
# Branch creation and file commits via API
55+
- allow: { method: POST, path: "/repos/*/*/git/refs" }
56+
- allow: { method: PATCH, path: "/repos/*/*/git/refs/**" }
57+
- allow: { method: PUT, path: "/repos/*/*/contents/**" }
58+
# Manual workflow dispatch (gh workflow run)
59+
- allow: { method: POST, path: "/repos/*/*/actions/workflows/*/dispatches" }
2860
binaries:
2961
- { path: /usr/bin/gh }
3062
- { path: /usr/bin/git }

0 commit comments

Comments
 (0)