Skip to content

Commit

Permalink
feat(pillar.example,test/): add example and test for richrule ratelimit
Browse files Browse the repository at this point in the history
Document and test the accept rate limiting of the rich rule.

Signed-off-by: Arnaud Patard <[email protected]>
  • Loading branch information
apatard committed Jan 21, 2021
1 parent a2f4f3b commit f258526
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ firewalld:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http

ports:
# {%- if grains['id'] == 'salt.example.com' %}
- comment: salt-master
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/controls/zones_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
<source ipset="fail2ban-ssh" />
<reject type="icmp-port-unreachable" />
</rule>
<rule>
<service name="http" />
<log prefix="http fw limit 3/m" level="warning">
<limit value="3/m"/>
</log>
<accept> <limit value="3/m"/></accept>
</rule>
</zone>
ZONE_XML
end
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/amazonlinux-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/arch-base-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/fedora-31.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/fedora-32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/ubuntu-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down
7 changes: 7 additions & 0 deletions test/integration/default/files/_mapdata/ubuntu-20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ values:
name: fail2ban-ssh
reject:
type: icmp-port-unreachable
- accept:
limit: "3/m"
log:
level: warning
limit: "3/m"
prefix: "http fw limit 3/m"
service: http
services:
- http
- https
Expand Down

0 comments on commit f258526

Please sign in to comment.