Commit graph

7 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
49c171df4c Use eBPF as procs monitor method by default
If eBPF is not available we'll fallback to proc parsing.
2021-08-17 13:54:46 +02:00
Gustavo Iñiguez Goia
a354ae22e1 statistics: fixed missed connections
Previous behaviour:

 1) Before version 1.0.0b the daemon kept a list of processes that had
 established connections. The list was displayed on the GUI as is, so
 the maximum number of connections displayed were 100 (hardcoded).

 2) When the intercepted connections reached 100, the last entry of the
    list was removed, and a new one was inserted on the top.

After v1.0.0 we started saving connections to a DB on the GUI side, to
get rid of the hardcoded connections limit. However, the point 2) was
still present that caused some problems:
 - When the backlog was full we kept inserting and deleting connections
   from it continuously, one by one.
 - If there was a connections burst we could end up missing some
   connections.

New behaviour:
 - The statisics are deleted from the daemon everytime we send them to
   the GUI, because we don't need them on the daemon anymore.
 - If the GUI is not connected, the connections will be added to the
   backlog as in the point 2).
 - When the backlog reaches the limit, it'll keep deleting the last
   one in order to insert a new one.
 - The number of connections to keep on the backlog is configurable.
 - If the statistics configuration is missing, default values will be
   150 (maxEvents) and 25 (maxStats).

Notes:
 If the GUI is saving the data to memory (default), there won't be
 any noticeable side effect.
 If the GUI is configured to save the connections to a DB on disk, and
 the daemon sends all the backlog at once, the GUI may experience a
 delay and a high CPU spike. This can occur on connecting to the daemon
 (because the backlog will be full), or when an app sends too many
 connections per second (like nmap).
2021-08-13 12:18:10 +02:00
Gustavo Iñiguez Goia
ba7c4e1878 allow to configure what firewall to use
Before this change, we tried to determine what firewall to use based on
the version of iptables (if -V legacy -> nftables, otherwise iptables).

This caused problems (#455), and as there's no support yet for nftables
system firewall rules, it can't be configured to workaround these
errors.

Now the default firewall to use will be iptables.
If it's not available (installed), can't be used or the configuration
option is empty/missing, we'll use nftables.
2021-08-09 00:32:27 +02:00
Gustavo Iñiguez Goia
0d1e9f5b47 set server address and log file from the default config
The server address and log file were hardcoded into the
opensnitchd.service file, making it almost impossible to change.

Soon we'll be able to change it from the UI.
2020-10-26 23:16:27 +01:00
Gustavo Iñiguez Goia
6c9d9b28f6 added default log level to default conf 2020-05-30 23:03:59 +02:00
Gustavo Iñiguez Goia
e85a41ca0f allow to configure process monitor method in daemon config
Added ProcMonitorMethod, which can be "proc", "ftrace" or "audit".

Parameters passed by command line take prevalence over default
configuration.

breaking changes: config options changed from xx_yy to XxYy.

Config example:
{
    "DefaultAction": "allow",
    "DefaultDuration": "once",
    "InterceptUnknown": true,
    "ProcMonitorMethod": "audit"
}
2020-03-16 01:37:33 +01:00
Gustavo Iñiguez Goia
6ebd6cca99 added a default configuration file
Some people has asked where they can change the daemon configuration.

As we can't change it from the GUI yet, and we're providing deb
packages, we need to distribute a default config.

That way the users will see it and will be able to customize it.
2020-03-08 20:25:05 +01:00