block time increases by a factor of 2 instead of 1.5

Issue #185 closed
Kohei YOSHIDA created an issue

The sshguard(8) manual states, “Subsequent blocks increase in duration by a factor of 1.5.” However, both the log messages and the source code suggest that the actual increase is by a factor of 2.

Could this be clarified or corrected to accurately reflect the behavior of sshguard?

Documentation:

Log messages:

sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 100 with danger 10.
sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 100 with danger 10.
sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 110 with danger 10.
sshguard[2831837]: Blocking "XXX.XXX.XXX.XXX/32" for 300 secs (3 attacks in 1 secs, after 1 abuses over 1 secs.)
sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 100 with danger 10.
sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 100 with danger 10.
sshguard[2831837]: Attack from "XXX.XXX.XXX.XXX" on service 110 with danger 10.
sshguard[2831837]: Blocking "XXX.XXX.XXX.XXX/32" for 600 secs (3 attacks in 1 secs, after 2 abuses over 501 secs.)

Source code:

https://bitbucket.org/sshguard/sshguard/src/58faf8d0341def36488b3b72877fba61301b0524/src/blocker/blocker.c?at=master#lines-266:268

Comments (4)

  1. Kevin Zheng

    Hi there,

    Thanks for writing in with this observation. Indeed, the manual pages need to be updated to reflect 2 as the correct factor.

    Thanks,

    Kevin

  2. Kohei YOSHIDA reporter

    Thank you for the quick fix!

    I noticed that the comment regarding BLOCK_TIME in examples/sshguard.conf.sample still mentions an increase factor of 1.5. Could this be also updated to reflect the correct increase factor?

  3. Log in to comment