-
Notifications
You must be signed in to change notification settings - Fork 8.5k
ai-gov: http method and path rules, and approval-required network access #26051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,14 +55,75 @@ To create a policy: | |
| 1. Set the **Scope** to **Organization** or **Teams**. If you select **Teams**, | ||
| choose the teams the policy applies to. See | ||
| [Scope policies to teams](#scope-policies-to-teams). | ||
| 1. Define the policy rules. For network and filesystem policies, select | ||
| **Add rule** for each rule. For MCP policies, enter Cedar statements in the | ||
| policy editor. For syntax and examples, use the relevant access-control page | ||
| in [Choose a policy type](#choose-a-policy-type). | ||
| 1. Define the policy rules. | ||
| - Network and filesystem policies: select **Add rule** for each rule. For a | ||
| network policy, see [Add a network rule](#add-a-network-rule). | ||
| - MCP policies: enter Cedar statements in the policy editor. See | ||
| [MCP access policies](mcp.md). | ||
| 1. For a network policy, set **Require approval before access** if developers | ||
| should confirm each destination before a sandbox can reach it. See | ||
| [Require approval for a network policy](#require-approval-for-a-network-policy). | ||
|
|
||
| Existing policies are listed with their name, scope, rule count, and last | ||
| update. Use the action menu (⋮) to edit or delete a policy. | ||
|
|
||
| ### Add a network rule | ||
|
|
||
| Each rule has an optional **Rule name**, an **Effect** of **Allow** or **Deny**, | ||
| and a **Type** that decides what the rule matches. | ||
|
|
||
| - **All traffic** matches every request to the destinations you list, on any | ||
| port, method, and path. | ||
| - Under **Destinations**, add the hosts, IP addresses, or CIDR ranges the | ||
| rule covers. A destination matches any port unless you add one, such as | ||
| `example.com:8080`. | ||
| - Under **Protocols**, select the transport protocols the rule applies to. | ||
| - **HTTP** matches only HTTP requests with the methods and paths you specify. | ||
| - In **Destination**, enter the host the rule covers. It matches any port | ||
| unless you add one. Enter a bare host with no scheme and no path, so | ||
| `api.github.com` rather than `https://api.github.com/repos`. A CIDR range | ||
| isn't accepted here. Use an **All traffic** rule for one. | ||
| - Under **HTTP methods**, select the methods the rule applies to from the | ||
| methods listed. Leave **any (\*)** selected to match every method the | ||
| composer offers. | ||
| - Under **Path patterns**, add the paths the rule covers. Leave it empty to | ||
| match any path. | ||
|
|
||
| An HTTP rule's paths all belong to its one destination, so to cover paths on a | ||
| second host, add a second rule. For the pattern syntax and how HTTP rules | ||
| combine with **All traffic** rules, see | ||
| [HTTP rules](../concepts.md#http-method-and-path). | ||
|
|
||
| The composer summarizes the rule in a sentence as you fill it in, so you can | ||
| confirm the effect, methods, and destination before saving. | ||
|
|
||
| ### Require approval for a network policy | ||
|
|
||
| Turning on **Require approval before access** means the destinations a network | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: the frontend action that saves this toggle (PR #17054) currently hardcodes if !approvalScopeOffered(pending.Options, approval.ScopePersistent) {
return false // no prompt published
}with PER_REQUEST scope, no entry ever appears in |
||
| policy allows aren't reachable until the developer confirms each one. For how | ||
| approval behaves and what satisfies it, see | ||
| [Approval-required access](network.md#approval-required-access). | ||
|
|
||
| Before you turn it on, note that you shouldn't combine an approval requirement | ||
| with HTTP method and path rules in the same policy. Approval works on whole | ||
| destinations, and an HTTP request that a gated HTTP rule allows is blocked | ||
| without a request a developer can respond to. Keep HTTP rules in a policy that | ||
| doesn't require approval. | ||
|
|
||
| To set it on an existing policy: | ||
|
|
||
| 1. Sign in to [Docker Home](https://app.docker.com) and select your | ||
| organization. | ||
| 1. In the left-hand navigation, expand **AI Platform** and select | ||
| **Network access**. | ||
| 1. Select the policy, then choose **Edit**. | ||
| 1. Turn on **Require approval before access**. | ||
| 1. Select **Save changes**. | ||
|
|
||
| The policy's detail page reports approval as **Required** or **Not required**. | ||
| Editing a policy replaces it in full, so turning the setting off removes the | ||
| requirement from every rule in that policy. | ||
|
|
||
| ## Configure a support message | ||
|
|
||
| Admins can add an optional support message that appears after the policy denial | ||
|
|
@@ -87,7 +148,7 @@ Organization policies are managed by access surface. Use the access-control | |
| pages for syntax, examples, and enforcement details: | ||
|
|
||
| - [Network access policies](network.md): control outbound network access from | ||
| sandboxes. | ||
| sandboxes, by host or by HTTP method and path. | ||
| - [Filesystem access policies](filesystem.md): control which host paths | ||
| sandboxes can mount as workspaces. | ||
| - [MCP access policies](mcp.md): control MCP server registration, tool calls, | ||
|
|
@@ -147,8 +208,11 @@ propagate to developer machines. To apply changes immediately, users can run | |
| organization policies on the next `sbx` command. | ||
|
|
||
| > [!WARNING] | ||
| > `sbx policy reset` deletes all locally configured policy rules. The command | ||
| > prompts for confirmation before proceeding. | ||
| > `sbx policy reset` deletes all locally configured policy rules, including any | ||
| > destinations the developer has approved under an | ||
| > [approval-required policy](network.md#approval-required-access). Those destinations are requested | ||
| > again the next time a sandbox reaches them. The command prompts for | ||
| > confirmation before proceeding. | ||
|
|
||
| #### Enforcement timing by policy type | ||
|
|
||
|
|
@@ -157,7 +221,13 @@ developer machine: | |
|
|
||
| - Network policy is evaluated on every outbound request. Once a policy | ||
| change has synced to the developer's machine (up to 5 minutes), it applies | ||
| immediately to subsequent requests. | ||
| immediately to subsequent requests. HTTP rules are evaluated per request in | ||
| the same way. | ||
|
|
||
| - An approval requirement applies from the point the policy change syncs. | ||
| Destinations a developer already approved stay reachable, because the | ||
| approval is recorded on the developer's machine. To withdraw one, add a deny | ||
| rule. A deny takes precedence over a recorded approval. | ||
|
|
||
| - Filesystem policy is only checked when a workspace is mounted — that | ||
| is, when a sandbox is created. Once a sandbox is running, changing the | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (super non-blocking): the "any ()" chip in the card-based composer (PR #17125) converts to 7 explicit method actions (
GET POST PUT DELETE PATCH HEAD OPTIONS), not thehttp:request:*wildcard. so "any ()" covers exactly the 7 methods the UI lists; a CONNECT or TRACE request to this destination won't match. the phrasing "every method the composer offers" is technically right, but a note that this differs from the CLI's--method ANY(which generates the true wildcard) might save a head-scratcher later.