-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rate limit ssh attempts to WAN zone #120
Changes from 6 commits
2e16b44
883fd34
dd562f2
14fd452
220027a
40f2882
e45da0d
4dac40d
25b1ef8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
config defaults | ||
option syn_flood '1' | ||
option input 'DROP' | ||
|
@@ -61,6 +60,17 @@ config forwarding | |
config rule | ||
option src 'wan' | ||
option dest_port '22' | ||
option proto 'tcp' | ||
option state 'NEW' | ||
option limit '3/min' | ||
option limit_burst '2' | ||
option target 'LOG' | ||
|
||
config rule | ||
option src 'wan' | ||
option dest_port '22' | ||
option state 'RELATED' | ||
option state 'ESTABLISHED' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seem to be two state options here. Is this intentional (it's sorta valid), or is it supposed to be a list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's intentional. I wasn't totally sure whether I could put two state options in a single config rule, but it seems to work. I could break it out if you want. |
||
option target 'ACCEPT' | ||
option proto 'tcp' | ||
|
||
|
@@ -167,3 +177,6 @@ config rule | |
option src 'vpn' | ||
option proto 'icmp' | ||
option target 'ACCEPT' | ||
|
||
config include | ||
option path '/etc/firewall.user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no 'state' option in the OpenWRT wiki's page about the UCI firewall, as far as I can see. Is this an undocumented option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. I could have sworn I read it on one of the openwrt wiki pages or forum posts but now I can't find it. State is supported by iptables. The closest I can find in the UCI documentation is "The iptables rules generated for this section rely on the state match." I must have guessed at it.