Commit Graph

104 Commits (master)

Author SHA1 Message Date
Soner Tari dfb783d7ba Release v0.9.5
Bump version to 0.9.5
Update copyright year to 2024
Update NEWS
3 months ago
Soner Tari dc40f74c13 Update copyright year to 2022 2 years ago
Soner Tari 3dea854173 Improve documentation 2 years ago
Soner Tari 7033afced1 Improve documentation 3 years ago
Soner Tari fe3bdc5dac Migrate to travis-ci.com 3 years ago
Soner Tari eba4eb3ea6 Fix syntax documentation for Log actions in struct filtering rules
And clean up
3 years ago
Soner Tari 3e55d4820e Release v0.9.1 3 years ago
Soner Tari 700a901e29 Add missing FilterRule option to proxyspec documentation 3 years ago
Soner Tari 5877e81301 Improve proxyspec documentation 3 years ago
Soner Tari 9708225bb1 Rename LogAction to Log 3 years ago
Soner Tari 8f63ec7f82 Add ReconnectSSL option to enforce SSL options in struct filtering rules
The ReconnectSSL option allows rule developers to write struct filtering
rules using SNI and CN SSL specifications to override the SSL
configuration of a connection.

Otherwise, without this new option, filtering rules cannot change SSL
options using SSL filtering fields to match connections (the SSL config
in the rule would not have any effect on the server side of the matching
connection). Without ReconnectSSL, only DstIP and DstPort fields can be
used to override the SSL config of a connection.

If the ReconnectSSL option in a struct filtering rule is set, we
disconnect and free the server side of the matching SSL connection, and
reconnect it with the SSL options in the matching struct filtering rule.
This enforces the SSL config in the rule.

Do not use the ReconnectSSL option if server disconnect is not desirable
or acceptable in your case.
3 years ago
Soner Tari 98d9a05eac Add documentation for structured filtering rules 3 years ago
Soner Tari 07c3f08584 Release v0.9.0 3 years ago
Soner Tari 42d84629f3 Add support for inline comments with #
Just trim the char # onwards from the start of value. So values cannot
have the char # in them.
3 years ago
Soner Tari f056f699c1 Add port option to all site specs, fix precedences in filtering rules
Now, all of the 'to' site fields in filtering rules can specify a port,
not just the dstip sites.

Fix the precedence of sites in the same type of rules. For example, if
we find a match with an sni site, we should not stop searching for a
match in cn, because a matching cn site may have a higher precedence
than the matching sni site. We should apply the action of the cn site,
although sni rules have precedence over cn. The same applies to http
host and uri rules too.

Fix the precedence of dstip rules.

Improve and update unit and e2e tests accordingly.
3 years ago
Soner Tari 017f0f8631 Improve and clean up code and documentation 3 years ago
Soner Tari 9d2e523cd0 Use Aho-Corasick machines for substring matching
Now, the filter uses B-trees for exact string matching and Aho-Corasick
machines for substring matching. B-trees and AC machines are exported to
linked lists for debug logging only.

Also,
- Separate all_sites and all_ports filters from substring filters. They
are not related with substring filters actually, and ACM keywords cannot
be empty strings anyway. So now they should be handled separately too.
- Improve debug logging of filtering rules.
- Update unit tests accordingly, and improve.
- Fix pxyconn_filter(), keep searching for a match in substring filters
if exact match does not have a matching site rule.
- Increase common names max len and tokens. weather.gov has 73 tokens.
- Rename keyword to desc.
- Update documentation.
- Clean up.
3 years ago
Soner Tari 97117d4e50 Fix and update documentation
We use B-tree not BST
3 years ago
Soner Tari e654ca4e2c Fix memory leaks in filter
Add attributes
Update documentation
3 years ago
Soner Tari f44f12456c Fix unit tests with WITHOUT_USERAUTH
And update documentation
3 years ago
Soner Tari 15991dfb93 Use kbtree BST for exact match in user, keyword, and ip 'from' fields
So, now we use two separate data structures: binary search trees (BST)
for exact match and linked lists for substring match.

Currently, only user, keyword, and ip 'from' fields in filtering rules
use these two data structures. This also means that now we support exact
and substring matches in 'from' fields.

Filtering rules should be written with exact matches instead of
substring matches, as much as possible. Because BST search must be much
faster than substring search over linked lists.

We have modifed kbtree to support complex data structures in from
fields.
3 years ago
Soner Tari ec816e7db6 Fix documentation of user desc keyword exact search 3 years ago
Soner Tari 2b4cbd27fd Increase max tokens for filter rules to 17
+= port + serverport

And improve documentation
3 years ago
Soner Tari c8f09d162a Add port field to Dst Host filter rules, and refactor for code reuse
Now the target IP address filters can use port specs too.
Refactor for code reuse, create filter_action struct used by rules,
sites, and ports.
Also, improve code and documentation.
3 years ago
Soner Tari db9974617f Improve documentation
The Include and Define options, the ordering in config options, etc.
3 years ago
Soner Tari c38c065923 Add Include option for loading configuration from an include file 3 years ago
Soner Tari 0f5ed122fb Add Define option for macro definitions and macro expansion to filtering rules
The new Define option can be used for defining macros to be used in
filtering rules. Macro names must begin with a '$' char. Macro values
must be separated with spaces.

Macros are expanded by rewriting the rule with the values of macro.

PassSite rules do not support macros (the PassSite option will be
deprecated in favor of filtering rules in the future).
3 years ago
Soner Tari ac3607a841 Add deferred pass and block actions
We should defer pass and/or block actions as long as possible, because a
higher precedence rule in SSL filter should be able to override (cancel)
deferred pass and block actions taken by a lower precedence rule in Dst
Host filter. And in HTTP filter the same applies to deferred block
actions taken by Dst Host and SSL filters.

Also, thanks to this new deferred actions, now HTTP filter can keep
enabled divert and split modes. In other words, a higher precedence HTTP
filter rule can cancel a deferred block action set by a lower precedence
rule earlier, which was not possible before without deferred actions and
rule precedence.

And other improvements.
3 years ago
Soner Tari 11884271fd Add negation prefix ! to log actions
Now filtering rules can disable log actions too. This is possible thanks
to the newly added precedence field of rules. Log actions of filtering
rules at higher precedence can modify logging now. In other words, more
specific rules can change the log actions of more general rules.
HTTP filtering rules can only disable logging.
3 years ago
Soner Tari cc7bd4a332 Add precedence to filtering rules
Now we assign precedence to each filtering rule. More specific rules
have higher precedence. So, filtering rules at lower precedence cannot
override the actions applied to a conn by filtering rules at higher
precedence.
The other precedence rules still apply.
3 years ago
Soner Tari 8ec97d779f Do not take log actions in HTTP filtering rules
Log actions specified in HTTP filter rules can never enable disabled
logging, because their loggers would not be initialized.

Perhaps we should initialize them in the log submit function, if they
are initialized yet.
3 years ago
Soner Tari 8a57d52f62 Add master and cert log actions
Also, improve documentation
3 years ago
Soner Tari 357e6050db Do not init content logging for the connection if its log action is disabled
So now, we don't create any content log file if that log action is
disabled.
Also, improve documentation.
3 years ago
Soner Tari f0c2ca6819 Add Match action and connect|content|pcap|mirror log actions in filtering rules
- Match action is added to be used with log actions only, the other
filter actions can specify log actions too
- Log actions do not configure any loggers. Global loggers for
respective log actions should have been configured for those log actions
to have any effect.
- If no filter rules are defined for a proxyspec, all log actions are
enabled. Otherwise, all log actions are disabled, and filtering rules
should enable them specifically.
- Fix max number of tokens in proxyspec and filter parsers
- Fix issues with rejecting unknown args in filter rule parser
- Do not use filter_rules field of proxyspec after config finished, it
is used for filter configuration and freed afterwards
3 years ago
Soner Tari 8d752b4d31 Add documentation for filtering rules
Also bump version to 0.8.7
3 years ago
Soner Tari f2d4ef61c9 Add support for passsite substring match
Now the site field in PassSite option can have an '*' suffix to search
for a match anywhere in sni or common names. Note that this is not a
regex or wildcard search.

Previously, we only supported exact matches in sni and between slashes
in common names. This change makes it possible to cover multiple sites
in one PassSite option. In fact, without this change, certain sites
could not be added as passsite, because it was impossible to know their
subdomain names beforehand, for example *.fbcdn.net, which may have many
subdomain names in place of asterisk.

So to use substring match, append an '*' to a site name in PassSite
option (the asterisk is removed before substring search). For example,
use ".fbcdn.net*" to match all subdomains of fbcdn.net, notice the
asterisk at the end.

We also add a warning log starting with "Closing on ssl error without
passsite match" to report sites that can be added as passsite, which is
expected to help in writing PassSite rules.

Also, we now set dstaddr_str earlier in conn handling, so we can print
it in debug logs. This also helps in IDLE and EXPIRED conn logs.
3 years ago
Soner Tari 69753b250c Add split mode of operation similar to SSLsplit
The -n command line option enables split mode for all proxyspecs,
effectively making sslproxy behave like sslsplit.
Divert option can be set/unset globally and per-proxyspec.
Add e2e tests for split mode, and update make file for tests
accordingly.
Update documentation accordingly.
Improve code reuse, remove duplicate functions.

This change deserves a release of its own, hence v0.8.4.
3 years ago
Soner Tari 1bb5bd2398 Improve UserAuth documentation 3 years ago
Soner Tari 2b9cb937fd Improve documentation 3 years ago
Soner Tari 596aebb2f3 Update version to 0.8.3 and copyright year to 2021 3 years ago
Soner Tari 66dddf2cdb Add info on IPv4-only features 3 years ago
Soner Tari 9c76563cee Fix mistake: return address -> divert address 3 years ago
Soner Tari 177f6a3b52 Improve overview 3 years ago
Soner Tari def65e195c Update man page with README
Improve README
3 years ago
Soner Tari f1e9de7386 Improve documentation 3 years ago
Soner Tari f254ac1586 Add info on DivertUsers and PassUsers options 3 years ago
Soner Tari 6c0b981831 Update version to 0.8.1
Update TLS 1.3 documentation.
4 years ago
Soner Tari 05654e3bee Avoid possible crashes caused by passing NULL pointers to str*() functions 4 years ago
Soner Tari ea57aebf15 Fix mailto 4 years ago
Soner Tari 2b702495b0 Remove comixwall.org 4 years ago