Commit 68537a8
authored
feat: guard tool coverage for GitHub MCP server + proxy router expansion (#2291)
## 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.
Additionally, the proxy router had gaps where Actions, discussions,
user, and notification endpoints either fell through to a generic
`get_file_contents` fallback (wrong security labels) or were blocked
entirely.
## Changes
### Guard: 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 |
| **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) | 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.
### Guard: Unit tests (37 new tests)
Every new tool has corresponding tests for `label_resource` and
`label_response`.
### Guard: Compiler warning fix
Gated `has_approval_label` with `#[cfg(test)]` (only used in tests).
### Proxy: 22 new REST routes + 5 GraphQL patterns
- **Actions**: get workflow/run/job, workflow-specific runs, attempt
jobs/logs, artifacts, caches, secrets, variables, environment config
- **Discussions**: list, single, comments (REST + GraphQL)
- **User**: `/user`, `/user/keys|ssh_signing_keys|gpg_keys` (REST),
`viewer {}` (GraphQL)
- **Notifications**: `/notifications`
- **Check runs**: `/commits/{sha}/check-runs|check-suites`
- **Org-scoped**: `/orgs/{org}/actions/secrets|variables`
- **Organization**: `organization()` GraphQL
**Valid integrity levels**: `merged` > `approved` > `unapproved` >
`none` > `blocked`2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
0 commit comments