Skip to content

Commit bc00c90

Browse files
CopilotMossaka
andcommitted
docs: add missing container configuration flags to CLI reference
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/3205fc6a-2852-4cee-bc87-7ada09a9761e Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
1 parent 3ea2226 commit bc00c90

File tree

1 file changed

+129
-1
lines changed

1 file changed

+129
-1
lines changed

docs-site/src/content/docs/reference/cli-reference.md

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ awf [options] -- <command>
2121
|--------|------|---------|-------------|
2222
| `--allow-domains <domains>` | string || Comma-separated list of allowed domains (optional; if not specified, all network access is blocked) |
2323
| `--allow-domains-file <path>` | string || Path to file containing allowed domains |
24+
| `--ruleset-file <path>` | string | `[]` | YAML rule file for domain allowlisting (repeatable) |
2425
| `--block-domains <domains>` | string || Comma-separated list of blocked domains (takes precedence over allowed) |
2526
| `--block-domains-file <path>` | string || Path to file containing blocked domains |
2627
| `--ssl-bump` | flag | `false` | Enable SSL Bump for HTTPS content inspection |
2728
| `--allow-urls <urls>` | string || Comma-separated list of allowed URL patterns (requires `--ssl-bump`) |
2829
| `--log-level <level>` | string | `info` | Logging verbosity: `debug`, `info`, `warn`, `error` |
2930
| `--keep-containers` | flag | `false` | Keep containers running after command exits |
31+
| `--agent-timeout <minutes>` | number | no limit | Maximum time in minutes for the agent command to run |
3032
| `--tty` | flag | `false` | Allocate pseudo-TTY for interactive tools |
3133
| `--work-dir <dir>` | string | `/tmp/awf-<timestamp>` | Working directory for temporary files |
3234
| `--build-local` | flag | `false` | Build containers locally instead of pulling from registry |
@@ -36,11 +38,14 @@ awf [options] -- <command>
3638
| `-e, --env <KEY=VALUE>` | string | `[]` | Environment variable (repeatable) |
3739
| `--env-all` | flag | `false` | Pass all host environment variables |
3840
| `--exclude-env <name>` | string | `[]` | Exclude a variable from `--env-all` passthrough (repeatable) |
41+
| `--env-file <path>` | string || Read env vars from a file (KEY=VALUE format, one per line) |
3942
| `-v, --mount <host:container[:mode]>` | string | `[]` | Volume mount (repeatable) |
4043
| `--container-workdir <dir>` | string | User home | Working directory inside container |
44+
| `--memory-limit <limit>` | string | `6g` | Memory limit for the agent container |
4145
| `--dns-servers <servers>` | string | Auto-detected | Trusted DNS servers (comma-separated; auto-detected from host, falls back to `8.8.8.8,8.8.4.4`) |
4246
| `--dns-over-https [resolver-url]` | optional string | `https://dns.google/dns-query` | Enable DNS-over-HTTPS via sidecar proxy |
4347
| `--proxy-logs-dir <path>` | string || Directory to save Squid proxy logs to |
48+
| `--audit-dir <path>` | string || Directory for firewall audit artifacts |
4449
| `--enable-host-access` | flag | `false` | Enable access to host services via host.docker.internal |
4550
| `--allow-host-ports <ports>` | string | `80,443` | Ports to allow when using --enable-host-access |
4651
| `--allow-host-service-ports <ports>` | string || Ports to allow ONLY to host gateway (for GitHub Actions `services:`) |
@@ -96,6 +101,35 @@ Path to file with allowed domains. Supports comments (`#`) and one domain per li
96101
--allow-domains-file ./allowed-domains.txt
97102
```
98103

104+
### `--ruleset-file <path>`
105+
106+
YAML rule file for domain allowlisting. Can be specified multiple times to load multiple files. Domains from ruleset files are merged with `--allow-domains` and `--allow-domains-file`.
107+
108+
```bash
109+
# Single ruleset file
110+
--ruleset-file ./domains.yml
111+
112+
# Multiple ruleset files
113+
--ruleset-file ./base-domains.yml --ruleset-file ./extra-domains.yml
114+
```
115+
116+
**Schema** (version 1):
117+
118+
```yaml
119+
version: 1
120+
rules:
121+
- domain: github.com
122+
subdomains: true # default: true — also allows *.github.com
123+
- domain: example.com
124+
subdomains: false # exact match only
125+
```
126+
127+
**Fields:**
128+
- `version` — Must be `1`
129+
- `rules` — Array of rule objects
130+
- `domain` *(required)* — Domain name to allow
131+
- `subdomains` *(optional, default: `true`)* — Whether to also allow all subdomains
132+
99133
### `--block-domains <domains>`
100134

101135
Comma-separated list of blocked domains. **Blocked domains take precedence over allowed domains**, enabling fine-grained control. Supports the same wildcard patterns as `--allow-domains`.
@@ -176,6 +210,24 @@ Keep containers and configuration files after command exits for debugging.
176210
Requires manual cleanup: `docker stop awf-squid awf-agent && docker network rm awf-net`
177211
:::
178212

213+
### `--agent-timeout <minutes>`
214+
215+
Maximum time in minutes for the agent command to run. When the timeout is reached, the agent container is stopped and the firewall exits. Must be a positive integer.
216+
217+
```bash
218+
# Allow up to 30 minutes
219+
sudo awf --agent-timeout 30 --allow-domains github.com \
220+
-- long-running-command
221+
222+
# Allow up to 2 hours
223+
sudo awf --agent-timeout 120 --allow-domains github.com \
224+
-- npx @github/copilot@latest --prompt "complex task"
225+
```
226+
227+
:::note
228+
By default, there is no time limit. Use this flag to prevent runaway agent processes.
229+
:::
230+
179231
### `--tty`
180232

181233
Allocate a pseudo-TTY for interactive tools (e.g., Claude Code, interactive shells).
@@ -234,9 +286,47 @@ Pass environment variable to container. Can be specified multiple times.
234286
Pass all host environment variables to container.
235287

236288
:::danger[Security Risk]
237-
May expose sensitive credentials. Prefer `-e` for specific variables.
289+
May expose sensitive credentials. Prefer `-e` for specific variables, or use `--exclude-env` to filter out sensitive variables.
238290
:::
239291

292+
### `--exclude-env <name>`
293+
294+
Exclude a specific environment variable from `--env-all` passthrough. Can be specified multiple times. Only meaningful when used with `--env-all`.
295+
296+
```bash
297+
# Pass all env vars except secrets
298+
sudo -E awf --env-all \
299+
--exclude-env AWS_SECRET_ACCESS_KEY \
300+
--exclude-env GITHUB_TOKEN \
301+
--allow-domains github.com \
302+
-- my-command
303+
```
304+
305+
:::tip[Security Best Practice]
306+
When using `--env-all`, always exclude sensitive variables like API keys, tokens, and credentials with `--exclude-env`.
307+
:::
308+
309+
### `--env-file <path>`
310+
311+
Read environment variables from a file. The file uses `KEY=VALUE` format with one variable per line. Lines starting with `#` are treated as comments.
312+
313+
```bash
314+
sudo awf --env-file ./env.production \
315+
--allow-domains github.com \
316+
-- my-command
317+
```
318+
319+
**File format:**
320+
```bash
321+
# Database configuration
322+
DB_HOST=localhost
323+
DB_PORT=5432
324+
325+
# API settings
326+
API_KEY=my-key
327+
DEBUG=true
328+
```
329+
240330
### `-v, --mount <host_path:container_path[:mode]>`
241331

242332
Mount host directories into container. Format: `host_path:container_path[:ro|rw]`
@@ -260,6 +350,26 @@ Mount host directories into container. Format: `host_path:container_path[:ro|rw]
260350

261351
Working directory inside the container.
262352

353+
### `--memory-limit <limit>`
354+
355+
Memory limit for the agent container. Format: `<number><unit>` where unit is `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes).
356+
357+
- **Default**: `6g`
358+
359+
```bash
360+
# Increase memory for large language model agents
361+
sudo awf --memory-limit 8g --allow-domains github.com \
362+
-- memory-intensive-command
363+
364+
# Reduce memory for lightweight tasks
365+
sudo awf --memory-limit 2g --allow-domains github.com \
366+
-- curl https://api.github.com
367+
```
368+
369+
:::tip
370+
If your agent process is being killed unexpectedly (OOM), try increasing the memory limit with `--memory-limit 8g` or higher.
371+
:::
372+
263373
### `--dns-servers <servers>`
264374

265375
Comma-separated list of trusted DNS servers. DNS traffic is **only** allowed to these servers, preventing DNS-based data exfiltration. Both IPv4 and IPv6 addresses are supported.
@@ -380,6 +490,24 @@ cat ./firewall-logs/access.log
380490

381491
**Note:** The directory must be writable by the current user.
382492

493+
### `--audit-dir <path>`
494+
495+
Directory for firewall audit artifacts. When specified, the firewall saves configuration files, the policy manifest, and iptables state to this directory for compliance and debugging purposes.
496+
497+
```bash
498+
# Save audit artifacts
499+
sudo awf --audit-dir ./audit \
500+
--allow-domains github.com \
501+
-- curl https://api.github.com
502+
503+
# Review audit artifacts
504+
ls ./audit/
505+
```
506+
507+
:::tip
508+
Use `--audit-dir` in CI/CD pipelines to capture firewall configuration for audit trails. Can also be set via the `AWF_AUDIT_DIR` environment variable.
509+
:::
510+
383511
### `--agent-image <value>`
384512

385513
Specify the agent container image to use. Supports pre-built presets or custom base images.

0 commit comments

Comments
 (0)