Commit 42cff6d
authored
feat: add guard tool coverage for 22 missing GitHub MCP server tools (#2280)
## Problem
Cross-referencing all tool names from `github/github-mcp-server` source
against the guard's `tool_rules.rs` revealed 22 read tools falling
through to the default `_ =>` case, which inherits empty labels. This
means these tools had no integrity or secrecy labeling, causing them to
either be filtered at any `min-integrity` threshold or leak private data
without secrecy tags.
## Changes
### New tool coverage in `tool_rules.rs` (22 read tools)
| Category | Tools | Secrecy | Integrity | Rationale |
|----------|-------|---------|-----------|-----------|
| **Actions** | `get_job_logs` | `secret` | approved | Logs may contain
leaked env vars/tokens |
| **Context** | `get_me` | `private:user` | project:github | User PII
(email, profile) |
| **Context** | `get_teams`, `get_team_members` | `private:user` |
project:github | Org structure is sensitive |
| **Discussions** | `list_discussions`, `get_discussion` | repo
visibility | approved | User content, similar to issues |
| **Discussions** | `get_discussion_comments` | repo visibility |
approved | User content, similar to issue comments |
| **Discussions** | `list_discussion_categories` | repo visibility |
approved | Maintainer-managed metadata |
| **Gists** | `list_gists`, `get_gist` | `private:user` | unapproved |
User content, no repo-level trust signal; response refines per-item |
| **Git** | `get_repository_tree` | repo visibility | approved | Repo
metadata |
| **Labels** | `list_label` | repo visibility | approved |
Maintainer-managed metadata |
| **Notifications** | `list_notifications`, `get_notification_details` |
`private:user` | none (empty) | Private; references external content of
unknown trust |
| **Projects** | `projects_list`, `projects_get` | `[]` | approved:owner
| New canonical project tool names |
| **Repos** | `list_starred_repositories` | `private:user` |
project:github | Reveals user preferences/interests |
| **Search** | `search_orgs` | `[]` | project:github | Public
GitHub-controlled metadata |
| **Security** | `list_global_security_advisories`,
`get_global_security_advisory` | `[]` | project:github | Published GHSA
CVE data |
| **Security** | `list_repository_security_advisories`,
`list_org_repository_security_advisories` | `private:repo` | approved |
May contain embargoed vulnerability info |
Also updated `tools.rs`: added `actions_run_trigger`, `projects_write`,
`add_reply_to_pull_request_comment` to write operations.
### Unit Tests (37 new tests in `labels/mod.rs`)
Every new tool now has corresponding unit tests verifying correct
secrecy and integrity labels for both `label_resource` and
`label_response`, using mock data:
- **`apply_tool_labels` (label_resource)**: one test per tool confirming
the exact secrecy and integrity labels returned
- **`label_response_items`**: `list_gists` (public/private/mixed),
`get_gist` (public/private), `list_notifications`,
`get_notification_details` (MCP-wrapped)
- **`label_response_paths`**: `list_gists` (public/private/mixed),
`list_notifications`, `projects_list` (ISSUE/DRAFT_ISSUE/PULL_REQUEST
items)
### Proxy router expansion (22 new REST routes + 5 GraphQL patterns)
Added explicit routes for Actions, discussions, user, notifications, and
check runs to the proxy router. Previously most fell through to the
generic `get_file_contents` fallback (wrong security labels) or were
blocked entirely.
**Valid integrity levels**: `merged` > `approved` > `unapproved` >
`none` > `blocked`9 files changed
Lines changed: 1393 additions & 24 deletions
File tree
- guards/github-guard
- docs
- rust-guard/src
- labels
- internal/proxy
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | | - | |
| 139 | + | |
133 | 140 | | |
| 141 | + | |
134 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
135 | 147 | | |
136 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
97 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
| |||
0 commit comments