You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,10 @@ To run tests you need:
41
41
42
42
### YAML Config file
43
43
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:
45
45
46
46
```yaml
47
-
logfile: <the relative patch to the waf logfile>
47
+
logfile: <the relative path to the WAF logfile>
48
48
logmarkerheadername: <a header name used for log parsing (see "How log parsing works" below)>
49
49
testoverride: <a list of things to override (see "Overriding tests" below)>
50
50
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
54
54
55
55
### Logfile
56
56
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:
docker-compose -f tests/docker-compose.yml up -d modsec2-apache
77
+
dockercompose -f tests/docker-compose.yml up -d modsec2-apache
78
78
```
79
79
80
80
## Running
@@ -98,7 +98,7 @@ Flags:
98
98
-t, --time show time spent per test
99
99
100
100
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)
102
102
--config string override config file (default is $PWD/.ftw.yaml)
103
103
--debug debug output
104
104
--trace trace output: really, really verbose
@@ -144,7 +144,7 @@ Happy testing!
144
144
- templates with the power of Go [text/template](https://golang.org/pkg/text/template/). Add your template to any `data:` sections and enjoy!
145
145
- [Sprig functions](https://masterminds.github.io/sprig/) can be added to templates as well.
146
146
- 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.
148
148
149
149
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:
150
150
@@ -177,8 +177,8 @@ Other interesting functions you can use are: `randBytes`, `htpasswd`, `encryptAE
177
177
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.
178
178
179
179
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
182
182
- `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
183
183
- `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
184
184
@@ -205,11 +205,11 @@ testoverride:
205
205
206
206
You can combine any of `ignore`, `forcefail` and `forcepass` to make it work for you.
207
207
208
-
## Cloud mode
208
+
## ☁️ Cloud mode
209
209
210
210
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.
211
211
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.
0 commit comments