Commit graph

1171 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
31c420ad60
ebpf dns module: fixed compilation warning 2022-10-05 14:33:05 +02:00
Gustavo Iñiguez Goia
fe3de13875
build and test daemon only if changed 2022-10-05 14:13:03 +02:00
Gustavo Iñiguez Goia
8f70af47e2
resolve absolute path of a process if it's relative
We may receive relative paths from kernel (eBPF), so we need to resolve
the absolute path of the process in order to create valid rules.
2022-10-01 22:27:07 +02:00
Gustavo Iñiguez Goia
814ed52331
ui, fw: added helper to allow inbound connections
Added a helper to easily allow inbound connections, just by selecting
the port where a service is listening on.

Especially useful when the inbound policy is drop and you want to allow a
service (ssh, nfs, etc).
2022-10-01 15:07:40 +02:00
Gustavo Iñiguez Goia
acac68126b
ui, events: show the cmdline
Add the column cmdline to the events log, and allow to configure it.

Closes #745
2022-09-29 15:31:14 +02:00
Gustavo Iñiguez Goia
564c263d71
packaging: moving files out of the gui/daemon dirs 2022-09-26 23:03:49 +02:00
Gustavo Iñiguez Goia
3c82f58b85
ui: added network interface option to the editor
Closes #744
2022-09-24 20:40:58 +02:00
Gustavo Iñiguez Goia
b7c5785a00
fixed conman/ tests 2022-09-24 17:24:12 +02:00
Gustavo Iñiguez Goia
4a0f7a3e2b
rules: allow to filter by network interface name
Now you can create rules to filter network interface name.
Regular expresions allowed: "eth[0-9]"

Closes #726
2022-09-24 17:12:09 +02:00
Gustavo Iñiguez Goia
92e5240b08
pop-ups: filter by process path if cmdline is relative
It's a good practice to filter by command line + process path (and
others parameters), to limit what an application can do.

Thus, if the user selects "from this command line", and the command
launched is not an absolute path to the binary, we'll create a rule
to filter by process path + process cmdline.
2022-09-22 13:08:51 +02:00
Gustavo Iñiguez Goia
96cccb8b8c
ui, fw: more options to filter connections by pack
Added more options to filter connections by packets' metainformation.
Added: uid, gid, l4proto, protocol and priority.

+ When filtering connections by in/out interface, list the available
  interfaces in the system, only if the selected node is local.
2022-09-21 16:01:32 +02:00
Gustavo Iñiguez Goia
fc96b24000
sys fw: added more meta options (uid,gid,l4proto..
Added more options to match connections against packets metainformation:
 skuid, skgid, l4proto, protocol

Fixed setting mark on packets via meta (although it results in an error
-> [invalid type]).
2022-09-16 14:01:41 +02:00
Gustavo Iñiguez Goia
ec83f83752
Merge pull request #740 from 0xphk/master
sys firewall: fixed wrong wireguard protocol
2022-09-15 16:52:52 +02:00
phk
cb19716ebc sys firewall: fixed wrong wireguard protocol
Changed 'tcp' to 'udp' to make wireguard rule work
2022-09-15 15:36:49 +02:00
Gustavo Iñiguez Goia
7fcf864499
ui, fw: allow to configure rate limits
For example to ratelimit downloads to 1MB/s (using the GUI):

Source Port: 443
Limit: 1/mbytes/second
Direction: IN
Action: DROP
2022-09-15 00:30:29 +02:00
Gustavo Iñiguez Goia
b8d6ead363
sys firewall: fixed matching ip protocols
Fixed using: ip protocol ah (or tcp, udp, gre, l2tp, etc)
2022-09-14 22:03:14 +02:00
Gustavo Iñiguez Goia
25bd8251be
fixed deadlock stopping ebpf monitor method
+ init events streamer as soon as possible.

Closes #739
2022-09-14 14:37:16 +02:00
Gustavo Iñiguez Goia
09ec8692f7
firewall: fixed adding rules with IPs
Instead of "ip daddr 1.1.1.1", "nh,128,32 16843009" was added.

Reproduced on ubuntu 20/22, manjaro, with different kernels (5.1x)
2022-09-13 21:58:52 +02:00
Gustavo Iñiguez Goia
93260177b3
ui, fw: fixed missing var 2022-09-12 22:36:07 +02:00
Gustavo Iñiguez Goia
97b141e947
ui, fw: allow to set quotas, more log options
- Allow to set quotas on connections.
  (For example: drop packets if transmitted bytes to port 443 and
  ip 1.2.3.4 is over 1GB.)
- Allow to configure log levels.
- Better errors when adding/editing rules.
2022-09-12 21:37:42 +02:00
Gustavo Iñiguez Goia
5c7b1c1558
fw: allow to set rules log level
Allow to set log level in (system) firewall rules.

  "Statement": {
   "Op": "",
   "Name": "log",
   "Values": [
     {
       "Key": "prefix",
       "Value": "invalid-in-packet"
     },
     {
       "Key": "level",
       "Value": "emerg"
     }
   ]
  }

https://github.com/evilsocket/opensnitch/wiki/System-rules#examples-of-supported-statements
2022-09-12 01:14:39 +02:00
Gustavo Iñiguez Goia
f3d1bae603
ui: fixed displaying delete button
Closes #724
2022-09-10 22:59:43 +02:00
Gustavo Iñiguez Goia
2a56b3cb46 ui,fw: set rules protocol when loading a rule
- When loading a rule, set the protocol of the rule.
- Do not verify if a port is integer, if it contains , or -.
2022-09-10 21:10:34 +02:00
Gustavo Iñiguez Goia
c28643d3fa ui, fw: allow to add/edit complex rules
Now you can configure complex firewall rules, for example:

tcp dst port 22 ip daddr 1.2.3.4 log prefix "ssh" accept

Closes #731
2022-09-10 16:49:29 +02:00
Gustavo Iñiguez Goia
f0a9d02e94 fw: fixed adding daddr/saddr to inet tables
If the table family where we're adding a daddr/saddr is inet, we need to
specify the protocol of the IP being added.

Otherwise, listing the rules they appear as:
@nh,128,32 3232235777 accept
instead of: daddr 192.168.1.111 accept

seen here: #704
2022-07-30 00:25:28 +02:00
Gustavo Iñiguez Goia
96a031ad12 ui,rules: improved regular expressions
Up until now we detected automatically if a rule was a regular
expression. But if the path or cmdline of a process had certain
characters (backslash), it was not easy to autodetect it, because the
backslash in particular is sent and received encoded (\\).

With this change the user will have to mark manually if the
path/cmdline of a process is a regular expression or no.

Closes #706
2022-07-21 17:53:05 +02:00
Gustavo Iñiguez Goia
77f52574fc Bump versions to v1.6.0rc2 2022-07-14 12:29:02 +02:00
Gustavo Iñiguez Goia
fc3d7382de ebpf: get cmdline arguments from kernel
- Get cmdline arguments from kernel along with the absolute path to the
  binary.
  If the cmdline has more than 20 arguments, or one of the arguments is
  longer than 256 bytes, get it from ProcFS.
- Improved stopping ebpf monitor method.
2022-07-12 15:40:01 +02:00
Gustavo Iñiguez Goia
7557faf3a6 prevent crash resolving /proc/self/exe 2022-07-09 22:17:17 +02:00
Gustavo Iñiguez Goia
45212db908 clean path of a process if it's needed
Sometimes the path of a path has " (deleted)" added or the path is
reported as "/proc/self/exe" which is a link and needs to be resolved.

 -> #694
2022-07-08 21:59:11 +02:00
Gustavo Iñiguez Goia
72483bdcde improved process detection
latest changes to detect short-lived processes caused undesired
behaviour (#694)

Closes #685
2022-07-08 17:15:57 +02:00
Gustavo Iñiguez Goia
c9650cbc49 update_adlists.sh updated
set output directory to /etc/opensnitchd/blocklists/domains/
2022-07-07 21:48:20 +02:00
Gustavo Iñiguez Goia
c3a356bdb8 update_adlists.sh updated
- TOP_EU_US_Ads_Trackers_HOST list is no longer available, and the new
  list is not in hosts format.
- curben malware list moved to malware-filter.gitlab.io
- some improvements

Closes #695
2022-07-07 13:18:15 +02:00
Gustavo Iñiguez Goia
868974f593 don't send events to gui is nolog is true
part of 6666eb8ccf
2022-07-06 16:26:28 +02:00
Gustavo Iñiguez Goia
f289d94677 ui, pop-ups: reverted change to adjust window size
Closes #693
2022-07-06 12:37:30 +02:00
Gustavo Iñiguez Goia
560f5c3fd9 ui, pop-ups: improved actions logic 2022-07-05 15:58:56 +02:00
Gustavo Iñiguez Goia
521f97bf94 ui,pop-ups: added reject option
Added option to reject new connections from the pop-ups:

- Configurable from the preferences, Default Action option.
- By default there're 2 buttons as always: Deny - Allow
  - If the Default Action is Reject: Reject - Allow
- The Deny button now has an activable menu, from where you can select
  non-default options (ex: reject connections while the Default Action
  is Allow/Deny).

Closes #613 #571
2022-07-04 23:45:50 +02:00
Gustavo Iñiguez Goia
6666eb8ccf ui,rules: added option to exclude connection events
New option to exclude connections from being logged.

Closes #691
2022-07-04 11:14:26 +02:00
Gustavo Iñiguez Goia
7347afd1f0
Merge pull request #689 from nberlee/icmpv6-nft
fw: support for icmpv6 nftables in system rules
2022-07-02 19:31:25 +02:00
Nico Berlee
5721ca9479
fw: support for icmpv6 nftables in system rules
- Add support for all available nftables ICMPv6 types (ip6tables -m icmpv6 --help)
- Build nftables ICMPv6 rules
- Create a default outbound ICMPv6 echo-request/reply rule
  (currently outbound echo-request ICMPv6 is by default denied)

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
2022-07-02 18:14:40 +02:00
Gustavo Iñiguez Goia
96fbc8536a
Merge pull request #684 from nberlee/fix-compile-issue
ebpf: fix compiler issue
2022-07-01 18:10:57 +02:00
Nico Berlee
ab42752b6b
ebpf: fix compiler issue
Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
2022-07-01 17:47:16 +02:00
Gustavo Iñiguez Goia
f558ce75c0 ui: show message boxes on top of the other dialogs
Closes #682
2022-06-27 16:35:30 +02:00
Gustavo Iñiguez Goia
e7024e3fe0 ebpf: support for long paths
Added support to report absolute path to a binary up to 4096 characters,
defined here:

https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/limits.h#L13
2022-06-27 14:42:54 +02:00
Gustavo Iñiguez Goia
f54eb789ff ui: improved shutting down
We needed to close the Notifications channel of each node on close.
Closing only grpc's server was not enough.

Closes #677
2022-06-24 13:23:38 +02:00
Gustavo Iñiguez Goia
4ce8b0e57c ebpf: improved process detection/new events module
Improved process detections by monitoring new processes execution.
It allow us to know the path of a process before a socket is opened.

Closes #617

Other improvements:
 - If we fail to retrieve the path of a process, then we'll use the comm
   name of the connection/process.
 - Better kernel connections detection.
 - If debugfs is not loaded, we'll try to mount it, to allow to use
   eBPF monitor method.

Future work (help wanted):
 - Extract command line arguments from the kernel (sys_execve, or mm
   struct).
 - Monitor other functions (execveat, clone*, fork, etc).
 - Send these events to the server (GUI), and display all the commands
   an application has executed.
2022-06-24 01:09:45 +02:00
Gustavo Iñiguez Goia
1b28fad03f ui,fw: improvemed firewall disabling
- When disabling the firewall, if the input policy is DROP, it must set
to ACCEPT, to allow outbound connections.
- Better widgets disabling/enabling.
2022-06-23 17:28:36 +02:00
Gustavo Iñiguez Goia
e1ed51e7c5 ui,notifications: fixed initialization 2022-06-23 00:53:36 +02:00
Gustavo Iñiguez Goia
98ddd01524 ui, events: improved displaying the events window
When loading and setting the query limit configured, it was causing to
fire an unwanted combobox event, resulting in a DB query without limits,
which in turns with a lot of events was causing slowdowns when displaying
the events window.
2022-06-21 21:18:25 +02:00
Gustavo Iñiguez Goia
cfb1d648a8 ui: fixed loading /etc/services
Thanks @munix9! for spotting this problem, and providing a solution:
 #671
2022-06-21 20:46:15 +02:00