Commit graph

716 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
ade3dc0047
ui,pop-ups: added missing import 2023-07-31 00:16:45 +02:00
Gustavo Iñiguez Goia
00a1dc4249
added Created column to the rules list
Closes #683
2023-07-30 18:16:56 +02:00
Gustavo Iñiguez Goia
cb57c1120d
ui,stats: added dst_ip column to rules details
Display dst_ip column when filtering connections by rule (tabs
Rule->double click on a rule).
2023-07-27 21:26:50 +02:00
Gustavo Iñiguez Goia
e638b0067e
misc: removed debug print, added info for missing icons
- Added description to the Icons() util, to describe why it's useful
(#998).
2023-07-27 21:20:39 +02:00
Gustavo Iñiguez Goia
7c7733483c
ui: fixed falling back to Qt's built-in icons
When the WM/DE is not properly configured, Qt does not load the system's
icon theme. In this scenario we try to use Qt's built-in icons.

Due to a bug, this was not working.

On the other hand, in order to display the icons of the system, one can
follow these instructions:
https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#no-icons-on-the-gui

Closes #998
2023-07-27 00:58:03 +02:00
Gustavo Iñiguez Goia
071f95572d
Merge pull request #997 from PeterDaveHello/zh_TW
Add basic Traditional Chinese locale
2023-07-26 14:14:50 +00:00
Gustavo Iñiguez Goia
43232b78a2
i18n: russian translation updated
Kudos to Темак
2023-07-26 15:46:28 +02:00
Gustavo Iñiguez Goia
6d65eb6f53
ui: control autostart feature exceptions
Display a warning if it fails.
2023-07-26 14:55:11 +02:00
Gustavo Iñiguez Goia
138b8d0c33
ui,prefs: fixed warning 2023-07-26 14:27:23 +02:00
Gustavo Iñiguez Goia
122a471fcf
ui,prefs: don't crash if autologin setting fails 2023-07-26 11:14:11 +02:00
Peter Dave Hello
dd419f095c i18n: add basic Traditional Chinese translation 2023-07-26 02:10:17 +08:00
Gustavo Iñiguez Goia
d1598fdf67
sys fw: allow to use wildcards to match interfaces
Now it's possible to use "br*" to match all network interfaces that
start with "br".

Closes #996
2023-07-24 16:11:12 +02:00
Gustavo Iñiguez Goia
cdf6497ea7
Bump versions to v1.6.1 2023-07-23 22:18:58 +02:00
Gustavo Iñiguez Goia
481574f035
pop-ups: generate better rule names
Continuation of previous commit.
2023-07-22 21:27:46 +02:00
Gustavo Iñiguez Goia
ff22d94113
pop-ups: better unique rule names
When answering a pop-up we generate the rule name based on the
properties of the connection.
When sending the rule to the daemon, the daemon verifies that the name
is unique and save it. If it's not, it generates a unique name.

However, if you responded to a pop-up and later modified any property of
the rule without changing the name, if the same connection tried to be
established again, you were prompted to allow/deny it, generating the
same name for the rule.
This could cause some confusion, because when sending the new rule to
the daemon the rule name was regenerated to be unique, but on the GUI
it was not updated, and even more, the old-personalized rule was
replaced with the new one.
2023-07-21 11:53:34 +02:00
Gustavo Iñiguez Goia
3d8bdfc1e8
ui,rules: improved uid parsing
When creating rules filtering by UID, there're 3 possible "modes":
 - simple: 0, 1000, etc.
 - user: root (0), opensnitch (1000)
 - regexp: ^(0|1000)$

regexp was not being used correctly.
2023-07-20 16:02:12 +02:00
Gustavo Iñiguez Goia
c97c322bcb
allow to secure (abstract) unix socket comms
- Allow to use SSL certificates to secure unix sockets communications.
- Allow to use abstract users sockets for server and nodes.

Go gRPC doesn't seem to understand unix sockets addresses that start
with "unix-abstract:", and python gRPC doesn't seem to understand
"unix:@" addresses.
Therefore, on the server (python gRPC) we use the format "unix:@" to
specify the address where the server will listen on, and rewrite it to
"unix-abstract:" before starting the server.

Note about certs and abstract unix sockets:
 When creating the SSL certificates, you'll have to specify the
 address of the unix socket as the Common Name of the certificates:

  Address: "unix:@my-abstract-socket"

  Common Name: @my-abstract-socket
2023-07-19 01:31:13 +02:00
Gustavo Iñiguez Goia
aa7b1e1a02
misc: removed debug msg, fixed warning msg
- Fixed displaying verdict warning message.
 - Removed debug message.
2023-07-17 16:48:44 +02:00
Gustavo Iñiguez Goia
b40da93fb4
ui, prefs: fixed displaying restart dialog
Display restart dialog was always being displayed when applying changes,
regardless if something really changed.
2023-07-17 16:10:59 +02:00
Gustavo Iñiguez Goia
77c49d533c
ui,fw: export rules to clipboard, rule dialog improvements
- Added option to export fw rule to clipboard in json format.
- Improvements to receive notifications on the fw rules dialog.
2023-07-15 17:13:58 +02:00
Gustavo Iñiguez Goia
1b3003e007
ui,fw: allow to filter rules by UUID
- also removed debug trace.
2023-07-15 13:51:54 +02:00
Gustavo Iñiguez Goia
4827d973e0
ui: notifications improvements
- Allow to receive and display errors when deleting app rules.
- Fixed error displaying notifications on the main window.
- Improvements to receive notifications on the fw dialog.
2023-07-13 16:59:29 +02:00
Gustavo Iñiguez Goia
7df5c5a244
ui,fw: enable Save button when changing parms
When editing a sys-fw rule, enable Save button if verdict parameters
change.
2023-07-11 00:44:04 +02:00
Gustavo Iñiguez Goia
c9567bfc14
Merge pull request #974 from tioguda/master
i18n: update Brazilian Portuguese translation
2023-07-07 15:42:36 +02:00
Gustavo Iñiguez Goia
b366f5f8b3
ui, ruleseditor: fixed translating username<->uid
When selecting a user from the dropdown list, it should set the uid of
the user in the text line. But sometimes, the format "user (uid)" was
set (instead of just "uid").
2023-07-05 13:36:51 +02:00
Gustavo Iñiguez Goia
9259442451
ui: minor improvements
- delete ipc socket on exit
- save ipc socket under /run/user/.../opensnitch/
- added new contributor
2023-06-25 15:28:43 +02:00
Gustavo Iñiguez Goia
81d7333c2b
ui,prefs: changed default tab 2023-06-25 14:27:30 +02:00
Gustavo Iñiguez Goia
f63d9dce72
ui,prefs: allow to configure CA cert for TLS comms
TLS simple: server cert + key
TLS mutual: CA cert + server cert + server key
2023-06-25 13:56:05 +02:00
Gustavo Iñiguez Goia
b1e85da2f7
ui: restrict ipc socket permissions
- Restrict ipc socket permissions to the current user.
- Store ipc socket in the runtime private dir of the user.
2023-06-25 13:48:56 +02:00
Gustavo Iñiguez Goia
6d45d9db12
Merge pull request #975 from WojtekWidomski/master
Allow starting the GUI in background when tray not available
2023-06-25 00:43:48 +02:00
Gustavo Iñiguez Goia
dbc5a9cef3
ui,prefs: allow to configure certs and auth type
- Added options to configure authentication type and certs from the
  preferences dialog.
- Reorganize code a little bit to displaya message when restarting the
  GUI is needed.
2023-06-24 18:28:04 +02:00
Wojtek Widomski
440e00dae1 add --background command line argument 2023-06-24 14:24:10 +02:00
Wojtek Widomski
4e87b1f8e4 use QLocalSocket and QLocalServer
use QLocalSocket and QLocalServer instead of lockfile
This allows to open window of running instance
when user is trying to start new instance.
2023-06-24 13:46:42 +02:00
Gustavo Iñiguez Goia
11bb32cbae
ui: allow to load credentials from settings file
- added munix9 to the list of contributors.
2023-06-24 00:52:42 +02:00
tioguda
885f0f7f27
i18n: update Brazilian Portuguese translation 2023-06-23 14:10:38 -03:00
Gustavo Iñiguez Goia
b3f772c34d
ui: added needed file for auth with certificates 2023-06-23 17:05:45 +02:00
Gustavo Iñiguez Goia
12b4cf3104
added option to secure channel communications
Allow to cypher channel communications with certificates.

There are 3 authentication types: simple, tls-simple and tls-mutual.

 - 'simple' wont't cypher communications.
 - 'tls-simple' uses a server key and certificate for the server, and a
   common CA certificate or the server certificate to authenticate all
   nodes.
 - 'tls-mutual' uses a server key and certificate for the server, and a
   client key and certificate per node.

There are 2 options to verify how gRPC validates credentials:
 - SkipVerify: https://pkg.go.dev/crypto/tls#Config
 - ClientAuthType: https://pkg.go.dev/crypto/tls#ClientAuthType

Example configuration:
    "Server": {
        "Address": "127.0.0.1:12345",
        "Authentication": {
            "Type": "tls-simple",
            "TLSOptions": {
                "CACert": "/etc/opensnitchd/auth/ca-cert.pem",
                "ServerCert": "/etc/opensnitchd/auth/server-cert.pem",
                "ClientCert": "/etc/opensnitchd/auth/client-cert.pem",
                "ClientKey": "/etc/opensnitchd/auth/client-key.pem",
                "SkipVerify": false,
                "ClientAuthType": "req-and-verify-cert"
            }
        }
    }

More info: https://github.com/evilsocket/opensnitch/wiki/Nodes
2023-06-23 16:51:36 +02:00
Gustavo Iñiguez Goia
0d6b9101b0
ui: configure GUI autostart from global preferences 2023-06-22 12:15:44 +02:00
Gustavo Iñiguez Goia
6f752d56fe
ui,prefs: allow to configure gRPC channel max size 2023-06-22 01:42:13 +02:00
Gustavo Iñiguez Goia
0a30906305
ui: minor refactoring
- Use Message util.
  Maybe it'd be better to display a desktop notification for a more
  better experience, or a dialog box if notify2 is not installed.
- Translate warning message.
2023-06-22 01:17:06 +02:00
Gustavo Iñiguez Goia
c387ddf468
ui: minor refactoring
- Removed unused imports.
- Moved max gRPC channel settings to config.py
2023-06-22 00:49:03 +02:00
munix9
59621017e9
xdg updates + autostart + lockfile (#964)
* require pyxdg

* extend xdg, introduce autostart

* use xdg_current_desktop from opensnitch.utils.xdg

* control autostart in tray

* dont use pkill anymore

* check if os-ui is already running

* don't require pyxdg (for now)

* simplify xdg_current_desktop

* do not use pyxdg (for now), use some code from there

* update autostart status when menu is open

* fix possible SameFileError
2023-06-21 23:28:13 +02:00
Gustavo Iñiguez Goia
6e61958c23
ui: let DEs control notifications timeouts
There have been some issues (#673) informing that the notifications
timeout were not working on KDE.

On 843412d I wrote that the timeout unit is millisecond, as stated on
the docs here:
https://notify2.readthedocs.io/en/latest/#notify2.Notification.set_timeout

But after some trial and error:
 - set_timeout() units are in seconds, at least for KDE 5.26.3, Xfce
   4.18 and GNOME 43.
 - not specifying the timeout with set_timeout() lets the Desktop
   Environment handle the timeout for us, from their respective
   preferences window.

So at least now there're some DEs where the notifications are closed as
expected.
2023-06-20 12:48:03 +02:00
Gustavo Iñiguez Goia
f7eec83367
sys fw: allow to add icmp types by commas
- Previously we only supported multiple ICMP types on the same rule
by adding multiple keys:
 Key: type
 Value: echo-request
 Key: type
 Value: echo-reply

Now it's possible to specify them using ',':
 Key: type
 Value: echo-request,echo-reply

- Validate ICMP types before adding them.
2023-06-20 01:14:57 +02:00
Gustavo Iñiguez Goia
01069d363b
ui,fw: added help button to open the fw rules wiki 2023-06-17 12:01:26 +02:00
Gustavo Iñiguez Goia
06f333c281
ui,prefs: increased default timeout widget size 2023-06-17 11:41:21 +02:00
Gustavo Iñiguez Goia
370a978b24
changed systray warning help url 2023-06-16 11:48:47 +02:00
Gustavo Iñiguez Goia
5f5cf11c67
updated systray warning help url 2023-06-16 01:59:09 +02:00
Gustavo Iñiguez Goia
c42232d92e
ui,events: fixed behaviour jumping to the rules view
* There was a situation where the details of an app rule was not being
displayed correctly:
 - on the tab rules select any system fw rule.
 - go to the Events tab
 - double click on the Rule column to view the details.
 - instead of the app rules details, the list of system fw rules was
   displayed.

* On the other hand, when going back from the details view, the list of
  rules was not being refreshed correctly.

  In this situation now we select the Application rules view.
2023-06-15 19:18:58 +02:00
Gustavo Iñiguez Goia
a897dd9dc3
ui: updated url with fw config upgrade instructions
Some users coming from v1.5.x version may end up with an incompatible fw
configuration, so point them to a url with instructions to solve it.
2023-06-15 17:05:54 +02:00