Skip to content

Commit f05c11b

Browse files
fzipitheseion
andcommitted
Apply suggestions from code review
Co-authored-by: Max Leske <[email protected]> Signed-off-by: Felipe Zipitria <[email protected]>
1 parent 1684729 commit f05c11b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ To run tests you need:
4141

4242
### YAML Config file
4343

44-
With a configuration file you can alter the test results or just provide neeed paths for files and enabling features. The config file has four basic values:
44+
With a configuration file you can alter the test results, set paths for your environment, or enable features. The config file has four basic values:
4545

4646
```yaml
47-
logfile: <the relative patch to the waf logfile>
47+
logfile: <the relative path to the WAF logfile>
4848
logmarkerheadername: <a header name used for log parsing (see "How log parsing works" below)>
4949
testoverride: <a list of things to override (see "Overriding tests" below)>
5050
mode: "default" or "cloud" (only change it if you need "cloud")
@@ -54,7 +54,7 @@ By default, _ftw_ would search for a file in `$PWD` with the name `.ftw.yaml`. Y
5454

5555
### Logfile
5656

57-
Running in default mode implies you have access to a logfile to contrast the WAF behavior with test results. Example configurations for `apache` and `nginx` can be found below:
57+
Running in default mode implies you have access to a logfile for checking the WAF behavior against test results. Example configurations for `apache` and `nginx` can be found below:
5858

5959
```yaml
6060
---
@@ -70,11 +70,11 @@ logfile: '../coreruleset/tests/logs/modsec3-nginx/nginx/error.log'
7070

7171
I normally perform my testing using the [Core Rule Set](https://github.com/coreruleset/coreruleset/).
7272

73-
You can start the containers from that repo using docker-compose:
73+
You can start the containers from that repo using `docker compose`:
7474

7575
```bash
7676
git clone https://github.com/coreruleset/coreruleset.git
77-
docker-compose -f tests/docker-compose.yml up -d modsec2-apache
77+
docker compose -f tests/docker-compose.yml up -d modsec2-apache
7878
```
7979

8080
## Running
@@ -98,7 +98,7 @@ Flags:
9898
-t, --time show time spent per test
9999
100100
Global Flags:
101-
--cloud cloud mode: rely only in http status code for determining test succes or failure (assumes no logs access)
101+
--cloud cloud mode: rely only on HTTP status codes for determining test success or failure (will not process any logs)
102102
--config string override config file (default is $PWD/.ftw.yaml)
103103
--debug debug output
104104
--trace trace output: really, really verbose
@@ -144,7 +144,7 @@ Happy testing!
144144
- templates with the power of Go [text/template](https://golang.org/pkg/text/template/). Add your template to any `data:` sections and enjoy!
145145
- [Sprig functions](https://masterminds.github.io/sprig/) can be added to templates as well.
146146
- Override test results.
147-
- Cloud mode! The new mode will override test results and only base the test result on http status code answers.
147+
- Cloud mode! This new mode will override test results and rely solely on HTTP status codes for determining success and failure of tests.
148148

149149
With templates and functions you can simplify bulk test writing, or even read values from the environment while executing. This features allow you to write tests like this:
150150

@@ -177,8 +177,8 @@ Other interesting functions you can use are: `randBytes`, `htpasswd`, `encryptAE
177177
Sometimes you have tests that work well for some platform combinations, e.g. Apache + modsecurity2, but fail for others, e.g. NGiNX + modsecurity3. Taking that into account, you can override test results using the `testoverride` config param. The test will be run, but the _result_ would be overriden, and your comment will be printed out.
178178

179179
Tests can be altered using four lists:
180-
- `input` allows you to override global parameters in tests. An example usage is if you want to change the `dest_addr` of all tests to point to an external IP or host.
181-
- `ignore` is for tests you want to ignore. It will still execute the test, but ignore the results. You should add a comment on why you ignore the test
180+
- `input` allows you to override global parameters in tests. An example usage is if you want to change the `dest_addr` of all tests to point to an external IP or host
181+
- `ignore` is for tests you want to ignore. It will still execute the test, but ignore the result. You should add a comment on why you ignore the test
182182
- `forcepass` is for tests you want to pass unconditionally. Test will be executed, and pass even when the test fails. You should add a comment on why you force pass the test
183183
- `forcefail` is for tests you want to fail unconditionally. Test will be executed, and fail even when the test passes. You should add a comment on why you force fail the test
184184

@@ -205,11 +205,11 @@ testoverride:
205205

206206
You can combine any of `ignore`, `forcefail` and `forcepass` to make it work for you.
207207

208-
## Cloud mode
208+
## ☁️ Cloud mode
209209

210210
Most of the tests rely on having access to a logfile to check for success or failure. Sometimes that is not possible, for example, when testing cloud services or servers where you don't have access to logfiles and/or logfiles won't have the information you need to decide if the test was good or bad.
211211

212-
With cloud mode we move the decision on test failure or success to the HTTP status code received after performing the test. The general idea is that you setup your WAF in blocking mode, so anything matching will return a block status (e.g. 403), and if not we expect a 2XX return code.
212+
With cloud mode, we move the decision on test failure or success to the HTTP status code received after performing the test. The general idea is that you setup your WAF in blocking mode, so anything matching will return a block status (e.g. 403), and if not we expect a 2XX return code.
213213

214214
An example config file for this is:
215215
```

0 commit comments

Comments
 (0)