Commit graph

782 commits

Author SHA1 Message Date
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
Gustavo Iñiguez Goia
214e1b3c49 added priority rules to bypass/extend interception
In some scenarios (#47) may be useful to have a set of rules handled from
OpenSnitch, although you can accomplish it with other software (ufw,...).

This rules will sit just above default intercetion, so if you want to
allow or deny something, just place it here.

These priority rules are defined in /etc/opensnitchd/fw.json, with the
following format (example):

{
    "PriorityRules": {
        "out": {
            "allow": [
            ],
            "deny": [
                "-m conntrack --ctstate INVALID",
                "-p tcp ! --syn -m conntrack --ctstate NEW"
            ]
        }
    }
}

The structure must exist even if you haven't defined any rule, for
example:
{
    "PriorityRules": {
        "out": {
            "allow": [
            ],
            "deny": [
            ]
        }
    }
}
2020-07-25 21:23:53 +02:00
Gustavo Iñiguez Goia
ace124ad6a added the host to the options of the pop-up dialog
The host to where a process is connecting to was missing in the options
list, when the connection to allow was a query to resolve the domain
name. Reported here: #48

Also added the connection port to the rule name.
2020-07-20 23:59:14 +02:00
Gustavo Iñiguez Goia
c0fb84a0e3 changed go.mod to not depend on a fixed release 2020-07-17 02:03:03 +02:00
Gustavo Iñiguez Goia
b547067f61 close nfqueue descriptors gracefully
When the daemon is stopped, we need to close opened netfilter recurses.
Otherwise we can fall into a situation where we leave NFQUEUE queues
opened, which causes opensnitch to not run anymore until system restart
or a manual intervention, because there's a NFQUEUE queue already created
with the same ID.

This is what was happening as a collateral effect of #41.
2020-07-17 01:29:58 +02:00
Gustavo Iñiguez Goia
078df0ffb2 removed dep ensure when building rpm packages 2020-07-16 23:54:50 +02:00
Gustavo Iñiguez Goia
313ae0d2cb
Merge pull request #49 from raphting/gomod
Use go mod instead of dep
2020-07-16 23:52:43 +02:00
Raphael
ffbb138bd6 equip go.mod file with packages 2020-07-16 23:06:32 +02:00
Raphael
563247a87c add go.mod and remove old Gopkg.lock 2020-07-16 23:05:25 +02:00
Raphael
1248a2326c remove go dep from Makefile 2020-07-16 23:04:11 +02:00
Gustavo Iñiguez Goia
9eb589a3ea v1.0.0 release
Current version is stable enough (based on users' feedback) to get it out
of the release candidate state. OpenSnitch works and is usable.

There's a lot of work yet to do, so let's start from a fresh and shiny
release number.
2020-07-16 00:48:32 +02:00
Gustavo Iñiguez Goia
a5994b0c4f stop receiving notifications properly
Under certain circunstances, the notifications goroutine entered into an
infinite loop.
2020-07-06 18:49:58 +02:00
Gustavo Iñiguez Goia
3853d412b4 audit: better rules deletion
if the daemon does not exit cleanly, the rules were not cleaned
correctly.
2020-07-03 08:28:33 +02:00
Gustavo Iñiguez Goia
97139ecc6b UI: shorten default rules name
Default rules name can be extremely long when the rule is of type list.
It still will be in some cases, but should work in most cases.

closes #37
2020-06-26 22:47:44 +02:00
Gustavo Iñiguez Goia
8494bfd982 UI: changed preferences dialog title 2020-06-26 21:53:17 +02:00
Gustavo Iñiguez Goia
7c5e324bc9 UI: force to bring the allow/deny pop-up to the front
This solves an issue where the pop-up was only displayed on the same
screen/desktop/workspace where the main window was.
2020-06-25 22:38:09 +02:00
Gustavo Iñiguez Goia
0d80af45c2 UI: force to bring the allow/deny pop-up to the front
This solves an issue where the pop-up was only displayed on the same
screen/desktop/workspace where the main window was.
2020-06-25 18:52:29 +02:00
Gustavo Iñiguez Goia
714aa311a0 Bump version to v1.0.0rc11 2020-06-24 00:41:36 +02:00
Gustavo Iñiguez Goia
4a99548ef3 Merge branch 'ui2.0' into main 2020-06-23 02:20:44 +02:00
Gustavo Iñiguez Goia
de00e89302 UI: set pop-up action buttons focus
Set the focus of the action buttons deny/allow, based on the configured
action.
2020-06-23 02:09:35 +02:00
Gustavo Iñiguez Goia
db02c4a394 UI: improved general tab fields filtering 2020-06-23 02:04:25 +02:00
Gustavo Iñiguez Goia
0af606d348 UI: fixed columns sorting after restoring settings
When restoring columns size state, the clicked events of the headers
(qtableview) were being fired, so the sort order was being not
respected.

Ensure also that changes to the general tab only affects to that tab.
2020-06-23 00:48:48 +02:00
Gustavo Iñiguez Goia
fe639887f0 UI: save settings on hiding stats window
Since we show and hide the stats window just by clicking on the systray
icon, the window is not closed, or at least the closEvent() is not being
fired, so the settings were not being saved.
2020-06-22 17:03:08 +02:00
Gustavo Iñiguez Goia
2522b8ef02 fixed CWD parsing when using audit proc monitor method 2020-06-22 14:26:07 +02:00
Gustavo Iñiguez Goia
8a2fe51abe Merge branch 'ui2.0' into main 2020-06-21 00:47:08 +02:00
Gustavo Iñiguez Goia
3011d9fd53 UI: show/hide stats window by clicking on the systray icon
closes #39
2020-06-21 00:40:01 +02:00
Gustavo Iñiguez Goia
73eb5b65eb UI: display process path if it's hidden
If a process path does not appear in the app name or the process
cmdline, display it on the pop-up dialog.
2020-06-21 00:14:20 +02:00
Gustavo Iñiguez Goia
6d24c5464c fixed race conditions when manipulating rules 2020-06-20 18:58:59 +02:00
Gustavo Iñiguez Goia
43f2a56196
Update LICENSE 2020-06-20 17:48:59 +02:00
Gustavo Iñiguez Goia
dda720576b
Update README.md 2020-06-20 17:39:07 +02:00
Gustavo Iñiguez Goia
0c640806f9 UI: added CWD field.
Added Current Working Directory of a process.
2020-06-19 18:26:03 +02:00