diff --git a/docs/compound-rule.mdx b/docs/compound-rule.mdx new file mode 100644 index 0000000..9b82a21 --- /dev/null +++ b/docs/compound-rule.mdx @@ -0,0 +1,14 @@ +--- +title: Compound Rule +description: Learn how to config Compound rules in CasWAF. +keywords: [caswaf] +authors: [casbin] +--- +CasWAF provides a Compound rule feature to help you control the access of your website. With Compound rules, you can combine multiple rules with logical operators to create complex access control policies. + +![compound-rule](/img/rules/compound-rule.jpg) + +## Compound Expression properties + +- `Logic`: The logical operator of the compound rule. It can be set to `and` or `or`, and the first rule in the compound rule will be ignored if the logical operator is `begin`. During expression evaluation, `and` has a higher priority than `or`. For example, `A and B or C` is equivalent to `(A and B) or C`. +- `Rule`: The rules that need to be combined. diff --git a/docs/ip-rate-rule.mdx b/docs/ip-rate-rule.mdx new file mode 100644 index 0000000..2662fc7 --- /dev/null +++ b/docs/ip-rate-rule.mdx @@ -0,0 +1,15 @@ +--- +title: IP Rate Rule +description: Learn how to config IP Rate rules in CasWAF. +keywords: [caswaf] +authors: [casbin] +--- +CasWAF provides a powerful IP Rate rule feature to help you control the access of your website. You can add IP Rate rules to limit the access rate to your website based on IP addresses. + +![ip-rate-rule](/img/rules/ip-rate-rule.jpg) + +## IP Rate Expression properties + +- `Name`: The name of the expression. It is used to identify the rule and have no effect on the rule itself. +- `Rate`: The max request rate for a single IP address. It should be a positive integer. +- `Block Duration`: The duration of blocking the IP address when the rate limit is exceeded. It should be a positive integer in seconds. diff --git a/sidebars.js b/sidebars.js index 81ee083..7161bad 100644 --- a/sidebars.js +++ b/sidebars.js @@ -47,6 +47,8 @@ module.exports = { "ip-rule", "ua-rule", "waf-rule", + "ip-rate-rule", + "compound-rule", ], }, // { diff --git a/static/img/rules/compound-rule.jpg b/static/img/rules/compound-rule.jpg new file mode 100644 index 0000000..0e2f197 Binary files /dev/null and b/static/img/rules/compound-rule.jpg differ diff --git a/static/img/rules/ip-rate-rule.jpg b/static/img/rules/ip-rate-rule.jpg new file mode 100644 index 0000000..bf0fc31 Binary files /dev/null and b/static/img/rules/ip-rate-rule.jpg differ