Commit graph

424 commits

Author SHA1 Message Date
Ryan Olton
c3039dd524 set prompt width and height after initial display; set prompt minimum and maximum size using initial width and height values 2021-11-04 09:41:08 -04:00
Gustavo Iñiguez Goia
9d0c5a104e ui: fixed GUI loading when DE autologin is on
Fixed GUI loading behaviour when DE's autologin is on.

Background:
 Sometimes the system tray is not available, so our app's icon
 does not show up. In this case we show the GUI to allow the user
 manage the rules and view connections.

If the user activated the autologin option, on KDE (and probably others)
our service was launched before the panel was ready, so the system tray was
not available yet and we were showing the Events window.

Changes:
- Delay 10s the check to see if the system tray is available, to give it
  time to load.
- Add X-KDE-Autostart-after=panel to kcm_opensnitch.desktop, to launch
  the GUI only after the panel is loaded.
- Misc: removed OpenSnitch entry from System Settings on KDE, and update
  the categories where the app is shown in the menus.

Closes #535
2021-10-28 18:24:29 +02:00
Gustavo Iñiguez Goia
c609b09f1d ui, tests: added Preferences dialog tests
TODO: test db configuration changes. There're problems clicking on the
QMessageBox.
2021-10-25 13:54:08 +02:00
Gustavo Iñiguez Goia
e8dd17418f Bump versions to v1.5.0rc1 2021-10-19 12:00:22 +02:00
Gustavo Iñiguez Goia
9ef64da588 ui: fixed crash when displaying the GUI
On Fedora 34, without the appindicator extension installed, when the GUI
was displayed it crashed with the following error:

TypeError: index 0 has type 'float' but 'int' is expected.

related: #526
2021-10-08 12:57:44 +02:00
Gustavo Iñiguez Goia
ff99b39d09 ui, tests: added rules editor tests
to run them:
pytest tests/

They dould be integrated with a github action.
2021-10-05 16:34:30 +02:00
Gustavo Iñiguez Goia
4ea0904ff3 ui: allow to filter connections by PID
This change allows to filter connections by PID.

Others have referred to this feature as "filter connections for this
instance/session" or similar, so maybe a better wording is needed.
Open a new discussion or send a PR if you have a better sentence that
describe this option please.
2021-09-25 11:51:09 +02:00
Gustavo Iñiguez Goia
2c1acdbfc1 don't overwrite rules if they already exist (2/2)
Don't overwrite rules when adding or editing rules, to avoid losing
already added rules.

- When adding a rule, check if there's already a rule with the same
  name.
- After adding a new rule, enter into EDIT mode, to allow changes to the
  rule without closing the dialog.
- If the user changes the name after adding a rule, check if there's a
  rule with the same name.
- When editing a rule and the user changes the name, check if there's a
  rule with the same name.

issue #512
2021-09-19 23:57:41 +02:00
Gustavo Iñiguez Goia
c97a01d52f don't overwrite rules if they already exist.
Don't overwrite rules when adding or editing rules, to avoid losing
already added rules.

closes #512
2021-09-19 16:01:58 +02:00
Gustavo Iñiguez Goia
3b6c0412e0 rules: added more lists types to block/allow
- Added lists of IPs and network ranges. One per line. Blank lines or
  lines that start with # are ignored.
- Added lists of domains with regular expressions. One per line.
  Blank lines or lines that start with # are ignored.

Until now you could use regular expressions with the fields
"To this host" or "To this IP", to match multiple domains or IPs.
But if you wanted to use more than 2-3 domains or IPs it was not really
user friendly.

Hopefully we'll be a little more versatile to cover use cases like #461
and #485.
2021-09-18 00:17:58 +02:00
Gustavo Iñiguez Goia
8d3540f7f9 added action reject
When blocking a connection via libnetfilter-queue using NF_DROP the
connection is discarded. If the blocked connection is a DNS query, the app
that initiated it will wait until it times out, which is ~30s.

This behaviour can for example cause slowdowns loading web pages: #481

This change adds the option to reject connections by killing the socket
that initiated them.

Denying:
    $ time telnet 1.1.1.1 22
    Trying 1.1.1.1...
    telnet: Unable to connect to remote host: Connection timed out

    real	2m10,039s

Rejecting:
    $ time telnet 1.1.1.1 22
    Trying 1.1.1.1...
    telnet: Unable to connect to remote host: Software caused connection abort

    real	0m0,005s
2021-09-12 10:54:24 +02:00
Gustavo Iñiguez Goia
9ccb6498ec i18n: fixed fr_FR translation generation 2021-09-10 11:26:51 +02:00
Gustavo Iñiguez Goia
cddc5b6de8 ui,pop-ups:use the proc path if the args are empty
Some checks failed
Build status / Build (push) Has been cancelled
If the cmdline of a process is empty, use the process' path to create
the rule, instead of process.command field.
2021-09-09 16:17:48 +02:00
Gustavo Iñiguez Goia
499b037f84 ui, i18n: added fr_FR translation
Thanks to @Herve5. #484
2021-09-07 12:59:54 +02:00
Gustavo Iñiguez Goia
f5bb478c99 use GUI's default action when applying a verdict
When the daemon connects to the GUI, use the default action
configured on the GUI to apply a verdict on new connections.

We were using daemon's default action, so if it was Allow but the user
had configured Deny on the GUI it was allowing connections, causing some
confusion (#489)

TODO: apply this action not only on connecting to the GUI, but also when
saving the configuration from the GUI.
2021-09-03 17:37:26 +02:00
Gustavo Iñiguez Goia
18f0c9133d ui, rules editor: fixed parsing duration
When adding a new rule we were getting the duration as it appeared on
the combo box. It was used to create a Golang time.

However translators were translating the duration strings (30s, 5m,
etc), causing errors when saving the rule.

Now we just look for the index of the selected duration.
2021-09-01 02:08:58 +02:00
freddii
1fa4e421ca updated german translation 2021-08-31 12:53:23 +02:00
Gustavo Iñiguez Goia
041cf456dc Bump versions to v1.4.0 2021-08-27 13:48:20 +02:00
gnuhead-chieb
48538323ca
Add files via upload 2021-08-22 08:03:11 +09:00
Flávio Costa
e85ba18a17
Update Brazilian Portuguese translation (#478)
* Update Brazilian Portuguese translation
2021-08-20 20:51:39 +02:00
Gustavo Iñiguez Goia
94fa3c8093 ui, stats: better window restoration on KDE
Latest approach seems to not always work (latest KDE on kubuntu 20 and
manjaro as of today).

This seems to work better:
https://doc.qt.io/qt-5/qwidget.html#setWindowState
2021-08-13 18:03:10 +02:00
Gustavo Iñiguez Goia
2b8c931762 ui, events: translate columns headers
Related: #465
2021-08-12 15:12:11 +02:00
Gustavo Iñiguez Goia
38d4fb9ae5 Bump versions to v1.4.0rc4 2021-08-11 17:16:56 +02:00
Gustavo Iñiguez Goia
6ce099ffd5 ui, events: fixed restoring state when minimized
On KDE the events window was not restored to previous state when the
window was minimized to the taskbar.

This was fixed by @themighty1 in this PR #315, but there was an
unexpected behaviour on others DE.

As I haven't seen this error in others DE, we apply the original
fix, but only when the DE in use is KDE.
2021-08-09 15:28:15 +02:00
Gustavo Iñiguez Goia
0910249fb2 ui: fixed typos, improvements.
- Fixed typos in the preferences dialog (#465).
- Fixed hiding/showing rules combobox.
- Keep opensnitchd/default-config.json format when saving node's
  configuration from the GUI.
2021-08-09 13:30:56 +02:00
Gustavo Iñiguez Goia
db18b0cc63
Merge pull request #470 from ovari/master
Update opensnitch-hu_HU.ts
2021-08-08 12:51:34 +02:00
Gustavo Iñiguez Goia
bca5ffa9b5 ui,rules: update rules last_seen field on new stats
Update the last_seen field every time a new connection is established.
2021-08-08 12:29:37 +02:00
ovari
dd94c3fe1a
Update opensnitch-hu_HU.ts 2021-08-06 18:28:24 +10:00
Gustavo Iñiguez Goia
388c98e559 ui,preferences dialog: fixed crash
qcombobox placeHolderText preference was set as translatable, and it
caused a crash.
2021-08-03 01:11:12 +02:00
Gustavo Iñiguez Goia
f96e44dc93 ui: improved UI internationalization, columns fix
- Now the columns names of the details views can be translated (#465).
- Fixed columns size restoring when clicking on the Events tab to view
  the details of an item (process, rule or node).
2021-08-02 17:16:10 +02:00
Gustavo Iñiguez Goia
de3c4be5d5 ui: allow personalize columns size
Now if you resize any columns, it'll be remembered the next time you
open that view.
2021-07-31 18:57:17 +02:00
Gustavo Iñiguez Goia
2b3fdfc948 ui,db: display an error if the db file is corrupted
Display an alert if the db loaded from disk is corrupted.

closes #460
2021-07-31 01:35:28 +02:00
Gustavo Iñiguez Goia
83ab1f9f5e ui, prompt: fixed increasing height when prompting
There was an annoying bug that increased the pop-up height a little bit
everytime a new pop-up was displayed.

Hopefully this time it's fixed, while maintaining compatiblitiy on the
mobile (i.e.: displaying the buttons at the bottom and the connection
information at the top of the pop-up).
2021-07-29 19:22:15 +02:00
Gustavo Iñiguez Goia
b644853d63 ui: allow to configure events columns, misc
* Preferences:
  - Allow to configure the columns of the Events tab.
  - Fixed displaying labels on small screens.

* Rules:
  - Added combo to select the type of rules to list (all, permanent,
    temporary) when the left panel is hidden.

* Main window:
  - Improved tabs widgets positioning.

* Misc:
  - Improved code to avoid typos.
2021-07-26 19:00:22 +02:00
Gustavo Iñiguez Goia
a3a171d2a2 ui: allow to ignore temporary rules, fixes, impovements
- Added option to ignore temporary rules. All or only of duration
  "once".
  You can still use them when answering a pop-up, but if you check the
  option, the rules won't be added to the rules list.

- Fixed wrong behaviour when adding rules to the db/gui.
  When changing a rule duration (always->30s, 30s->always), if there
  were connections matching that rule, the rule was re-added to the
  db/rules list with the old duration, ending up with 2 rules in the
  list.
  This was caused by how stats are sent to the GUI. When populating the
  db with the stats, we were also adding the rules.

  Now we don't add the rules when adding the stats. Rules are added to
  the db everytime a node connects to the GUI, when answering a pop-up
  or whenever the user performs an operation on them.

  Performance has increased a little bit due to this.

- Fixed applying configuration to all nodes at once.
- Added help menu to the preferences dialog.
- Removed lists grid.
- A little bit of code reorganization.
2021-07-24 23:53:42 +02:00
Gustavo Iñiguez Goia
544887adeb ui, pkgs: added packaging step to fix pb2 files.
Some checks failed
Build status / Build (push) Has been cancelled
2021-07-17 11:13:34 +02:00
Gustavo Iñiguez Goia
708a7e6333 Bump versions to v1.4.0rc3 2021-07-16 23:41:02 +02:00
Gustavo Iñiguez Goia
5e56e9033f ui, process monitor dialog: fixed exception
Fixed exception when stopping the monitor fails and an error is
returned.
2021-06-19 01:00:33 +02:00
Steven Hollingsworth
de559dccf8
Changed import ui_pb2 from global to relative 2021-06-18 12:54:17 -07:00
Steven Hollingsworth
3d9b44cb50
fixes #439 - module namespace conflict 2021-06-17 16:39:35 -07:00
gnuhead-chieb
a006f25fb3
Add files via upload 2021-06-16 11:39:42 +00:00
Gustavo Iñiguez Goia
eaa015870b ui,rules: fixed refreshing list after delete,
- Fixed refreshing rules list after delete a rule(s).
  (There was an annoying delay).
- Added button to delete connections associated with a rule, from the
  details view of a rule. (related: #334).
2021-06-09 00:25:24 +02:00
ovari
5f73dc1069
Update opensnitch_ui.desktop 2021-06-03 06:44:21 +10:00
Gustavo Iñiguez Goia
95a30c4959 ui, rules editor: fixed editing/adding rules
There was a race condition that caused several problems when editing or
adding rules.

for rules of type "list", the operand must be "list" as well.

related: #429 #425
2021-05-31 20:22:44 +02:00
Gustavo Iñiguez Goia
2c1f8e1d8c ui: added description to the .desktop file
closes #422
2021-05-23 16:14:36 +02:00
ovari
cbabc84076
Update opensnitch-hu_HU.ts 2021-05-21 06:57:25 +10:00
ovari
5ae629bde4
Update opensnitch-hu_HU.ts 2021-05-20 19:49:23 +10:00
Gustavo Iñiguez Goia
050292601e translations: deleted hu_HU file from wrong directory 2021-05-14 01:57:18 +02:00
ovari
5be9911f00
Add translation template for hu_HU and sort TRANSLATORS alphabetically (#411)
* Update opensnitch_i18n.pro

List `TRANSLATIONS` alphabetically

* Create opensnitch-hu_HU.ts
2021-05-13 23:34:56 +02:00
Gustavo Iñiguez Goia
03f378687b updated translation files, added ro_RO and hu_HU
New translation files not yet translated.
2021-05-12 21:06:20 +02:00