Commit graph

1552 commits

Author SHA1 Message Date
selfdenial
f6623fad95 Add non-gui setting for gRPC server max_message_length. 2023-06-03 23:29:40 -06:00
Gustavo Iñiguez Goia
102b65e6c3
added new generic remote logger and new formats
- Added new generic remote logger to send events to remote servers.
- Added new formats RFC3164 and JSON.

Configuration example to send events to logstash using the tcp input
plugin, in json format:
 "Loggers": [
    {
        "Name": "remote",
        "Server": "127.0.0.1:3333",
        "Protocol": "tcp",
        "Workers": 5,
        "Format": "json",
        "Tag": "opensnitch"
    },
 ]

logstash configuration, saving events under document.*:
 input {
    tcp {
        port => 3333
        codec => json_lines {
            target => "[document]"
        }
    }
 }

You can also use the syslog input plugin:
 "Loggers": [
    {
        "Name": "remote",
        "Server": "127.0.0.1:5140",
        "Protocol": "tcp",
        "Workers": 5,
        "Format": "rfc3164",
        "Tag": "opensnitch"
    },
 ]

logstash's syslog input plugin configuration:
 input {
    syslog {
        port => 5140
    }
}

Note: you'll need a grok filter to parse and extract the fields.

See: #947
2023-05-29 13:49:38 +02:00
Gustavo Iñiguez Goia
89dc6abbcd
loggers: remote syslog, rfc5424 format improvements
- Allow to configure remote logger's write timeout and workers.
- Improved syslog RFC5424 formatting.
2023-05-28 23:19:56 +02:00
Gustavo Iñiguez Goia
463378c214
misc: changed the level of some messages
Also added [DNS] to some messages.

Related: #954
2023-05-28 16:23:39 +02:00
munix9
11baad083d
ebpf modules compilation fixes
- don't import hardcoded architecture.
- use generic cpu (-mcpu=generic)
- removed linux/version.h from modules.

related #954
2023-05-28 15:24:33 +02:00
Gustavo Iñiguez Goia
9c483b1a59
sys,fw: allow to create multiprotocol rules
Now you can add rules to allow multiple protocols.
For example you can add a rule to allow dport/sport for both TCP
and UDP.

There're two options to allow a port:

Statement {
 Name: tcp
 Values:
   Key: dport
   Value: 1234
}

Statement {
 Name: meta
 Values:
   Key: l4proto
   Value: tcp,udp

   Key: dport
   Value: 1234
}

Closes #951.
2023-05-27 22:02:14 +02:00
Gustavo Iñiguez Goia
3432c6a694
ui,fw: fixed allowing inbound services
The helper dialog to allow inbound connections to a port was adding a
rule to source port, instead of destination port.

The source port is needed to allow the traffic of a *local service"
when the inbound policy is set to Deny.
2023-05-25 17:39:17 +02:00
Gustavo Iñiguez Goia
810b785b3a
sys,fw: put dns rule always at the top of the chain
The DNS rule to intercept DNS responses must always be at the top of
the (input-filter) rules, otherwise we won't receive DNS resolutions.

Adding, removing or changing system fw rules was removing the rule from 1st
position.

Another approach to this problem could be to remove&&add only the dns rule,
instead of disable-enable interception+rules monitor.
2023-05-25 01:20:53 +02:00
Gustavo Iñiguez Goia
9f71c15e57
sys,fw: fixed race condition creating system rules
Hard to reproduce, but not impossible
2023-05-24 14:26:58 +02:00
Gustavo Iñiguez Goia
631f27ee24
loggers: fixed race condition on remote loggers
- Fixed race condition when a remote logger can't open a connection with
  the server.
2023-05-24 01:19:07 +02:00
Gustavo Iñiguez Goia
500f5fe256
i18n: removed .qm from the repo 2023-05-23 18:01:00 +02:00
Toni Lähdekorpi
6afa7a3d0e
i18n: add Finnish translations (#948)
* i18n: initial support for Finnish

* i18n: add Finnish translations for rules

* i18n: add Finnish translations for rules

* i18n: translated using Weblate (Finnish)

Currently translated at 99.6% (516 of 518 strings)

Translation: Open Source/opensnitch

* i18n: finalize Finnish translations

* i18n: run Finnish translations through lrelease

---------

Co-authored-by: Toni Lähdekorpi <toni.lahdekorpi@neuvo.ai>
2023-05-23 17:58:18 +02:00
Gustavo Iñiguez Goia
9079323bed
sys,fw: better fw rules monitor
- Fixed race conditio monitoring interception rules.
2023-05-22 18:10:12 +02:00
Gustavo Iñiguez Goia
0402bb1555
i18n: updated translations definitions 2023-05-19 18:31:26 +02:00
Gustavo Iñiguez Goia
3d99eae3ae
i18n: updated translations 2023-05-19 18:26:07 +02:00
Gustavo Iñiguez Goia
d18a2946e5
Merge pull request #945 from ovari/master
Update README.md
2023-05-19 13:06:26 +02:00
ovari
de082f445d
Update README.md
https://hosted.weblate.org/widgets/opensnitch/?lang=&component=glossary#multi
2023-05-19 19:03:45 +10:00
Gustavo Iñiguez Goia
6c456aefba
sys fw: fixed race condition reloading rules 2023-05-19 01:35:20 +02:00
Gustavo Iñiguez Goia
7c631376db
ui, fw: avoid unnecessary rules reloads
- When changing a policy, disable it until we receive a response.
  Maybe we should even delay it a little bit more.
- When editing a fw rule, disable the Save button if the user didn't
  change any field.
2023-05-19 01:24:56 +02:00
Gustavo Iñiguez Goia
de198fd826
fw: fixed leak stopping rules checker 2023-05-18 23:28:42 +02:00
Gustavo Iñiguez Goia
13ef497538
Merge pull request #944 from davide125/shebang
ui: remove unnecessary shebang
2023-05-18 23:08:29 +02:00
Gustavo Iñiguez Goia
8440964ed2
Merge pull request #943 from davide125/bump
ui: bump unicode_slugify to 0.1.5
2023-05-18 23:08:11 +02:00
Davide Cavalca
c6153ec661 ui: remove unnecessary shebang 2023-05-18 12:04:14 -07:00
Davide Cavalca
b3ecb69a5a ui: bump unicode_slugify to 0.1.5 2023-05-18 11:27:21 -07:00
Gustavo Iñiguez Goia
f3a621e192
changed system requirements reading 2023-05-18 14:32:03 +02:00
Gustavo Iñiguez Goia
8513c0dd7f
Added system requirements check
Added flag to check system requirements.
Related: #774
2023-05-18 14:23:40 +02:00
Gustavo Iñiguez Goia
6b297a93b1
ci: removed compiling for 5.8 kernel 2023-05-17 17:28:55 +02:00
Gustavo Iñiguez Goia
96a962be2b
ci fixes 2023-05-17 13:00:13 +02:00
Gustavo Iñiguez Goia
0bb46197cc
ci fixes 2023-05-17 12:54:36 +02:00
Gustavo Iñiguez Goia
f97e7392a3
ci fixes 2023-05-17 12:26:49 +02:00
Gustavo Iñiguez Goia
ba64379348
ebpf: new way of compiling the modules
- Don't rename libbpf's bpf_map_def struct, and distribute the needed bpf
  headers.
  The bpf_map_def struct has been deprecated for quite some time now,
  and it was been removed on >= 6.2 anyway.
  We still need it, because we use gobpf.
- Improved compilation behaviour:
  - We don't require the kernel sources anymore. We can just use the
    kernel headers from the distribution.
  - There's no need to copy the sources to the kernel tree, the modules
    can be compiled from the ebpf_prog/ dir.
- Compiling against kernels 6.x seems to solve the problem we had with
  VPNs, where connections were not intercepted with modules compiled
  against 5.8, on kernels >= 5.19.

The modules has been tested on kernels 4.17, 5.4, 5.10, 5.15, 6.1 and
6.2 (kernel connections included).

Closes: #939
2023-05-17 01:20:53 +02:00
Gustavo Iñiguez Goia
9d353102df
ui: display warning if the systray is not available
Some DEs and WMs don't support systray icons. In this situation we
display the GUI after 10s.

However many users were confused about this behaviour, thinking that
this delay displaying the GUI was a bug (#937).

Hopefully with a warning to the terminal and the desktop will help
them to know what's going on.
2023-05-13 20:47:24 +02:00
Gustavo Iñiguez Goia
2b9b9ab166
ui, ruleseditor: fixed crash on old distros
placeHolder is not supported for Combos on old PyQt versions, and we're
not using it anyway.
2023-05-13 17:50:56 +02:00
Gustavo Iñiguez Goia
fb7e84941f
ui, fw: firewll rule improvements
- Added tooltips with help messages for each rule option.
- Improved options title (ex:"limit over 1/MB/s" instead of
  "limit over units == 1/MB/s").
2023-05-13 01:31:54 +02:00
Gustavo Iñiguez Goia
474ad7636d
close ebpf perf module on stopping the monitor 2023-05-10 00:02:53 +02:00
Gustavo Iñiguez Goia
de283f8430
ui,fw: disable interaction if there're no nodes 2023-05-09 22:29:01 +02:00
Gustavo Iñiguez Goia
f943c69c79
ui, config: added constant needed by ConnDetails 2023-05-08 21:31:13 +02:00
Gustavo Iñiguez Goia
1b8d1ae227
ui: added option to view details of a connection
Allow from the Events view, display the details of a connection.
The dialog allows to copy the details.

https://github.com/evilsocket/opensnitch/issues/929#issuecomment-1535530944
2023-05-08 16:51:08 +02:00
Gustavo Iñiguez Goia
8954145735
ui, sys fw: reformat how expressions are painted
instead of "== tcp dport 8888" display "tcp dport == 8888"
2023-05-04 15:23:10 +02:00
Gustavo Iñiguez Goia
1ff61a913c
ui: improved system fw rules management
- Allow to copy rules to clipboard with CTRL-c
- Added contextual menus:
  - edit to open the editor dialog.
  - Action, to change the rule verdict without opening the rule dialog.
2023-05-04 14:57:53 +02:00
Gustavo Iñiguez Goia
6121a5b987
ui, fw: allow to delete multiple rules
- Allow to delete multiple fw rules.
- Moved enable_rule() code to firewall/.
2023-05-03 17:51:37 +02:00
Gustavo Iñiguez Goia
dd7476fe52
ui: fw rules improvements
- Fixed error validating some meta expressions.
- Added option to enable/disable fw rules.
- Limit fw rules deletion to 1 rule for now, until a bug is fixed.
2023-05-03 01:29:13 +02:00
Gustavo Iñiguez Goia
d88a253d9c
ui: refresh rules list after delete a rule
Related: #921
2023-05-02 20:59:38 +02:00
Gustavo Iñiguez Goia
c6decf1bad
ui: refresh rules list when adding/editing a rule
Related: #921
2023-05-02 00:25:13 +02:00
Gustavo Iñiguez Goia
4570491523
allow to filter connections by source port
- Allow to filter connections by source port.
2023-05-01 14:48:34 +02:00
Gustavo Iñiguez Goia
57739cc974
rules: allow to filter connections by source ip/net
- Allow to filter connections by source IP/Network.
  (it also may be useful filter by source port)
- Removed AlwaysOnTop Hint from rules editor dialog.

Closes #922
2023-04-29 18:47:44 +02:00
Gustavo Iñiguez Goia
79754860de
ui, fw: validate int values when adding fw rules 2023-04-29 01:52:35 +02:00
Gustavo Iñiguez Goia
45576fe9f3
ui, fw: validate IPs when adding fw rules 2023-04-29 01:34:48 +02:00
Gustavo Iñiguez Goia
bd9d4eb4c6
ui, fw: added target parameters column
Display target parameters (reject >>with tcp reset<<) on the firewall
table.
2023-04-27 00:30:39 +02:00
Gustavo Iñiguez Goia
0f443bbea8
ui, stats: added contextual menu to fw table
Added option to delete rules by right cliking on a row.
2023-04-27 00:25:20 +02:00