Commit graph

520 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
bfe7b579f7
Merge pull request #769 from szimszon/master
Here port should be also port in hungarian language.
2022-11-14 20:31:22 +01:00
Gustavo Iñiguez Goia
da3a9dc19f ui: handle alert msgs on the main thread 2022-11-14 10:23:57 +01:00
Szimszon
d750caed4a
Here port should be also port in hungarian language.
Port translation was "kikötő" which means harbor and we need here "port" or "portszám" for port.
2022-11-13 20:19:43 +01:00
Gustavo Iñiguez Goia
80cbf7450a
ui: fixed exception when checking node address
Thanks @JeremyMahieu ! for reporting it and providing a solution.

Closes #766
2022-11-10 00:00:54 +01:00
Gustavo Iñiguez Goia
a9f3b20881
ui: set some strings as not translatable
ref: #759
2022-10-20 23:16:12 +02:00
Gustavo Iñiguez Goia
820e7d5fe9
ui: create /run/user/ dirs with proper permissions
"$XDG_RUNTIME_DIR defines the base directory relative to which user-specific
non-essential runtime files and other file objects (such as sockets,
named pipes, ...) should be stored. The directory MUST be owned by the
user, and he MUST be the only one having read and write access to it.
Its Unix access mode MUST be 0700."

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
2022-10-18 00:15:25 +02:00
Gustavo Iñiguez Goia
b2ccb34c17
ui,rules: allow to filter by fields of the rules
Requested here: #756
2022-10-15 12:01:48 +02:00
Gustavo Iñiguez Goia
040d4bf921
ui, rules editor: allow to select multicast range
Closes #755
2022-10-14 01:20:54 +02:00
Gustavo Iñiguez Goia
728c2554ad
ui minor fixes
- Firewall dialog: disable widget when firewall is not active.
- Firewall rule dialog: enforce quotas units format.
- Nodes: fixed exception.
2022-10-14 00:59:00 +02:00
tioguda
a812b26719
Update Brazilian Portuguese translation 2022-10-12 09:45:48 -03:00
Gustavo Iñiguez Goia
477e6aadb0
new feature: send alerts to the server/UI
Up until now some error and warning messages were only logged out to the
system, not allowing the user know what was happening under the hood.

Now the following events are notified:
 - eBPF related errors.
 - netfilter queue errors.
 - configuration errors.

WIP, we'll keep improving it and build new features on top of this one.
2022-10-12 13:31:45 +02:00
Gustavo Iñiguez Goia
915b325a00
ui: allow to configure (local) server address
Up until now, the daemon communicated with the GUI via a unix socket,
stored in /tmp.

/tmp however can be erased at any time (tmpreaper, systemd-tmpfiles.d),
which may lead to remove our unix socket file, and hence losing
connectiong with the daemon.

Now the user has the option to store the socket file under
/run/user/$uid/opensnitch/
https://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData

In the future we may switch to this path by default.
2022-10-06 13:57:52 +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
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
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
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
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
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
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
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
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
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
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
Gustavo Iñiguez Goia
cbc9d2a1a9 ui, pkgs: added netbase/setup/netcfg as dependency
Added netbase (debian based distros) or setup (fedora) or netcfg
(opensuse) as dependency, to allow to read the file /etc/services.

 #671
2022-06-21 12:56:16 +02:00
Gustavo Iñiguez Goia
59ea9e146a ui: fixed exception loading /etc/services
Closes #671
2022-06-21 10:03:20 +02:00
Gustavo Iñiguez Goia
e974364629 ui, firewall: support older protobuf versions
We were using insert() and append() to add rules to the list of rules.
However these methods are only available on protobuf => 3.8.0

In order to have a better user experience, we'll use extend() instead of
append(). If insert() is available, then we'll use it. This way the
users won't have to install manually a newer protobuf version.

Note: using extend() instead of insert() means that the rule won't be
added on top of all the rules of that chain. If a user with an older
protobuf version (<= 3.8.0) adds a rule, it'll be added to the bottom of
the list, and maybe there're other rules that take precedence.
2022-06-02 00:23:15 +02:00
Gustavo Iñiguez Goia
b49de30d54 ui, icons: better DE integration
In order to display icons on the GUI, we use the Icon Naming
Specification defined by freedesktop [0].

However these icons are not always available due to several reasons.
In this situation until now, we have relied on the Qt's built-in
icons [1].

It has worked fine until Fedora 36/Gnome 4x, where even some built-in Qt
icons are missing (SP_VistaShield in particular).

Since Gnome uses symbolic icons [2], falling back to these icons when
the original one doesn't load, helps to display the missing icon.
These icons have the same name than the ones defined by freedesktop, but
with "-symbolic" as a suffix.

Tested on u16, u18, pop22.04, tumbleweed 15.3, f36, devuan/debian 11
(lxqt, unity, gnome3/4, kde).

If you think that there's a better way of handling this situation,
please, open an issue or submit a PR with a fix.

[0] https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
[1] https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QStyle.html#PySide2.QtWidgets.PySide2.QtWidgets.QStyle.StandardPixmap
[2] https://wiki.ubuntu.com/SymbolicIcons
2022-05-29 17:28:13 +02:00
Gustavo Iñiguez Goia
4e4bd9dcf7 ui, stats: fixed exception when loading tree panel 2022-05-16 11:50:41 +02:00
Gustavo Iñiguez Goia
3c524c1942 ui, rules: added description field
- Added ability to add a description to the rules.
- Display the description field on the Rules view, and remove the internal
  fields (operator, operator_data, etc).
- Added DB migrations.
- Improved rules' executable path field tooltip (#661).

Closes #652 #466
2022-05-12 13:38:23 +02:00
Gustavo Iñiguez Goia
db4646dec8 rpm pkgs: deploy dns ebpf module, add grpcio as dep
- Deploy DNS eBPF module when installing the daemon.
- Include python3-grpcio as dependency. For older systems we'll use the
  old .spec file.
2022-05-05 01:16:38 +02:00
Gustavo Iñiguez Goia
b626e3fea2 bump nftables dependency version, packaging changes
- Bump nftable version to depend on latest version with fixes.
- Include opensnitch-dns.o eBPF object when creating the deb package.
- Replaced Suggests by Recommends, to install addtional but not
  essential packages (like python3-pyasnc, and others).
- Added python3-grpcio, python3-protobuf and python3-slugify as
  dependencies.
  For systems without these packages, we'll use the old debian/ dir.
2022-05-04 18:36:50 +02:00
Gustavo Iñiguez Goia
cb74058b96 Bump versions to 1.6.0rc1 2022-05-04 14:47:45 +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
16c95d77fd ui: use default font for GUI labels.
There were some labels that didn't use the default font (Sans). This
caused that the labels text were not following system's theme.

Closes: #650
2022-04-19 01:41:35 +02:00
Gustavo Iñiguez Goia
0aef656c42 ui: allow to use GUI themes
Now the user can personalize GUI's appearance (#424).

There're 15 default themes, dark and light, that will help integrating
on some environments (#303, #335).

More themes can be added, by creating a new xml under
~/.config/opensnitch/themes/ or
/usr/lib/python3/dist-packages/opensnitch/

The lib used is https://github.com/UN-GCPDS/qt-material.
https://github.com/UN-GCPDS/qt-material#custom-colors
2022-03-22 13:16:18 +01:00