Commit graph

582 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
d8b2f41e08 Apply default action if a rule is disabled. 2020-05-10 17:08:08 +02:00
Gustavo Iñiguez Goia
1d1d9f4456 Bump version to v1.0.0rc8 2020-04-29 22:02:30 +02:00
Gustavo Iñiguez Goia
1e5fce8c01 Merge branch 'ui2.0' into main 2020-04-27 22:55:30 +02:00
Gustavo Iñiguez Goia
f1fd7a04eb UI: improved details views, added PID field
- Added PID field to the details views.
- Improved details queries, grouping more fields.
- Some fields reorganized.
2020-04-27 21:37:40 +02:00
Gustavo Iñiguez Goia
1ddd2510aa Merge branch 'ui2.0' into main 2020-04-26 20:09:34 +02:00
Gustavo Iñiguez Goia
039a393ab1 UI: fixed race condition, improved UI performance
- Fixed race condition when adding stats to the db, specially when there
  were several nodes connected.
- Colorized allow/deny and online/offline words, to improve visual
  experience.
- UI performance has been improved, specially when there're multiple
  nodes sendings stats.
2020-04-26 19:54:52 +02:00
Gustavo Iñiguez Goia
dac78eb883 UI: improve db thread locking 2020-04-26 19:39:18 +02:00
Gustavo Iñiguez Goia
7ef2c1a755 UI: add nodes view
Display the list of nodes with its metadata.
Clicking on the IP of a node displays the stats for that node.

BUG: The original behaviour was to open a new window per node. However,
right now only one gets updated, and the others have no data.
So for now, this feature has been disabled.

Besides, if there's more than one node, only the stats of a node is
displayed on the UI, so you will see a weird blinking.
2020-04-24 02:05:31 +02:00
Gustavo Iñiguez Goia
66bc1b10e4 UI: remove unused imports and instances 2020-04-24 01:14:03 +02:00
Gustavo Iñiguez Goia
cf6d923670 UI: fixed displaying remote statistics 2020-04-20 18:19:49 +02:00
Gustavo Iñiguez Goia
2cd18f3bcb UI: add missing config fields if the don't exist
If we've added in a new release new config fields, old clients may not
have them, so we add them.

We need a better way of handling upgrades.
2020-04-20 18:04:21 +02:00
Gustavo Iñiguez Goia
c444d5f8a1 UI: fixed default duration on prompt dialog 2020-04-20 17:47:25 +02:00
Gustavo Iñiguez Goia
83ffaaad44 decrease log level of denied connections
Denied connections were logged with Warning level.
However if you had a rule that denied a particular noisy connection, it
generated too much logs that didn't add value.

In the future it would be nice to log as warning, denied connections
that do not have a rule created by a user.

Discussion: https://github.com/gustavo-iniguez-goya/opensnitch/issues/10#issuecomment-615854975
2020-04-20 01:00:16 +02:00
Gustavo Iñiguez Goia
bf7449f303 Merge branch 'ui2.0': allow to configure options from the UI 2020-04-19 20:54:34 +02:00
Gustavo Iñiguez Goia
3b842a154e UI: allow to change daemon and UI options from the UI 2020-04-19 20:52:57 +02:00
Gustavo Iñiguez Goia
77dddcab3d UI: allow to resolve app icons from local and remote nodes
As opensnitch will run (only) on GNU/Linux, we may assume that the same
apps will exist on different machines (installed or not).

If a same app (firefox for example) is installed on different systems,
get the icon for the app.
2020-04-19 20:39:03 +02:00
Gustavo Iñiguez Goia
6ee80b1640 Allow to change settings from the UI
(1/2)
We start receiving notifications from the UI, which allow us to change
configurations and perform actions on the daemon.

The concept of Node has also been introduced, which identifies every
daemon (client) connected to the UI (server).

These options has been added:
- Enable/Disable firewall interception (for all nodes)
- Change daemons (clients) configuration. globally or per node.
- Change prompt dialog options.

We have fixed some bugs along the way:
- Close audit client connection gracefully.
- Exclude our own connections from being intercepted.
- Better handling of client connection status with the UI.

We probably has also introduced some other bugs (not listed here).
2020-04-19 20:13:31 +02:00
Gustavo Iñiguez Goia
09121ba74b Bump rpm package version to v1.0.0rc7 2020-04-13 01:16:01 +02:00
Gustavo Iñiguez Goia
32e527e503 Bump version to v1.0.0rc7 2020-04-13 00:23:38 +02:00
Gustavo Iñiguez Goia
a70b48c5b7 Merge branch 'ui2.0' 2020-04-12 22:14:00 +02:00
Gustavo Iñiguez Goia
00bfd58510 UI: added filter by command line/args
In the future we'll filter by part of the command line.
2020-04-12 22:10:59 +02:00
Gustavo Iñiguez Goia
d6af47813e netlink: exclude connections with invalid inode 2020-04-12 12:33:59 +02:00
Gustavo Iñiguez Goia
c51d9542ae audit: avoid to overwrite cmdline of new events
when an audit msg of type !SYSCALL is added, the cmdline field may be
empty, and thus cause to loose the original proc cmdline.
2020-04-12 12:31:59 +02:00
Gustavo Iñiguez Goia
99ad5e531f fixed getting process uid under certain situations 2020-04-12 01:38:39 +02:00
Gustavo Iñiguez Goia
b9af7c2837 fixed compiling for arm and i386 2020-04-11 00:23:27 +02:00
Gustavo Iñiguez Goia
60005d7497 UI: added help menu
Added help menu to load the wiki.
2020-04-10 13:15:11 +02:00
Gustavo Iñiguez Goia
1e11e52457 deb UI packages improved
- kill UI on uninstall.
- update system icon cache after installing.
2020-04-09 18:51:17 +02:00
Gustavo Iñiguez Goia
ab1513334b Merge branch 'ui2.0' into main: fixed UI icons 2020-04-09 18:48:40 +02:00
Gustavo Iñiguez Goia
7c647f5782 fixed UI icons
- display correctly the connection status with the daemon whe it's
  disconnected.
- display correctly the icon (at least on gnome).
- changed "active" icon to svg, to fix a size problem displaying
  notifications on gnome.
2020-04-09 18:45:05 +02:00
Gustavo Iñiguez Goia
9d139a3f51 fixed not answered dialog alert icon
On gnome-shell,ubuntu 18.04 by using the Warning icon, it substituted
our icon by another one. So use NoIcon, since we're already setting our
own alert icon.
2020-04-09 17:07:58 +02:00
Gustavo Iñiguez Goia
24ede1c92b netlink: get active connections by source port + protocol
- Dump connections from kernel querying by source port + protocol.
- Prioritize responses which match the outgoing connection.
- If we don't get any response, apply the default action configured in
/etc/opensnitchd/default-config.json

--

A connection can be considered unique if:
protocol + source port + source ip + destination ip + destination port

We can be quite sure that only one process has created the connection.

However, many times, querying the kernel for the connection details by
all these parameters results in no response.

A regular query and normal response would be:
query: TCP:47344:192.168.1.106 -> 151.101.65.140:443
response: 47344:192.168.1.106 -> 151.101.65.140:443, inode: 1234567, ...

But in another cases, the details of the outgoing connection differs
from the kernel response, or it even doesn't exist.

However, if we query by protocol+source port, we can get more entries, and
somewhat guess what program opened the outgoing connection.

Some examples of querying by outgoing connection and response from
kernel:

query: 8612:192.168.1.5 -> 192.168.1.255:8612
response: 8612:192.168.1.105 -> 0.0.0.0:0

query: 123:192.168.1.5  -> 217.144.138.234:123
response: 123:0.0.0.0 -> 0.0.0.0:0

query: 45015:127.0.0.1 -> 239.255.255.250:1900
response: 45015:127.0.0.1 -> 0.0.0.0:0

query: 50416:fe80::9fc2:ddcf:df22:aa50 -> fe80::1:53
response: 50416:254.128.0.0 -> 254.128.0.0:53

query: 51413:192.168.1.106 -> 103.224.182.250:1337
response: 51413:0.0.0.0 -> 0.0.0.0:0
2020-04-05 19:14:51 +02:00
Gustavo Iñiguez Goia
315cf9e628 Merge branch 'main' of github.com:gustavo-iniguez-goya/opensnitch into main 2020-04-05 19:07:45 +02:00
Gustavo Iñiguez Goia
bf90229a1f procmon cache: removed redundant inodes cache deletion 2020-04-05 18:49:26 +02:00
Gustavo Iñiguez Goia
14d487ebee
Merge pull request #12 from deathtrip/patch-2
opensnitchd.service: update upstream url in
2020-04-05 13:06:02 +02:00
deathtrip
b359bfd754
update upstream url 2020-04-05 11:35:30 +02:00
Gustavo Iñiguez Goia
528ce81c04 exclude localhost resolved dns from being cached
it led to resolve some domains to 127.0.0.1 and show the user a
dialog with that misleading domain.
2020-04-04 10:53:30 +02:00
Gustavo Iñiguez Goia
bfee1f014b Revert "search for the PID in the inodes cache before discard it"
This reverts commit 4466d1dfbc.

This change was not intended for this branch.
2020-04-03 11:56:45 +02:00
Gustavo Iñiguez Goia
4466d1dfbc search for the PID in the inodes cache before discard it
Even if we don't have the inode, the connection might be cached.
2020-04-03 00:43:49 +02:00
Gustavo Iñiguez Goia
f7114d95c4 delete inodes cache when a process exits 2020-04-03 00:42:46 +02:00
Gustavo Iñiguez Goia
4a7607a323 removed useless debug log 2020-04-01 01:51:53 +02:00
Gustavo Iñiguez Goia
e85a41ca0f allow to configure process monitor method in daemon config
Added ProcMonitorMethod, which can be "proc", "ftrace" or "audit".

Parameters passed by command line take prevalence over default
configuration.

breaking changes: config options changed from xx_yy to XxYy.

Config example:
{
    "DefaultAction": "allow",
    "DefaultDuration": "once",
    "InterceptUnknown": true,
    "ProcMonitorMethod": "audit"
}
2020-03-16 01:37:33 +01:00
Gustavo Iñiguez Goia
bc4c7387a9 Added .spec file for build rpm packages
Only for the daemon for now.
2020-03-15 01:57:44 +01:00
Gustavo Iñiguez Goia
dbb86d7df8 avoid to crash if opensnitchd is already running 2020-03-13 12:47:04 +01:00
Gustavo Iñiguez Goia
2d5b89a0d4 UI: removed configparser dependency
It looks like it's part of python since 3.2, and as far as I can tell
without the pip dependency work just fine (tested on ubuntu >=14.x, mint
>= 18, debian >= 8.x).

It should also help packaging for ArchLinux #8.
2020-03-12 01:22:45 +01:00
Gustavo Iñiguez Goia
6c64438256 UI: removed configparser dependency
It looks like it's part of python since 3.2, and as far as I can tell
without the pip dependency work just fine (tested on ubuntu >=14.x, mint
>= 18, debian >= 8.x).
2020-03-12 01:18:26 +01:00
Gustavo Iñiguez Goia
0139e28c38 UI deb package: removed duplicated dependency.
protobuf is already installed by the grpcio-tools package.
2020-03-12 00:50:21 +01:00
Gustavo Iñiguez Goia
0c6836539e audit: code reformatted, ALL_CAPS to mixedCaps
Also do not filter sockets by code, nor by pid/ppid (for now at least).
2020-03-10 10:16:32 +01:00
Gustavo Iñiguez Goia
06d146b619 netstat/ sources commented and reformatted. 2020-03-09 20:08:14 +01:00
Gustavo Iñiguez Goia
eb52af72e5 audit: exclude events from our pid at rule level
Do not exclude them by code, just don't receive them.
2020-03-09 19:51:06 +01:00
Gustavo Iñiguez Goia
3c500a9314 Update issue templates 2020-03-09 19:32:21 +01:00