Commit graph

13 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
6622df9d38
allow to configure nfqueue bypass flag
Nfqueue bypass option skips the enqueue of packets to userspace
if no application is listening to the queue.
https://wiki.nftables.org/wiki-nftables/index.php/Queueing_to_userspace

If this flag is not specified, and for example the daemon dies
unexpectedly, all the outbound traffic will be blocked.

Up until now we've been using this flag by default not to block network
traffic if the daemon dies or is killed for some reason. But some users
want to use precisely this behaviour (#884, #1183, #1201).

Now you can configure it, to block connections if the daemon
unexpectedly dies.

The option is on by default in the configuration (QueueBypass: true).
If this item is not present in the daemon config file, then it'll be
false.
2024-10-19 10:51:40 +02:00
Gustavo Iñiguez Goia
1e6d2d464b
updated default-config.json with latest added opts
More info about these options:
https://github.com/evilsocket/opensnitch/wiki/Configurations
2024-05-16 00:51:30 +02:00
Gustavo Iñiguez Goia
7a9bb17829
allow to filter connections by process checksum
Now you can create rules to filter processes by checksum. Only md5 is
available at the moment.

There's a global configuration option that you can use to enable or
disable this feature, from the config file or from the Preferences
dialog.

As part of this feature there have been more changes:

   - New proc monitor method (PROCESS CONNECTOR) that listens for
     exec/exit events from the kernel.
     This feature depends on CONFIG_PROC_EVENTS kernel option.

   - Only one cache of active processes for ebpf and proc monitor
     methods.

More info and details: #413.
2023-09-22 00:36:26 +02:00
selfdenial
52c23ffd5d Introduce 2 new daemon logging options: LogUTC & LogMicro. 2023-06-05 20:46:42 -06:00
Gustavo Iñiguez Goia
7b610c0176 added way to send events to syslog
Now you can send events to syslog, local or remote.
This feature was requested here #638

This feature allows you to integrate opensnitch with your SIEM. Take a
look at the above discussion to see examples with
syslog-ng+promtail+loki+grafana.

There's only one logger implemented (syslog), but it should be easily
expandable to add more type of loggers (elastic, etc).

The event format can be CSV or RFC5424. It sould also be easy to add
more formats.

- Allow to configure stats workers. They were hardcoded to 4.
2022-05-17 16:28:59 +02:00
Gustavo Iñiguez Goia
d9e0c59158
Allow to configure firewall rules from the GUI (#660)
* Allow to configure firewall rules from the GUI (WIP)

New features:
- Configure and list system firewall rules from the GUI (nftables).
- Configure chains' policies.
- Add simple rules to allow incoming ports.
- Add simple rules to exclude apps (ports) from being intercepted.

This feature is only available for nftables. iptables is still supported,
you can add rules to the configuration file and they'll be loaded, but
you can't configure them from the GUI.

More information: #592
2022-05-03 22:05:12 +02:00
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