-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add rule docs * update: add a single newline in the end of waf-rule * docs: remove the caution in waf rule * docs: add features to feature list
- Loading branch information
Showing
13 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: IP Rule | ||
description: Learn how to config IP rules in CasWAF. | ||
keywords: [caswaf] | ||
authors: [casbin] | ||
--- | ||
CasWAF provides a powerful IP rule feature to help you control the access of your website. You can add IP rules to allow or block specific IP addresses or IP ranges (CIDR only). | ||
|
||
![ip-rule](/img/rules/ip-rule.jpg) | ||
|
||
## IP Expression properties | ||
|
||
- `Name`: The name of the expression. It is used to identify the rule and have no effect on the rule itself. | ||
- `Operator`: The operator of the expression. It can be set to `is in` or `is not in`. | ||
- `Value`: The value of the expression. It can be set to IPv4 or IPv6 addresses or CIDR ranges (even mixed). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Rule List | ||
description: Learn how to add your server's rule in CasWAF. | ||
keywords: [caswaf] | ||
authors: [casbin] | ||
--- | ||
If you want your website under protection, you can add your rules in CasWAF. | ||
|
||
This section will provide a detailed explanation of the properties and usage of `Rule`. | ||
|
||
## Rule properties | ||
|
||
- `Name`: The name of the rule. | ||
- `Type`: The type of the rule. It can be set to `IP`, `User-Agent` and `WAF`. | ||
- `Expressions`: The expressions contains the rule's conditions, including `operator` and `value`. | ||
- `Action`: The action of the rule. It can be set to `Allow` or `Block`. | ||
- `Reason`: The reason of the rule. When the rule is hitted and its action is `Block`, CasWAF would reply a 403 response with the reason. | ||
|
||
## Manage Rules | ||
|
||
![rules](/img/rules/rules.jpg) | ||
|
||
In the Rules page, you will see all rules you have created. You can create, edit, delete and view the rule details. But now we don't have any rules. | ||
|
||
## Add a rule | ||
|
||
![addrule](/img/rules/addrule.jpg) | ||
|
||
Just click the `Add` button, you will create a rule. The created rule will have some default information that you can modify. | ||
|
||
## Edit rule | ||
|
||
After you create a rule, you can click the `edit` button to edit the rule. | ||
|
||
![editrule](/img/rules/editrule.jpg) | ||
|
||
Each field's meaning is as described above, and you can freely modify them according to the actual situation of your website. | ||
|
||
### Expressions | ||
|
||
![expressions](/img/rules/expressions.jpg) | ||
|
||
Click the `Add` button in the `Expressions` section, you Kcan add a new expression to the rule. | ||
|
||
Click the `Restore` button in the `Expressions` section, you can restore the default expressions of the rule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: User-Agent Rule | ||
description: Learn how to config User-Agent rules in CasWAF. | ||
keywords: [caswaf] | ||
authors: [casbin] | ||
--- | ||
CasWAF provides a User-Agent rule feature to help you control the access of your website. You can add User-Agent rules to allow or block specific User-Agents. | ||
|
||
![ua-rule](/img/rules/ua-rule.jpg) | ||
|
||
## User-Agent Expression properties | ||
|
||
- `Name`: The name of the expression. It is used to identify the rule and have no effect on the rule itself. | ||
- `Operator`: The operator of the expression. It can be set to `equals`, `does not equals`, `contains`, `does not contain` and `regex match`. | ||
- `Value`: The value of the expression. It can be set to any string. The default value is your current User-Agent. If you are using `regex match`, the value should be a regular expression. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: WAF Rule | ||
description: Learn how to config WAF rules in CasWAF. | ||
keywords: [caswaf] | ||
authors: [casbin] | ||
--- | ||
CasWAF use coraza WAF as the WAF engine, you can follow the [coraza seclang documents](https://coraza.io/docs/seclang/) to write your WAF rules. | ||
|
||
## WAF Expression properties | ||
|
||
- `Value`: The value of the rule. It should be a valid coraza WAF rule. | ||
|
||
## Supported disruptive actions | ||
|
||
| Seclang action | CasWAF action | Status code | | ||
| ----|------|---- | | ||
| allow | Allow | 200 | | ||
| block | Block | 403 | | ||
| deny | Deny | 403 | | ||
| drop | Drop | 400 | | ||
|
||
:::info | ||
We recommend that you have a good understanding of the coraza WAF rules before you write your own rules. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.