Skip to content
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

Support deny_action: TARPIT #127

Closed
gloomytrousers opened this issue Feb 6, 2022 · 3 comments
Closed

Support deny_action: TARPIT #127

gloomytrousers opened this issue Feb 6, 2022 · 3 comments

Comments

@gloomytrousers
Copy link

With xtables-addons installed, there is a TARPIT target available in iptables. However, setting deny_action: TARPIT in crowdsec-firewall-bouncer.yaml is ignored - it defaults to DENY.

Please allow TARPIT as an accepted value for deny_action. Looks like iptables.go is the right place for this.

I'd also suggest it's better to fail with an error if the config contains an unsupported value, rather than silently picking a default - this will likely prevent a lot of head scratching.

@LaurenceJJones
Copy link
Contributor

So we could have a slice of supported actions we check if value is in slice if not error on startup

var target string
if strings.EqualFold(config.DenyAction, "REJECT") {
target = "REJECT"
} else {
target = "DROP"
}

@LaurenceJJones
Copy link
Contributor

Will be released in next version

@gloomytrousers
Copy link
Author

Just in case anyone stumbles upon this in future... despite the fix in this ticket, TARPIT doesn't work. The bouncer tries to set up an iptables rule for all protocols with TARPIT as the target, which results in "x_tables: ip_tables: TARPIT target: only valid for protocol 6" (i.e. TCP).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants