Commit graph

912 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
38bfb58442 ui: improved preferences dialog saving notification 2020-10-27 01:59:45 +01:00
Gustavo Iñiguez Goia
8abf2abece ui: fixed getting pop-up timeout default value 2020-10-27 01:45:14 +01:00
Gustavo Iñiguez Goia
2dd9c43f0d fixed typo 2020-10-27 01:40:03 +01:00
Gustavo Iñiguez Goia
64ac5f0f73 Merge branch 'ui2.0' into main 2020-10-27 00:35:00 +01:00
Gustavo Iñiguez Goia
713e4ff1d5 ui: save only daemon's configuration known fields
The daemon may have fields that the GUI don't understand, so save only
the part of the configuration we know.
2020-10-26 23:53:23 +01:00
Gustavo Iñiguez Goia
0d1e9f5b47 set server address and log file from the default config
The server address and log file were hardcoded into the
opensnitchd.service file, making it almost impossible to change.

Soon we'll be able to change it from the UI.
2020-10-26 23:16:27 +01:00
Gustavo Iñiguez Goia
4c26454409 added functions to open a log file 2020-10-26 16:12:58 +01:00
Gustavo Iñiguez Goia
6522a94937 ui: make pop-up dialogs optionals
If the default timeout is set to 0, do not display the pop-up dialog and
apply the default configured actions.

Fixed typo in preferences dialog.
2020-10-25 23:56:10 +01:00
Gustavo Iñiguez Goia
b02e3fa2f0 Merge branch 'ui2.0' into main 2020-10-25 01:20:15 +02:00
Gustavo Iñiguez Goia
d815d4c2cc ui, preferences: display configuration result
Display if the configuration sent to a node has been applied correctly.
2020-10-25 01:06:10 +02:00
Gustavo Iñiguez Goia
1c3a9d1ba4 ui: fixed viewing stats of a node
clicking from the General tab
2020-10-24 22:19:00 +02:00
Gustavo Iñiguez Goia
e625b93b11 fixed switching between process monitor methods
we were not switching between process monitor methods properly, so we're
falling back to proc method in some cases.

Besides, there's seems to be a descriptors leaking problem in ftrace package
when closing resources.
2020-10-24 20:08:11 +02:00
Gustavo Iñiguez Goia
1e069a6fec audit: be more verbose on errors 2020-10-24 19:49:16 +02:00
Gustavo Iñiguez Goia
01e795c9ea ftrace: report if Reset() has failed
+ added funcs comments
2020-10-24 19:15:42 +02:00
Gustavo Iñiguez Goia
e357fae691 Merge branch 'fix-deadlock-69' into main
closes #69
2020-10-24 01:23:44 +02:00
Gustavo Iñiguez Goia
7724556a36 Merge branch 'ui2.0' into main 2020-10-23 23:44:33 +02:00
Gustavo Iñiguez Goia
6637861f33 ui, ruleseditor: set and load case-sensitive field correctly 2020-10-23 23:36:39 +02:00
Gustavo Iñiguez Goia
279092d73d Merge branch 'ui2.0' into main 2020-10-23 01:21:19 +02:00
Gustavo Iñiguez Goia
ab46cca43a added priority and case-sensitive rules, fixes
nodes:
 - added WA for backward compatibility with older protobuf libs.

stats:
 - added sensitive and priority rules columns
 - fixed selecting a node from the General tab.
 - if DstHost is empty, display the IP instead.
 - Hosts tab nw only lists hosts.

rules editor:
 - added options to define if a rule has precedence and if it's
   case-sensitive (for all fields for now). Default is case-insensitive.

closes #36
2020-10-23 01:04:49 +02:00
Gustavo Iñiguez Goia
5990560631 fix a deadlock and race condition checking monitor method
closes #69
2020-10-23 00:15:55 +02:00
Gustavo Iñiguez Goia
820a6f2930 added option to set priority on the rules
If a rule has the priority flag set, no others rules will be checked.
So if you name the rule as 000-allow-xx and set the priority flag, the
rule wil lbe the only one that will be checked if it matches a
connection.

See #36 to know more on this feature.
2020-10-23 00:02:16 +02:00
Gustavo Iñiguez Goia
c2ee61076d sort rules by name
Sort rules by name, so they're checked in alphabetical order.

This way, you can place deny rules at the top of the list to get better
performance, since it won't check the rest of the rules.

Discussion: #36
2020-10-21 08:13:41 +02:00
Gustavo Iñiguez Goia
cc75289202 fixed typo in audit description
spotted by @themighty1
2020-10-21 00:06:53 +02:00
Gustavo Iñiguez Goia
4949ab1e4e allow to filter connections by protocol
Added option to filter connections by protocol.

Just add an operand "protocol" as follow:
```
  "operator": {
    "type": "simple",
    "operand": "protocol",
    "sensitive": false,
    "data": "tcp",
    "list": []
  }
```

closes #64
2020-10-20 19:00:00 +02:00
Gustavo Iñiguez Goia
e919bd557c ui: refresh rules list after rules deletion
It was not being refresh properly. Mentioned here #28#issuecomment-633700103
2020-10-19 23:51:53 +02:00
Gustavo Iñiguez Goia
d3d8aa9029 ui: set an alternative theme if the default one fails
In some scenarios some button icons are not available.

In these cases we'll first try to use the fallback theme, f it's
configured. If the buttons are still not available, list the themes
installed, and determine which one has the buttons we need, then use it.

If all this fails, then display a warning message to the user.

closes #53
2020-10-19 23:12:01 +02:00
Gustavo Iñiguez Goia
3f3e2d6de0 ui: added backward compatibility with old protobuf package 2020-10-19 19:03:04 +02:00
Gustavo Iñiguez Goia
0921ca46e3 ui,systray icon: display IP if dst_host is empty 2020-10-19 19:01:19 +02:00
Gustavo Iñiguez Goia
c5da68d8e1 ui: if dst_host is empty, display the IP
Destination host field can be empty sometimes. In these cases display
the IP.
2020-10-19 18:57:26 +02:00
Gustavo Iñiguez Goia
1e6d03e332 do not assign an IP to the DstHost field
In case we're connecting to an IP directly, or if an IP is not resolved,
leave the DstHost field empty and format it appropiately on the UIs.

Otherwise we can't know (easily) if the field DstHost of a connection is
an IP or a domain.
2020-10-19 01:29:00 +02:00
Gustavo Iñiguez Goia
d6cf18ef27 show domain name when establishing a new connection
When a new connection is about to be established and the system performs
a dns resolution, we displayed it like this: 9.9.9.9 (www.opensnitch.io)

It added visibility of what was going on, but if you created a rule to
filter by destination host, you were prompted twice to allow firstly the
DNS query, and secondly the TCP connection, which was a bit annoying.

Some users (#5) also asked to display just the domain, so now we only
display the domain name.
2020-10-19 01:02:05 +02:00
Gustavo Iñiguez Goia
bc70423997 make rules case-insensitive by default
Destination host, process path and process arguments are now case
insensitive by default.

There's a new rule operator field (sensitive), to change this behaviour:
```
      {
        "type": "simple",
        "operand": "dest.host",
        "sensitive": false,
        "data": "opensnitch.io",
        "list": null
      }
```

Rules without this field will evaluate as false by default.

closes #45
2020-10-19 00:25:04 +02:00
Gustavo Iñiguez Goia
1f6a2db964 ui: don't set the focus on the action buttons
Sometimes you can deny/allow a connection unintentionally while typing.
Now the focus is set to the "+" button, and you can jump to the deny or
allow button with the arrow keys.

Issue #58.
2020-10-14 23:35:05 +02:00
Gustavo Iñiguez Goia
bc26ca4afd ui deb pkg: improved post install
Do not install .desktop file if /home/$directory is not the home of a
user: #57.
Avoid confusing users by avoiding noisy errors (#57).
2020-09-29 02:16:33 +02:00
Gustavo Iñiguez Goia
7deb2f3212 ui: fixed python3 system libs path on OpenSuse
/usr/lib/python3/dist-packages/ was missing on OpenSuse TumbleWeed.
Maybe it's not the best solution, but solves the problem for now.

Reported by zaggynl here #59.
2020-09-26 01:13:32 +02:00
Gustavo Iñiguez Goia
7a7341b3e4 python deps: added protobuf, pyqt>=5.6 2020-09-21 01:03:01 +02:00
NP-Hardass
08abdd0950 go.mod: add netns as indirect dependency for netlink 2020-09-08 17:07:28 -04:00
Gustavo Iñiguez Goia
fbf94cc174 improved nodes api 2020-08-22 01:32:42 +02:00
Gustavo Iñiguez Goia
00179f1b0c added api to manage nodes.
Working:
 - save new nodes.
 - list nodes.
2020-08-21 18:24:59 +02:00
Gustavo Iñiguez Goia
ba3ee9b0b9 added common package to interact with clients
Functionality to interact with clients as a server.
2020-08-19 20:06:22 +02:00
Gustavo Iñiguez Goia
544ce11a21 Bump daemon version to 1.0.1 2020-07-30 22:04:56 +02:00
Gustavo Iñiguez Goia
c2daf45df3
Update go.yml: golint on pull_requests 2020-07-30 02:02:00 +02:00
Gustavo Iñiguez Goia
df9e781051 Do not panic if we can't insert fw rules
Some systems has the IPV6 protocol disabled, so we failed starting up
with the error "Address family not supported by protocol" (#52).

Now we don't exist even if we can't insert the needed rules, we'll just
log the error.
2020-07-30 01:10:53 +02:00
Gustavo Iñiguez Goia
f9bb823e65 Bump GUI version to 1.0.1
Fixes a crash when clicking on some columns of the General tab, shortens
autogenerated rules names and adds the literal dst host the popup combo
box.
2020-07-29 01:17:43 +02:00
Gustavo Iñiguez Goia
f4845240cc fixed typo and lint errors 2020-07-29 01:17:05 +02:00
Gustavo Iñiguez Goia
00b249a171 remove useless debug message when executing a command
As we return the error message if the execution fail, use it from where
the method is called.
2020-07-29 00:48:37 +02:00
Gustavo Iñiguez Goia
eff9c5c262 Merge branch 'ui2.0' into main 2020-07-28 22:57:26 +02:00
Gustavo Iñiguez Goia
d137a50d41 check GUI and daemon versions granularly
Do not display the warning dialog about diferent versions
(daemon<->GUI), if we only have relesed fixes or minor changes.
2020-07-28 22:38:53 +02:00
Gustavo Iñiguez Goia
dba0c83ced fixed crash when clicking on a General tab wrong column
Reported here: https://github.com/gustavo-iniguez-goya/opensnitch/issues/38#issuecomment-665006899
2020-07-28 18:23:21 +02:00
Gustavo Iñiguez Goia
08245a075e intercept RELATED packets
We must intercept RELATED packets, not only for intercept protocols like
ftp-data, but also to handle connection errors (ICMP errors), like the
ones originated when dis/connecting from a wifi network.
2020-07-25 21:48:16 +02:00