Skip to content

Commit 379f55a

Browse files
committed
docs(policy): state exact glob matching rules
Signed-off-by: Johnny Greco <jogreco@nvidia.com>
1 parent 8261751 commit 379f55a

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

‎docs/how-it-works/policies/network-rules.mdx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ github_repository_api:
257257
- path: /usr/local/bin/gh
258258
```
259259

260-
In request paths, `*` matches within one path segment and `**` matches across
261-
segments, so `/repos/<org>/<repo>/**` covers every path under the repository
262-
but not `/repos/<org>/<repo>` itself. The deny rules list the webhooks path and
263-
everything under it separately for the same reason. The allow rule grants every
264-
HTTP method under the repository path, including writes, so narrow it if the
265-
agent needs only specific operations. It does not cover Git
266-
transport or GraphQL requests. To add a deny rule to an existing rule without a
267-
complete policy file, use `openshell policy update` with `--add-deny`, as
268-
described in [Add or Remove Network
260+
In request paths, `*` matches within one path segment, and `**` written as a
261+
whole segment matches across segments, so `/repos/<org>/<repo>/**` covers every
262+
path under the repository but not `/repos/<org>/<repo>` itself. The deny rules
263+
list the webhooks path and everything under it separately for the same reason.
264+
The allow rule grants every HTTP method under the repository path, including
265+
writes, so narrow it if the agent needs only specific operations. It does not
266+
cover Git transport or GraphQL requests. To add a deny rule to an existing rule
267+
without a complete policy file, use `openshell policy update` with `--add-deny`,
268+
as described in [Add or Remove Network
269269
Access](/how-it-works/policies/manage-policies#add-or-remove-network-access).
270270

271271
Apply the rule with a GitHub provider attached. Its profile must permit

‎docs/how-it-works/policies/schema.mdx‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,34 @@ network_middlewares:
446446

447447
## Matcher Semantics
448448

449-
| Matcher | Case-sensitive | Wildcards |
449+
Glob patterns follow one set of rules. Each matcher splits values at a
450+
separator:
451+
452+
| Matcher | Separator | Case-sensitive |
450453
|---|---|---|
451-
| Endpoint `host` and middleware hosts | No | `*` matches characters within one DNS label, and `**` matches one or more labels. |
452-
| Binary `path` | Yes | `*` matches within one path segment, and `**` matches across segments. |
453-
| REST and WebSocket `path` | Yes | `*` matches within one path segment, and `**` matches across segments. `?` matches one character, and bracket classes such as `[0-9]` are supported. `/repos/**` does not match `/repos`. |
454-
| Query values and MCP tool names | Yes | `*` matches any characters except `.`, and `**` matches any characters. |
454+
| Endpoint `host` and middleware hosts | `.` | No |
455+
| Binary `path` | `/` | Yes |
456+
| REST and WebSocket rule `path` | `/` | Yes |
457+
| Query values and MCP tool names | `.` | Yes |
458+
459+
- `*` matches any characters except the separator.
460+
- `**` matches across separators only when it is a whole segment, as in
461+
`/repos/**`, `**.example.com`, or `github.**`. Next to other characters, as in
462+
`**secret**`, it behaves like `*`. A whole-segment `**` needs at least one
463+
segment, so `/repos/**` does not match `/repos`.
464+
- `?` matches one character except the separator, and bracket classes such as
465+
`[0-9]` match one character from a set. Endpoint hosts accept only `*` and
466+
`**`, as described in [Destination Fields](#destination-fields).
467+
468+
Because query values and MCP tool names use `.` as the separator, `*` does not
469+
match a value that contains a dot. For example, `1.*` matches `1.2` but not
470+
`1.2.3`, and `github.*` matches `github.search` but not `github.search.code`.
471+
Use `**` to match any value.
472+
473+
The endpoint `path` field, which selects among endpoints on the same host and
474+
port, uses different rules. An empty path, `**`, or `/**` matches every path,
475+
`/v1/**` matches `/v1` and every path under it, and in other patterns `*` also
476+
matches `/`.
455477

456478
## Full Example
457479

0 commit comments

Comments
 (0)