Commit graph

1,262 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
ba5208ef02
ui, cli: added proto/grpc versions to cli tool
Some checks failed
CI - build eBPF modules / build (5.19, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (5.19, master) (push) Has been cancelled
CI - build eBPF modules / build (5.8, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (5.8, master) (push) Has been cancelled
Build status / Build (push) Has been cancelled
v1.6.0-rc.4
Display what versions is using the GUI. It'll help to debug issues.

For next releases we may need to check incompatibilities between grpc
and protobuf (#790).
2023-01-06 23:57:15 +01:00
Gustavo Iñiguez Goia
690cea7774
ui, fw: fixed exception checking fw status
Under certain situation, checking fw status caused an exception
loading the GUI when new nodes connected.

What caused this error is unknown, so for now we'll protect the GUI from
crashing.

Closes #790
2023-01-06 15:53:03 +01:00
Gustavo Iñiguez Goia
5e61bd0989
ui, stats: fixed proc details monitor, better scrolling
- Scroll horizontally perpixel. Otherwise with long texts is hard to
   view the item.
 - Fixed process details monitoring.
2023-01-05 03:06:31 +01:00
Gustavo Iñiguez Goia
d31c4e86bf
fixed adding interception rule on some kernels
On some kernels (4.19), adding the interception rule to the
inet-mangle-output chain failed.

According to the nftables wiki, the mangle-output chain have (must?) to
be of type Route:
"route type: ... mangle table ... for the output hook (for other
hooks use type filter instead)."

https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Base_chain_types

So if we fail adding the interception rule, we retry it with type Filter
instead of Route.

Related: #781 , ced9a24
2023-01-04 21:44:46 +01:00
Gustavo Iñiguez Goia
ef7f809cf7
ui, stats: removed old button 2023-01-04 01:02:15 +01:00
Gustavo Iñiguez Goia
30a8c90829
ui: enable HighDpiPixmaps, fixed nodes list
- Enable high-dpi pixmaps for icons.
 - Fixed nodes connections listing when accesing from the Events view.
2023-01-03 12:31:12 +01:00
Gustavo Iñiguez Goia
c7ee55ab1a
ui, cli: added debug option, better help.
- Added --debug option, to get stacktraces when the GUI segfaults.
 - Added examples to show how to listen on IP addresses.
2023-01-03 00:59:12 +01:00
Gustavo Iñiguez Goia
75831aa082
ui: improved nodes management
- Fixed crashes when a node connects/disconnects.
 - Fixed listing nodes fw tables and chains.
 - Fixed deleting nodes from the list.
 - Prefs: Do not ask the user to restart the GUI when there're more than
   1 node connected.
2023-01-03 00:56:10 +01:00
Gustavo Iñiguez Goia
9d5823c48b
ui: improved nodes management
- Fixed reconfiguring nodes address from/to unix sockets <-> net
   sockets.
 - Fixed updating nodes status when connecting/disconnecting.
2023-01-02 19:54:15 +01:00
Gustavo Iñiguez Goia
c364ee1d7a
ui, stats: fixed displaying nodes statistics 2023-01-02 10:23:33 +01:00
Gustavo Iñiguez Goia
93add53103
ui, stats: added more columns to the process view
- Added columns Protocol, DstIP, DstHost and DstPort to the Process
   view.
 - Allow to filter by protocol.

This should ease to analyze cases like #787
2023-01-01 22:59:24 +01:00
Gustavo Iñiguez Goia
f1a3a3aa73
ui, fw: improved rules dialog
There were some issues on systems where protobuf is outdated, which led to
crashes and some dialog misconfigurations.
2023-01-01 19:36:52 +01:00
Gustavo Iñiguez Goia
fd3bf5716d
ui, fw: fixed crash loading not supported rules
Rules with targets other than stop, return, accept or drop are not
supported (from the GUI) yet.
2023-01-01 11:38:45 +01:00
Gustavo Iñiguez Goia
d072fe4786
ui, prefs: disable pop-ups if timeout is 0
When the timeout value is set to 0, enable the check [x] Disable
pop-ups.

It was not clear what 0 meant (#783)
2022-12-31 17:46:14 +01:00
Gustavo Iñiguez Goia
e7d976862b
ui: allow to import/export rules per node
From the nodes view.
2022-12-30 19:02:51 +01:00
Gustavo Iñiguez Goia
276966ad30
ui: some rules fixing 2022-12-29 16:58:32 +01:00
Gustavo Iñiguez Goia
e4cfad2aef
ui: added menu to export rules to clipboard/file 2022-12-29 16:46:15 +01:00
Gustavo Iñiguez Goia
b9cf0e86fd
ui: added options to export/import rules
- Added options to export/import rules to/from a directory.
   All nodes' rules will be exported, each ruleset to its own
   directory.
   Importing rules will be added to all nodes.
   WIP, we'll make it more granular.

Closes #324 #746
2022-12-29 14:33:14 +01:00
Gustavo Iñiguez Goia
b7198a6fef
ui: group rules functionality 2022-12-28 20:44:11 +01:00
Gustavo Iñiguez Goia
2cdbd97035
ui, views: fixed address view, general clean up 2022-12-28 02:00:49 +01:00
Gustavo Iñiguez Goia
cc903df17c
ui, views: select rows only with the left button 2022-12-28 01:43:42 +01:00
Gustavo Iñiguez Goia
f4209f7e1d
ui: preferences improvements
- Fixed saving columns to display on the Events view.
- Update Events columns just after saving changes.
- Show a status message if there're no nodes connected.
2022-12-27 21:42:44 +01:00
Gustavo Iñiguez Goia
fc510d40aa
ui: improved views behaviour
- Preserve row selection while refreshing or scrolling up/down the
  views.
- CTRL-C now copies all rows if they're selected with CTRL+A.
- The views are only refreshed if the scrollbar is at the top or the
  bottom. Should ease rows inspecting.
2022-12-27 12:18:48 +01:00
Gustavo Iñiguez Goia
cf491ac649
ui: make all Events columns clickable 2022-12-25 17:33:35 +01:00
Gustavo Iñiguez Goia
bb649f1448
ui: allow to delete entries from more views
Allow to delete entries from hosts, procs, addrs, ports or users views.
2022-12-25 17:24:38 +01:00
Gustavo Iñiguez Goia
67c6321063
pop-ups: disable timeout clicking on the pop-up 2022-12-25 12:15:33 +01:00
Gustavo Iñiguez Goia
03b71e9ca2
ui: removed non-used widget from main win 2022-12-24 12:29:05 +01:00
Gustavo Iñiguez Goia
ee7153ea42
ui: allow to stop/start interception per node
- Added button to start/stop interception by node.
- Added button to delete nodes.
- Added button to show node's preferences.
- Improved nodes' connections listing.
2022-12-24 12:01:46 +01:00
Gustavo Iñiguez Goia
274a3483d7
improvements to ui, ebpf, netfilter
- Fixed firewall dialog label alignment.
 - Fixed potential race condition when stopping the daemon, and there're
   connections being enqueued.
 - Added "clear" button to GUI's filter line (#786)
 - Create ebpf cache object only if the modules have been loaded.
 - Set default stats workers to the sme amount defined in configuration.

Closes #785
2022-12-23 14:39:49 +01:00
Gustavo Iñiguez Goia
520b1f6a33
ui: apply filter when loading the GUI
When closing the GUI we save the filter text typed by the user.
However we weren't restoring it back when launching the GUI again.

Closes #786
2022-12-23 10:43:36 +01:00
Gustavo Iñiguez Goia
05e63e97a7
sys fw: improved chains creation
This is part of latest commit ced9a24933

 - When reusing a chain, configure the new policy.
 - Don't backup existing rules when reloading the configuration.
2022-12-23 00:50:22 +01:00
Gustavo Iñiguez Goia
ceee7970a3
fixed script to compile ebpf modules 2022-12-22 12:08:18 +01:00
Gustavo Iñiguez Goia
39473439b2
ebpf monitor: fixed crash if modules are malformed
If a eBPF module is malformed, we crashed trying reading the eBPF maps.
2022-12-22 11:40:34 +01:00
Gustavo Iñiguez Goia
85776f4d17
Bump ui and daemon versions to 1.6.0rc4 2022-12-22 10:20:36 +01:00
Gustavo Iñiguez Goia
ced9a24933
nftables: fixed adding interception rules
On some systems after disabling and enabling the interception, the
DNS rule was not being re-added, with error: chain already exists.

When the interception is disabled, we firstly remove the rules,
and secondly if the chain and table is empty we try to remove them
as well.

However, on some systems even if "nft list ruleset" didn't list the
chains to hold our rules, it failed with error "already exists".

Before adding a chain now we check if it exists, and if it does we
reuse it.

Closes #781
2022-12-22 00:19:16 +01:00
Gustavo Iñiguez Goia
210e843aab
moved basic ebpf definitions to its own file
BPF_MAP_TYPE_PERCPU_ARRAY was introduced in kernel version 4.6, so with
latest changes to intercept processes we lost support for older kernels
< 4.6.

Now we work again for example on kernels 4.4.
2022-12-21 21:11:40 +01:00
clayton craft
8f49816dee
daemon/Makefile: improvements to make distro packaging easier (#780)
* daemon/Makefile: add support for PREFIX, DESTDIR, SYSCONFDIR in install

This is helpful for package maintainers who need to install components
into specific locations for building packages of this project.

example:
$ make \
    PREFIX=/usr \
    DESTDIR=/some/package/dir \
    SYSCONFDIR=/foo/etc \
    install

* daemon/Makefile: use 'install' to copy files / make dirs
2022-12-21 10:35:52 +01:00
Gustavo Iñiguez Goia
8da5d072f7
ui, sys fw: allow to filter fw rules by more fields 2022-12-20 22:37:58 +01:00
Gustavo Iñiguez Goia
7b99383546
find connections with connection fields swapped
Under certain situations, like when using systemd-resolved as DNS
resolver, we receive outbound connections with the fields swapped:

Instead of: local-port:local-ip -> public-ip:public-port
we receive: public-port:public-ip -> local-ip:local-port

Sometimes this behaviour causes network slowdowns, or no network at all.

If we swap the fields of these connections, then we're able to get the
process and keep functioning as usual. But what causes this behaviour is
yet unknown, and needs further analysis.

See these issues for more information: #779 , #711
2022-12-20 17:16:20 +01:00
Gustavo Iñiguez Goia
a45ba914e3
better ebpf tasks cancellation
It should improve daemon stopping times.
2022-12-19 18:38:13 +01:00
Gustavo Iñiguez Goia
b8b8342cae
ui, prefs: fixed logic when changing the db type 2022-12-19 12:34:27 +01:00
Gustavo Iñiguez Goia
afa23f5ac2
sys fw: improved rules, profiles policies
- Allow to use commas to define conntrack states:
  ("related,established")
- Remove profile's rules when switching from Deny to Allow.
- Fixed checking duplicated rules.

Closes #778
2022-12-19 10:59:43 +01:00
Gustavo Iñiguez Goia
50217afc9f
added initial support for ICMP and SCTP
Closes: 714
2022-12-18 00:41:06 +01:00
Gustavo Iñiguez Goia
342c75a6e1
better errors, fixed default sys fw conf 2022-12-16 17:09:37 +01:00
Gustavo Iñiguez Goia
c81dc22c02
sys fw: allow to change fw type from the GUI
- Configuration of system firewall rules from the GUI is not supported for
 iptables. Up until now only a warning was displayed, encouring to change
 fw type manually.

 Now if configured fw type is iptables (default-config.json, Firewall:),
 and the user opens the fw dialog, we'll ask the user to change it from
 the GUI.

- Add fw rules before connecting to the GUI. Otherwise we send to the
  GUI an invalid fw state.
2022-12-16 17:03:36 +01:00
Gustavo Iñiguez Goia
9e630d009d
ebpf: fixed loading modules on arm32 arch
Make use of kernel macros to decide for what architectures we compile
the modules.

On armv7l the connections module was failing due to iptunnel_xmit, so
exclude it from being compiled.

One can export ARCH=arm, ARCH=i386 or ARCH=arm64 to compile the modules
for these architectures, instead of hacing to edit the source files.
2022-12-13 23:59:54 +01:00
Gustavo Iñiguez Goia
1775da2b48
sys fw: silence error parsing configuration
Some checks failed
CI - build eBPF modules / build (5.19, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (5.19, master) (push) Has been cancelled
CI - build eBPF modules / build (5.8, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (5.8, master) (push) Has been cancelled
Build status / Build (push) Has been cancelled
v1.6.0-rc.3
2022-12-11 22:11:37 +01:00
Gustavo Iñiguez Goia
e7cbbb7489
ui,prefs: fixed asking the user to restart the GUI
Fixed asking to restart the GUI when the user changes the server
address.
2022-12-11 18:25:31 +01:00
Gustavo Iñiguez Goia
93e1135b4a
better ebpf errors printing
Provide more information when loading ebpf modules fails.
2022-12-11 17:25:05 +01:00
Gustavo Iñiguez Goia
0f51ea0c79
ui, fw: disable output policy configuration
Disable for now output policy configuration. Setting it to Drop blocks
all outbound connections.
2022-12-11 16:28:24 +01:00