108 Commits

Author SHA1 Message Date
Robert Dower
e32017573c archive repository 2025-08-07 14:08:12 -07:00
Auke Kok
03f4d64ff6 Convert to pandoc.
Because pandoc is relatively small, we now create man page output on the
fly on building, which makes pandoc a required build time dependency.
2020-04-01 13:00:21 -07:00
Auke Kok
865ec916aa v21 v21 2020-02-13 11:01:45 -08:00
Auke Kok
6746c4a4db v20 v20 2020-02-13 10:42:53 -08:00
puneetse
7b700cf2a2 Add tallow.patterns man page
Add a tallow.patterns man page which explains the json configuration
files that contain regex patterns and banning thresholds. This
functionality was added by 9174590b04.
2020-02-13 10:31:09 -08:00
Thorsten Kukuk
3ffb46e8e7 Add extra path for firewall-cmd 2020-02-11 13:27:07 -08:00
Auke Kok
4b071b01f6 Need configure in this workflow. 2019-11-06 11:37:06 -08:00
Auke Kok
4212f1dbef Fix dependency. 2019-11-06 11:35:22 -08:00
Auke Kok
9260e519f5 Add github workflow integration. 2019-11-06 11:32:41 -08:00
Auke Kok
5dfb9821e3 v19 v19 2019-11-04 14:18:38 -08:00
Auke Kok
348fd7d744 Fixed signedness.
It appears that using a signed int causes the reads from libsystemd-journal
to return incorrect values when comparing time stamps. I've fixed them
to unsigned ones and monitored the performance on 2 systems for 3 days and
it no longer misbehaves. I've also made it use `atoll` instead of `atoi`
to prevent incomplete results.
2019-11-04 14:18:12 -08:00
Auke Kok
83201e8b32 v18 v18 2019-10-28 14:27:31 -07:00
Auke Kok
32fc0ecdaa Hide unwanted firewalld-cmd error messages. 2019-10-28 14:27:02 -07:00
Auke Kok
79f89d8b79 v17 v17 2019-10-22 13:39:34 -07:00
puneetse
ab57cc5dd7 Add firewalld support
Adds support to use firewalld if it is running and updates documentation accordingly.
2019-10-22 13:37:21 -07:00
puneetse
96fa692bf6 Fix command order in tallow.conf man page
An ipset needs to be created before an iptables rule can reference it.
2019-10-22 13:37:21 -07:00
Auke Kok
71e0fc6cca Add json-c to travis. 2019-10-03 14:04:30 -07:00
Boris Manojlovic
31205d7f16 make older compilers a bit happier 2019-08-26 14:08:04 -07:00
Boris Manojlovic
43998632aa add dovecot as postfix auth backend parsing 2019-08-26 14:08:04 -07:00
Auke Kok
e4b3977704 Ensure we don't replay old events.
Based on the RTC timestamp in the journal message, discard events
that happened before events we already processed.

This ensures that when the journal rotates, we won't reprocess
events again.
2019-04-25 13:23:03 -07:00
Auke Kok
feee1a2556 Add example whitelist defaults. 2019-04-19 14:36:46 -07:00
Auke Kok
35182b8447 Force insert iptables rules as rule #1.
This will better work together with other firewall tools.
2019-02-19 09:47:54 -08:00
Auke Kok
d29132144c Debug: print path to skipped file, not the other one. 2019-02-19 09:44:44 -08:00
Auke Kok
0a0a912c70 Move src files to /src/. 2019-01-23 15:56:17 -08:00
Auke Kok
6545cb0d33 Move man pages to /man/ folder. 2019-01-23 15:52:25 -08:00
Auke Kok
fdaa8ed34c v16 v16 2019-01-23 15:19:50 -08:00
Auke Kok
ea34b5b78c Return memory to the OS on prune. 2019-01-23 15:17:14 -08:00
Auke Kok
33191b04bf Run as nice by default. 2019-01-23 15:14:46 -08:00
Auke Kok
9174590b04 Convert patterns to JSON input files.
Tallow will now read JSON files from /usr/share/tallow/ and /etc/tallow
and parse them to retrieve filters and patterns. The sshd patterns
are converted to JSON and used to test this change.

If a file exists in /etc/tallow with the same name as a file in
/usr/share/tallow, only the file in /etc/tallow will be parsed.

This change allows much more dynamic insertion of rules and people
to create custom patterns and filters and monitor the logs of other
daemons besides sshd that may be subject to brutefoce login attempts.

Potential use cases:
- IMAP/POP services
- SMTP
- HTTP services permitted they log to syslog
- DNS servers logging malformed requests
- etc.
v15
2019-01-23 13:55:06 -08:00
Auke Kok
14152b1dad Re-create docs. v14 2018-10-04 11:35:59 -07:00
Auke Kok
e2f92ff75b Add 10. and 192.168. as default whitelist entries to tallow.
These entries can be removed from the whitelist by adding any
whitelist entry to the config file. If you add any entry, you
must repeat these in order to have them included, otherwise those
entries are not added to the custom list.
2018-10-04 11:34:47 -07:00
Auke Kok
4ff1206974 Tune down badness for attempts a small bit.
We're still blocking really agressively. Tune it down a notch
and make timeouts a bit less for human-error like conditions
(forgotten key, ^C etc).
2018-10-04 11:34:47 -07:00
ahkok
8c836013cd Merge pull request #8 from puneetse/master
Minor typo on tallow.conf man page
2018-10-04 11:30:39 -07:00
puneetse
a6fb19ff4f Minor typo on tallow.conf man page 2018-06-25 16:27:25 -07:00
Auke Kok
5503ff0b20 Possibly handle journald restarts better.
I've encountered two runaway tallow daemons now that seem to
coincide with journald restarts that send it spinning tight
on the `continue` statement and hitting the same _get_data()
error (ENOENT).

I'm unsure if the `break` will fix it, but the `continue`
is definitely broken here. Hopefully the `sd_journal_wait()`
will properly reassess the journal state and notify us of
rotations or other issues.
v11 untagged-b3f44d644b7903f8fa67
2018-06-25 12:13:30 -07:00
Auke Kok
8655223248 Remove HUP/TERM/INT sighandler, shield USR1 sighandler.
We remove, by default, all signal handlers. The USR1 handler
remains, but is shielded behind `#ifdef DEBUG`.
v10
2018-03-28 09:44:06 -07:00
Auke Kok
76a59df0f1 Fine-tune blocking rules one notch down.
Before, most rules would block on the 3rd rule hit, with this,
it's 4, which means 1 extra failure before a 1hr block is started
and this is a bit more sympathetic towards `typo` failures.
v9
2018-03-23 16:17:34 -07:00
Auke Kok
36946deeee v8 v8 2018-02-05 11:11:17 -08:00
Auke Kok
d51577bd4f Add one more preauth disconnect pattern.
This pattern has been recurring a lot recently and does not
get dropped as expected. It is another typical preauth failure.
2018-02-05 11:02:59 -08:00
Auke Kok
e15bfe4dc0 Document USR1, update man page output.
Some minor adjustments to Makefile.am to make this passable.
2018-01-19 10:25:20 -08:00
Auke Kok
d6e53e6f3a Rename to proper extension. 2018-01-19 09:39:50 -08:00
Auke Kok
a2a6d8e9ac v7. v7 2018-01-10 10:29:53 -08:00
Auke Kok
c5569176d2 Allow whitelist patterns.
This allows for some simple form of netmask type patterning
which will work for /8, /16 and /24 subnets to be whitelisted
for ipv4, and for any multiple of /32 subnets for ipv6.
2018-01-08 16:06:26 -08:00
Auke Kok
bf81c259b0 Add 'nocreate' option to bypass all rule/set creation.
This may help in situations where external tools are used to maintain
iptables or ipset setups and we should not disturb them by creating
rules.
2018-01-05 12:57:45 -08:00
Auke Kok
ff2a47756f v6 v6 2017-12-14 14:52:35 -08:00
Auke Kok
b18f636489 Assure blocked IP's expire before they can be detected again.
Otherwise, in rare conditions, an IP address may appear just
before it would expire, which would cause the IP to not be
blocked again.
2017-12-14 14:31:41 -08:00
Auke Kok
6e0251d3dc Update manual pages to indicate the various recent changes. 2017-12-14 10:00:44 -08:00
Auke Kok
60a90adbc5 Instant throttling of confirmed abuse.
Automatically `block` certain clients based on severity of the
produced error messages. These clients are for sure doing something
bad, and we don't want to let them try this more times before dropping
their packets.

The block is issued immediately, but it only lasts a short time.
Most likely, additional messages will come in after that cause a
longer ban anyway.

This also forces overwriting of ipset entries without warning, which
helps to keep the ipset list in sync without further statekeeping.

The pattern list has been expanded with the instant_block integer
value, which indicates that if the pattern matches, the IP should be
dropped for how many seconds.
2017-12-14 09:57:52 -08:00
Auke Kok
1f43bcbf12 Debug code for pruning. 2017-12-13 15:02:13 -08:00
Auke Kok
8da71a2184 Remove multiple block spam.
Some minor cleanups in here, and 2 extra rules. This now prevents
multiple messages coming in and causing 2 block commands to be
issued.
2017-12-12 15:26:30 -08:00