Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
woehrl01 committed Oct 14, 2023
1 parent 3381390 commit bd991ed
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ Targets:
```

### Building requirements

Building the filter requires:
- [Go](https://go.dev/doc/install)

- [Go](https://go.dev/doc/install)
- [TinyGo](https://tinygo.org/getting-started/install/)

Up to date required versions can be found looking at [`minGoVersion` and `tinygoMinorVersion` variables](./magefiles/magefile.go).
Expand All @@ -39,6 +41,22 @@ go run mage.go build

You will find the WASM plugin under `./build/main.wasm`.

### Building with `geoipLookup` Support

1. **Provide Database File**: Ensure you have a GeoIP2 ([oschwald/geoip2-golang](https://github.com/oschwald/geoip2-golang)) compatible database. Place this file with the name `geoip.mmdb` in the project's root folder.

2. **Choose Database Preference:** Depending on the type of the database you desire, set the `GEOIP` environment variable to either of the following:

- For city-level database: `GEOIP=CITY`
- For country-level database: `GEOIP=COUNTRY`

3. **Build the Project:** With the appropriate `GEOIP` variable set, proceed to build the project.

```bash
export GEOIP=CITY
go run mage.go build
```

### Multiphase

By default, coraza-proxy-wasm runs with multiphase evaluation enabled (See [coraza.rule.multiphase_evaluation](.magefiles/magefile.go) build tag). It enables the evaluation of rule variables in the phases that they are ready for, potentially anticipating the phase the rule is defined for. This feature suits coraza-proxy-wasm, and specifically Envoy request lifecycle, aiming to inspect data that has been received so far as soon as possible. It leads to enforce actions the earliest possible, avoiding WAF bypasses. This functionality, in conjunction with the [early blocking CRS feature](#recommendations-using-crs-with-proxy-wasm), permits to effectively raise the anomaly score and eventually drop the request at the earliest possible phase.
Expand Down

0 comments on commit bd991ed

Please sign in to comment.