---
title: "ezgh waf create"
description: "Create a WAF."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh waf create

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh waf create <name> [--mode block|log] [--managed-rule-set name[=log]…] [--logging matched|all --logging-environment env] [--from-file waf.json] [flags]
```

Create a WAF. Without `--managed-rule-set` it runs no managed rule sets, and without rules (`ezgh waf rules add`) none of your own: it allows everything until you add some. `--mode` log records what it would block and blocks nothing, to try it on real traffic first.

`--from-file` takes the whole WAF as JSON, with its rules, managed rule set settings (paranoia level, rule overrides) and logging: what `ezgh waf get -o json` prints, or only the fields you set. A name given here replaces the file's.

`--logging` sends request logs to an Obs environment in the project (`--logging-environment`), which needs obs.logs.ingest there too.

Part of [`ezgh waf`](/cli/reference/waf).

## Examples

```sh
ezgh waf create web --managed-rule-set ezgh/core --managed-rule-set ezgh/php
ezgh waf create web --mode log --managed-rule-set ezgh/core --logging matched --logging-environment prod
ezgh waf create --from-file waf.json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--description` | string |  | what it's for |
| `-f`, `--from-file` | string |  | the WAF as JSON (what `ezgh waf get -o json` prints), - for stdin; flags change it further |
| `--logging` | string |  | request logs to Obs: off, matched (the requests a rule matched) or all (default off) |
| `--logging-environment` | string |  | the Obs environment in the project request logs go to |
| `--managed-rule-set` | string, repeatable |  | a managed rule set to run, name or name=log (ezgh/core, ezgh/php, ezgh/node, ezgh/known-bad-inputs); repeat for more, in order, replacing the list |
| `--mode` | string |  | block, or log to record what it would block and block nothing (default block) |
| `--tag` | string, repeatable |  | a tag, key=value; repeat for more |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/waf-create/index.mdx
