Commit graph

1608 commits

Author SHA1 Message Date
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
chncaption
6ede8f06a1 update golang.org/x/sys v0.0.0-20211205182925-97ca703d548d to 0.1.0 2023-07-21 14:42:51 +08: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
8740755f64
sys fw: report errors to the GUI after reloading
- Send errors to the server (GUI) if there's any error when reloading
   the system fw rules (far from being perfect/optimal, needs a
   rewrite).
 - Don't load the configuration after saving it, let the watcher reload
   it on write change to avoid double reload/duplicated errors.
2023-07-15 20:32:42 +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
3de24febf8
sys fw: improved rules errors logs 2023-07-13 17:24:38 +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
ad1cdd4015
tests: better sys-fw log,meta and ip tests 2023-07-12 12:53:13 +02:00
Gustavo Iñiguez Goia
eaec4a825c
tests: added sys-fw conntrack tests 2023-07-11 15:32:15 +02:00
Gustavo Iñiguez Goia
3ca5645c7e
tests: added quota tests 2023-07-11 13:53:01 +02:00
Gustavo Iñiguez Goia
7441aa2ccc
tests: rewritten nat tests
Move common nat checks to its own file.
2023-07-11 13:15:26 +02:00
Gustavo Iñiguez Goia
c2e6032a86
tests: added needed helpers 2023-07-11 01:16:23 +02:00
Gustavo Iñiguez Goia
dad8c0c65d
tests: added queue, nat tests
- Added queue, snat, dnat, redirect, tproxy and masquerade tests.
- Return errors if verdict parameters are not formatted as expected.
2023-07-11 00:57:15 +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
6ddd4dcee6
tests: added meta tests, improved ip tests 2023-07-09 23:05:12 +02:00
Gustavo Iñiguez Goia
b1ebc0eb22
sys fw: fixed setting marks on packets
Fix for meta mark set 666
2023-07-09 23:03:50 +02:00
Gustavo Iñiguez Goia
a18404fba9
tests: added sys-fw ip and iface tests
- Added ip daddr, saddr tests.
- Added basic iface tests.
2023-07-08 21:50:46 +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
78d82ec07d
Merge pull request #985 from nnsee/fix-pipefail
Use temporary files instead of piping in ebpf Makefile
2023-07-07 14:04:44 +02:00
Gustavo Iñiguez Goia
603c4ab39a
tests: added sys-fw verdict tests
- Added accept, drop, return and jump tests.
- Added reject tests.
2023-07-07 13:56:25 +02:00
Rasmus Moorats
122608bced
use temporary files instead of piping in ebpf Makefile 2023-07-07 13:28:58 +03:00
Gustavo Iñiguez Goia
1a063d10e2
tests: added new sys fw tests
- Added counter tests.
- Added ethernet addresses tests.

Added comments to some functions.
2023-07-07 00:46:09 +02:00
Gustavo Iñiguez Goia
e268a88cff
tests: added sys fw ports tests 2023-07-06 17:59:30 +02:00
Gustavo Iñiguez Goia
28fab440da
sys,fw: check for errors when adding ports rules
Verify that ports are correctly converted to int, for single and range
ports.
2023-07-06 17:58:17 +02:00
Gustavo Iñiguez Goia
84df5135ff
tests: added log and protocol expressions 2023-07-06 16:02:14 +02:00
Gustavo Iñiguez Goia
654a0fb54b
updated compilation/tests workflow 2023-07-06 14:40:47 +02:00
Gustavo Iñiguez Goia
aa8e793dc4
sys,fw: fixed compilation 2023-07-06 14:33:56 +02:00
Gustavo Iñiguez Goia
18e583d20e
tests: updated sys fw tests 2023-07-06 14:27:54 +02:00
Gustavo Iñiguez Goia
344819eb30
sys,fw: export more internal funcs 2023-07-06 14:09:54 +02:00
Gustavo Iñiguez Goia
d474e7f57a
sys,fw: export some internal utils. 2023-07-06 13:36:57 +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
d94154f0bd
tests: added missing testdata for ui/client 2023-07-04 13:57:58 +02:00
Gustavo Iñiguez Goia
2acace985e
small ui/client reorganization 2023-07-04 13:35:58 +02:00
Gustavo Iñiguez Goia
234984f85b
tests: added daemon config tests
- Test that the default config is loaded properly.
- Test that changes to the config are saved to disk.
- Test that changes to the config file on disk are reloaded properly.
2023-07-04 13:25:09 +02:00
Gustavo Iñiguez Goia
97703b65db
ui client: fixed setting daemon config
- Fixed setting daemon config.
- Removed unused code.
2023-07-04 01:31:16 +02:00
Gustavo Iñiguez Goia
edc9b17010
sys,fw: return errors when loading configurations 2023-07-01 23:13:31 +02:00
Gustavo Iñiguez Goia
f1ef00a5fd
tests: added nftables/system tests
- test add/delete system fw rules
- test fw config disabled.
2023-07-01 22:41:04 +02:00
Gustavo Iñiguez Goia
4a19fde155
tests: run tests as root 2023-06-30 16:29:20 +02:00
Gustavo Iñiguez Goia
0a2dcf6406
tests: added basic nftables/rules tests 2023-06-30 16:19:50 +02:00
Gustavo Iñiguez Goia
e345d61076
tests: added nftables/monitor tests 2023-06-30 10:51:18 +02:00
Gustavo Iñiguez Goia
78ac6c0f6b
tests: disable some tests by default, added utils.go tests
- These tests require permissions for creating new namespaces.
  By default disable them for now.
- Added utils.go tests.
2023-06-29 16:19:47 +02:00
Gustavo Iñiguez Goia
d3b40108c7
tests: added sys fw basic tables/chains tests 2023-06-29 11:27:18 +02:00
Gustavo Iñiguez Goia
5a0bd3bc27
added more requirements checks, minor code refactor
- Check kernel configs NET_DIAG_*.
- config.SaveConfiguration() -> config.Save()
2023-06-28 11:24:24 +02:00
Gustavo Iñiguez Goia
8240b7bfda
ui/client: minor code reorganization 2023-06-27 16:47:47 +02:00
Gustavo Iñiguez Goia
de45e1698b
ui: minor code reorganization 2023-06-27 16:19:51 +02:00