Commit graph

863 commits

Author SHA1 Message Date
nolancarougepro
fa96aa317d remove test_range in .json 2024-12-11 11:42:53 +01:00
nolancarougepro
30c4e70f1b modify ruleseditor to edit aliases 2024-12-11 08:59:31 +01:00
nolancarougepro
ca5c5cdb43 modify prompt to add aliases 2024-12-11 08:56:16 +01:00
nolancarougepro
0addd29c51 add_network_aliases 2024-12-11 08:55:04 +01:00
Gustavo Iñiguez Goia
dd7271429e
ui,prefs: allow to configure more internal options
Allow to configure:
 - Bypass queue.
 - Firewall rules monitoring interval.

Related: 6622df9d38
2024-11-26 21:37:04 +01:00
Gustavo Iñiguez Goia
db84b551cc
ui,popups: fixed exception getting node address when adding a new rule
When a popup was displayed to the user, if they took more than 120s to
respond, the address of the node was lost.

This is because the daemon has hardcoded a max timeout of 120s. If it
fires, the call to AskRule is closed and the context is lost.

In this situation, save the address of the node at the start of AskRule,
so we can reuse it later.

Closes: #1219
2024-11-25 23:24:29 +01:00
Gustavo Iñiguez Goia
cdf93c72c1 ui: fixed delay closing the GUI
When closing the GUI we were not stopping notifications channel in all
cases, causing some issues (delays, log in/out problems, ...).

Closes #1217
2024-11-24 00:53:02 +01:00
Gustavo Iñiguez Goia
9a51e88ebc
updated/added new translations
- Updated de_DE, fr_FR, hu_HU, lt_LT, nb_NO, ru_RU, tr_TR and zh_TW
   translations.
 - Added Czech, Hindi, Indonesian, Italian and Swedish translations.
2024-11-06 23:06:04 +01:00
Gustavo Iñiguez Goia
06ffffbbe1
Merge pull request #1209 from atriwidada/minor_fix
Make example explanation consistent with regex - take #2
2024-10-23 00:51:55 +02:00
Gustavo Iñiguez Goia
7fd436a00f
ui/fw: allow to configure outbound default policy
Related: #1183, #884, #1201
2024-10-20 00:29:05 +02:00
Andika Triwidada
c53026c7b6 Quota example typo fix 2024-10-18 04:29:57 +00:00
Andika Triwidada
6d6afc4baf Make example explanation consistent with regex - take #2 2024-10-17 00:42:58 +00:00
Gustavo Iñiguez Goia
f63a48deff
calculate the ram usage of a process in the daemon
- Calculate the ram usage of a process in the daemon, using the page
   size of the system.
 - Added new functions to read some details of a process, so we can use
   them in other parts of the code.
2024-10-15 00:49:58 +02:00
Gustavo Iñiguez Goia
83fad69316
tasks: added sockets monitor task (netstat)
Added new task to monitor local sockets of nodes, similar to ss or
netstat.

More info: #1112
2024-10-07 23:40:40 +02:00
Gustavo Iñiguez Goia
61d81f7055
Merge pull request #1195 from atriwidada/master
Add Indonesian translation
2024-09-28 16:34:30 +00:00
Gustavo Iñiguez Goia
58613543e2 added new task nodemonitor
Added new task to monitor the resources of remote nodes, like
ram, swap, number of processes or load average of the system.

The task is initiated when the user selects a node, and the data
received from the node is added to the right panel of the Nodes tab.

The task is stopped when changing to another tab, or when deselecting a
node.

Particularly useful for monitoring remote nodes.
2024-09-28 10:09:19 +02:00
Gustavo Iñiguez Goia
aea751793f
ui, procdialog: added missing import 2024-09-25 21:53:18 +02:00
Gustavo Iñiguez Goia
ee225cd815
ui,procdialog: allow to filter sockets and files
Two new options has been added to filter the process open files list by
sockets and regular files (by default it display pipes, etc).
2024-09-25 21:45:38 +02:00
Gustavo Iñiguez Goia
9e0f3a4797
introducing daemon tasks
daemon tasks are actions that are executed in background by the daemon.

They're started from the GUI (server) via a Notification (protobuf),
with the type TASK_START (protobuf).

Once received in the daemon, the TaskManager starts the task in
background.

Tasks may run at interval times (every 5s, 2days, etc), until they
finish an operation, until a timeout, etc.

Each task has each own configuration options, which will customize the
behaviour of its operations.

In this version, if the GUI is closed, the daemon will stop all the
running tasks.
Each Task has a flag to ignore this behaviour, for example if they need
to run until they finish and only send a notification to the GUI,
instead of streaming data continuously to the GUI (server).

 - Up until now we only had one task that could be initiated from the GUI:
   the process monitor dialog. It has been migrated to a Task{}.
 - go.mod bumped to v1.20, to use unsafe string functions.
 - go.sum updated accordingly.
2024-09-25 01:00:38 +02:00
Andika Triwidada
23811e749e * Add Indonesian translation
* sort translation files in opensnitch_i18n.pro
2024-09-23 12:01:13 +00:00
Gustavo Iñiguez Goia
05eed4ef04
ui,plugins: added missing files
The plugins were not included when building the wheel.
2024-09-20 23:08:17 +02:00
Gustavo Iñiguez Goia
c832accf5d
ui,popups: new button to update the checksum of all rules
When filtering by checksum and the checksum of a rule changes, we
display a warning on the popup, indicating that something happened.

The user had the option to update the checksum of one rule, directly
from the popup.

Now there's a new button to update all the rules that have a checksum as
filtering parameter.
2024-09-20 22:48:32 +02:00
Gustavo Iñiguez Goia
61727af788
ui,rules: do not verify lists path on remote nodes
When creating/editing rules to filter by lists of nets/IPs/domains, we
check if the path entered is a directory.

However on remote nodes, the path may not exist where the GUI is
running, but be valid where the daemon is running.

Now we only check the path if the node where it's being configured is
local.

Closes #1174
2024-09-18 00:20:05 +02:00
Gustavo Iñiguez Goia
f669c780b4
ui: fixed syntax warning building appimages paths
SyntaxWarning: invalid escape sequence '\.'

(#1154)
2024-09-17 22:48:37 +02:00
Gustavo Iñiguez Goia
14747a04ad
ui,plugins: added configuration examples 2024-09-17 00:24:48 +02:00
Gustavo Iñiguez Goia
2a233c1d8b ui: introducing plugins, improved actions
Up until now we had a way of customizing the views, by defining
"actions". See for context cba52cf3d8

The configuration syntax has not changed, but now every "action" is a
python plugin, for example when loading this configuration:

    {
      "name": "commonDelegateConfig",
      "actions": {
        "highlight": {
          "enabled": true,
          "cells": [
            {
              "text": ["allow", "✓ online"],
              "color": "white",
              "bgcolor: "green",

we'll try to load "highlight" as plugin, which should exist under
opensnitch/plugins/highligh/highlight.py

Three new plugins has been added:
 - Highlight: colorize cells or rows based on patterns.
 - Downloader: a simple downloader which downloads files to local
   directories, for example to download blocklists.
 - Virustotal: a plugin to analyze IPs, domains and checksums with the
   API of virustotal when a new popup is fired.

There're 3 points where the plugins are configured and executed:
 - opensnitch/service.py - _load_plugins() (background/global plugins)
 - opensnitch/dialogs/prompt/__init__.py - _configure_plugins(), _post_popup_plugins()
 - opensnitch/dialogs/processdetails.py - _configure_plugins()

Plugins can't be configured from the GUI (yet).

For more details, read:
 opensnitch/plugins/__init__.py
 opensnitch/actions/__init__.py
 opensnitch/plugins/downloader/downloader.py
 opensnitch/plugins/virustotal/virustotal.py
2024-09-16 22:55:06 +02:00
Gustavo Iñiguez Goia
2e90f3832d ui: restrict allowed characters in the rule name
Since the name of the rule is used for the file name on the disk,
certain characters caused issues when saving the rule, like '/'.

Now if the user types or pastes '/' in the name field, a warning is
displayed, indicating that some characters are not allowed.

Closes #1166
2024-09-03 13:52:07 +02:00
Gustavo Iñiguez Goia
acdd2b34ec
ui,prefs: fixed changing qspinbox values
When changing qspinbox values (density scale, refresh interval, etc),
we were unintentionally changing [x] Disable popups option.
2024-06-20 00:32:46 +02:00
Gustavo Iñiguez Goia
552aed5bc5
ui: fixed exporting/importing rules
When exporting rules, use rfc3339 format for the Created field.
We were exporting as timestamp, which caused issues when importing them.

Related:
 58aa979cae
 issue #1140
2024-06-19 00:00:36 +02:00
Gustavo Iñiguez Goia
ad8e2f5371
ui: keep working if pyinotify fails loading
pyinotify has stopped working in python3.12, it fails loading with the
error:
ModuleNotFoundError: No module named 'asyncore'

For now, ignore this error and keep working as usual.
Applications icons will be loaded on GUI startup, but we loose the
ability of discovering the icons of applications while the GUI is
running.

Closes: #1132
2024-06-11 00:26:57 +02:00
Gustavo Iñiguez Goia
7a878e9516
ui: updated extensions to discover apps' icons 2024-06-05 00:22:04 +02:00
Gustavo Iñiguez Goia
b096e664c7
ui: fixed exporting rules to the clipboard
We were not formatting the "created" date field properly.
More info: https://github.com/evilsocket/opensnitch/issues/1140#issuecomment-2140904847
2024-05-31 00:09:23 +02:00
Gustavo Iñiguez Goia
33c592007f
ui,prefs: allow to configure more options
Allow to configure from the preferences dialog:
 - max stats and events.
 - rules path (use default path if empty).
 - internal GC percentage, flush connections on start.

Disabled daemon's DefaultDuration option when the daemon is not
connected to the server (GUI). By default is "once".

Improved configuration parsing.
Minor improvements to display status messages.
2024-05-30 00:30:02 +02:00
Gustavo Iñiguez Goia
8c25c3f7df
ui,prefs: node auth settings improvements
- Added "More information" label to the preferences dialog, and open a
   link to our wiki with more information.
 - Allow to configure node auth settings from the GUI:
   When we added the authentication options (12b4cf3104,
   6556eed1ae, f63d9dce72)
   we allowed to configure auth options from the GUI, but only if the
   nodes already had the options configured. If the auth options
   received were empty, we simply disabled the auth options on the
   preferences dialog.

   Now we build the configuration in this scenario, and sent it back to
   the nodes.
2024-05-18 21:56:17 +02:00
Gustavo Iñiguez Goia
427447574f
Merge pull request #1135 from ponychicken/patch-1
Improve wording in Top menu
2024-05-18 08:36:51 +00:00
Gustavo Iñiguez Goia
0c8935c6e8
ui, prefs: ignore SameFile error when enabling autostart
When clicking [x] Autostart the GUI upon login, ignore the exception if
src and dst (opensnitch_ui.desktop) are the same file.
2024-05-18 10:33:16 +02:00
ponychicken
d6f3552fa0
Improve wording 2024-05-18 09:16:55 +02:00
Gustavo Iñiguez Goia
a21a316e34
ui, prefs: load and conf daemon DefaultAction
In f5f30b1e58 we added the option to
reject connections as DefaultAction.

If configured, load and set it in the preferences dialog.
2024-05-18 00:51:54 +02:00
Gustavo Iñiguez Goia
0cc4d88e35
ui, prefs: improved loading auth options 2024-05-18 00:50:30 +02:00
Gustavo Iñiguez Goia
8cadf5316e
ui: fixed deleting rules
reverts 2ec37ed593

Closes: #1133
2024-05-18 00:03:48 +02:00
tioguda
df6c7d53f3 i18n: updated Brazilian Portuguese translation 2024-05-06 09:52:27 -03:00
Gustavo Iñiguez Goia
f5f30b1e58
added Reject to the list of DefaultActions(s)
We only offered two options for the DefaultAction option: allow/deny.

Since a long time ago we support "reject"ing connections, but it was not
configurable as the DefaultAction.

Closes: #1108
2024-05-01 00:23:48 +02:00
Gustavo Iñiguez Goia
bf9801f917
ui: allow to configure screen/themes scale factor
Added new options to the Preferences dialog, to configure screens/themes
scale factor.

If the UI is using the System theme (default), configure Qt scale
options (needs UI restart):
QT_AUTO_SCREEN_SCALE_FACTOR (default True)
QT_SCREEN_SCALE_FACTORS (If auto scale is False, use this value(s))

The user can configure different scale factors for multiple screens, by
separating values with ; (1;1.5, etc...)

https://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt

If the UI is using a qt-material theme, you can configure the "density"
scale of the theme:
https://github.com/UN-GCPDS/qt-material?tab=readme-ov-file#density-scale

https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#gui-size-problems-on-4k-monitors

Closes: #1102
2024-04-27 19:02:54 +02:00
Gustavo Iñiguez Goia
2ec37ed593
ui: fixed deleting rules with list limits
Fixed deleting rules when the GUI is configured to display a maximum
number of rules.
2024-02-11 11:41:49 +01:00
Gustavo Iñiguez Goia
fbd17a29da
pop-ups: filter by absolute path+cmdline on some cases
If the pop-ups' target is to filter by cmdline, but the typed/launched
command is not absolute or it starts with /proc, also filter by the
absolute path to the binary.
2024-02-08 17:45:21 +01:00
Gustavo Iñiguez Goia
016f4842ff
ui:use appimages pattern as default target if found
If the path of a process starts with /tmp/.mount_*, which is the common
path for appimages, use it as the default target on the popups.

Previously it was only added to the list of targets, but preselecting it
will help users to create rules for appimages.
2024-01-22 12:54:10 +01:00
Gustavo Iñiguez Goia
d9287bf601
ui: display alert details by double-clicking on it 2024-01-04 12:15:39 +01:00
Gustavo Iñiguez Goia
dc48d392f2
ui: save and display alerts/events from the daemon
New option to save and display alerts/events received from the daemon,
like system fw errors or eBPF modules errors.

Until now we only displayed a desktop message, making it difficult to
review the message in detail, or other actions.
2024-01-03 20:22:45 +01:00
Gustavo Iñiguez Goia
e905163a03
ui: make fw dialog status label selectable
- Allow to select by mouse or keyboard the status messages of the
   firewall.
 - Enable word wrapping.
2023-12-20 01:08:49 +01:00
Gustavo Iñiguez Goia
94492f0a71
ui: fixed config option 2023-12-17 20:52:39 +01:00