Update 'README.md'

This commit is contained in:
Steven Polley 2020-05-30 04:10:23 +00:00
parent d510a130b5
commit 1441a69308

View File

@ -1,3 +1,41 @@
# wafredir
HTTP redirect builder for FortiWeb WAFs. Configure your WAF from a spreadsheet.
HTTP redirect builder for FortiWeb WAFs. Configure your WAF from a spreadsheet.
### Build
1. Install Go from https://golang.org
2. Open a terminal from this directory and run the command:
```shell
go build .
```
### Usage
Arguments of wafredir:
-action string
action can be either 'config' or 'test'. 'config' will read the input csv file and generate FortiOS compliant configuration to create redirection policies. 'test' will read the input csv file and validate that the redirects are actually working by making requests
at the source URL and validating a redirect to the destination URL actually occurs. (default "config")
-concurrentReq int
only used with the action 'test'. Determines the maximum number concurrent HTTP GET requests which can be in flight at any given time. (default 8)
-csvfile string
path to an input csv file. The first column of the file should be the source URL, the second column of the file should be the destination URL, and the third column should be the status code (for example 301 or 302). (default "redirects.csv")
### Example input csv
The first column is the source URL, the second column is the destination URL, the third column is the redirect type, must be either 301 or 302.
```csv
http://myoldsite.com/boomer,https://mynewsite.io/zoomer,301
https://myoldblog.net/blog/post/1,https://mynewblog.ru/cykablyat,302
http://mysite.org,https://yoursite.net/referral/mysite,301
```
### Example output of config mode
```txt
http://myoldsite.com/boomer,https://mynewsite.io/zoomer,301
https://myoldblog.net/blog/post/1,https://mynewblog.ru/cykablyat,302
http://mysite.org,https://yoursite.net/referral/mysite,301
```