Commit graph

900 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
81a66805a5
Merge pull request #315 from themighty1/unminimize
Unminimize maximized windows properly.
2020-12-23 22:58:20 +01:00
themighty1
8a2c645ad5 Unminimize maximized windows properly. 2020-12-23 22:55:19 +03:00
Gustavo Iñiguez Goia
efcc944631
Merge pull request #314 from luzpaz/typos
Fix random typos
2020-12-23 20:25:41 +01:00
luz paz
d15d3465a9 Fix random typos
Found via `codespell v2.1.dev0`  
`codespell -q 3 -L ans`
2020-12-23 13:24:59 -05:00
Gustavo Iñiguez Goia
e95f448c44 fixed rules panels position
closes #312
2020-12-23 16:55:13 +01:00
Gustavo Iñiguez Goia
85fc5396bf updated grpc protocol files 2020-12-22 22:14:53 +01:00
Gustavo Iñiguez Goia
1384db6a1b fw: clean system rules before insert new ones
If the daemon exits unexpectedly, fw rules are not deleted.
So on every start/reload, clean any possible rule before adding new
ones.
2020-12-22 22:06:37 +01:00
Gustavo Iñiguez Goia
b1bf8e4143
Merge pull request #313 from themighty1/unixnano_fix
Use daemon's event timestamp in UI.
2020-12-22 21:58:58 +01:00
themighty1
3abb3e4c0d Use daemon's event timestamp in UI.
Use the timestamp instead of the event object when iterating over the last events. ~15x speed increase.
Increase event buffer to 100. On my machine I routinely hit the ceiling of 50 events under some multitasking workloads. Small buffer results in connection attempts not being logged.
Fix Makefile to rebuild when ui.proto changes
2020-12-22 22:50:18 +03:00
Gustavo Iñiguez Goia
003a668da7 ui, stats: improved start/stop interception button 2020-12-21 21:42:44 +01:00
Gustavo Iñiguez Goia
f7fd6fdd7b ui: set window icon
closes #302
2020-12-21 12:29:35 +01:00
Gustavo Iñiguez Goia
57b20cdfbd ui: added rules left pane to organize rules
An easy way to filter rules. It allows to filter rules by:
 - Duration
 - Nodes
2020-12-20 23:36:15 +01:00
Gustavo Iñiguez Goia
9b035ca66e added unit tests for process parsing and rules 2020-12-19 19:31:09 +01:00
Gustavo Iñiguez Goia
daa0037335
Merge pull request #306 from themighty1/master
Add a custom view/model to display the connections list more effi…
2020-12-18 21:42:41 +01:00
Gustavo Iñiguez Goia
5622f7a051
Merge pull request #308 from themighty1/nofocus
Disable always-on focus on cmdCleanSql button.
2020-12-18 21:18:34 +01:00
themighty1
667bfc2520 Disable always-on focus on cmdCleanSql button.
Right now because this button always has a focus if the user accidentally presses Enter even while typing in the Filter field, all db will be cleaned.
2020-12-18 23:06:15 +03:00
themighty1
a77c3398e8 Disable always-on focus on cmdCleanSql button.
Right now because this button always has a focus if the user accidentally presses Enter even while typing in the Filter field, all db will be cleaned.
2020-12-18 23:00:19 +03:00
Gustavo Iñiguez Goia
e59133beb2 rules: skip checking not enabled rules 2020-12-18 16:42:34 +01:00
themighty1
59216458af Add a custom view/model to display the connections list more efficiently than currently with QSqlQueryModel.
The major steps are:

    - take advantage of sqlite's default autoincremented rowid column
    - add index of the db columns
    - when a filter is applied, we build a map of rowids corresponding to the filter
    - when user scrolls the view, query the db only for that portion of db which contains the rows to be displayed
    - because sqlite cannot use an index when a wildcard is at the start of the LIKE expression, e.g. "process LIKE '%sbin%'", use a workaround:
      - keep track of all distinct values in each column
      - check in python if any of the distinct values contain the filter string
      - reconstruct the query string: instead of "process LIKE '%sbin%'" we use "process IN (<list of distinct values containing 'sbin'>)"

    Minor steps:
    - mimic some QSqlQueryModel's methods so that our model can be a drop-in replacement
    - disable view's default scrollbar and use our own scrollbar which is aware of how many rows are in the db
2020-12-18 16:14:27 +03:00
Gustavo Iñiguez Goia
438ceca57d Bump version to 1.3.0 2020-12-16 18:59:03 +01:00
Gustavo Iñiguez Goia
2f2363785e updated pkgs url paths 2020-12-16 18:14:37 +01:00
Gustavo Iñiguez Goia
ce3db74e2f removed server api/lib
A common api/lib that other tools can use in order to commnicate with
nodes: a GUI, a TUI, a proxy that sends stats to a remote DB, etc...

In future versions we may add it back.
2020-12-16 18:08:00 +01:00
Gustavo Iñiguez Goia
4443673ed1 fixed how we check rules
- Rules are checked in alphabetical order.
- Deny and Priority rules must take precedence.
- If a rule matches and it's Allow-NoPriority, then return the rule.
- Otherwise we'll return nil.
2020-12-15 16:09:28 +01:00
Gustavo Iñiguez Goia
b6cbc6769e fixed rules Enabled check 2020-12-13 11:50:58 +01:00
Gustavo Iñiguez Goia
db31e5b71a fw: fixed 100% CPU spike, fixed cleaning rules
- Fixed 100% CPU spike when pausing interception from the GUI
gustavo-iniguez-goya/opensnitch/issues/104
- Fixed monitoring fw rules after re-enabling interception.
- Fixed cleaning up interception and system rules.
2020-12-12 18:16:59 +01:00
Gustavo Iñiguez Goia
f751dc13c6 removed sudo from Makefiles
Documentation must be updated to indicate when to use sudo.

closes #291
2020-12-11 23:42:47 +01:00
Gustavo Iñiguez Goia
719c906267 fixed regexp rules when using case-sensitive strings 2020-12-11 22:03:00 +01:00
Gustavo Iñiguez Goia
f3d5292ccc ui, prefs: allow to configure if show popups or not 2020-12-11 13:44:46 +01:00
Gustavo Iñiguez Goia
d47e75d76f fixed filtering by dst network, fixed regression
- Fixed complex rules.
- Fixed filtering by destination network.
2020-12-10 23:09:24 +01:00
Gustavo Iñiguez Goia
d22ae3a6a0 ui, pop-ups: fixed network rule type, fixed typo, ..
- Fixed network rules types.
- Fixed typo when resetting expanded view.
- Limit rule name length. It was causing errors saving the file to disk
  it it was too long.
2020-12-10 22:28:21 +01:00
Gustavo Iñiguez Goia
e13015ce67 updated import paths 2020-12-09 18:18:42 +01:00
Gustavo Iñiguez Goia
6c32461392 Updated README 2020-12-09 16:35:27 +01:00
Gustavo Iñiguez Goia
3a3d3d8f42 Merge opensnitch 1.3.0-rc2 2020-12-09 15:41:18 +01:00
Gustavo Iñiguez Goia
66c356508c ui, prefs: added checkbox to disable connections pop-ups
Instead of setting manually the default timeout to 0, use a checkbox to do
the same.
2020-12-08 00:46:52 +01:00
Gustavo Iñiguez Goia
f5e3494d12 ui,stats: added icons to the tabs and restyling 2020-12-07 21:56:17 +01:00
Gustavo Iñiguez Goia
aed5c861ac ui, popups: allow to filter by networks, bug fixes
- Allow to filter connections by destination network. closes #89

- Do not send a rule if the operator data is empty.
- Fixed displaying the path of a process, if it's not in the command
  line, e.g.:
  binary: /usr/bin/curl
  cmdline: curl -L github.com
2020-12-07 13:22:56 +01:00
Gustavo Iñiguez Goia
ac9fc47d9a auditd: don't parse proctitle field, use cmdline instead
auditd proctitle field sems to be trunctated to 128 characters, which
causes in some situations to not obtain the complete command line.
2020-12-07 13:01:10 +01:00
Gustavo Iñiguez Goia
2878721189 ui, rpm: added python3-protobuf as weak dependency
We're incompatible for some reason with the package python3-grpcio
distributed by many distros, but python3-protobuf works fine.
2020-12-04 01:35:02 +01:00
Gustavo Iñiguez Goia
1f415a5799 added option to filter by destination network
Now you can filter by destination network, for example:
- 127.0.0.1/8
- 192.168.1.0/24

This will ease to solve the request #89 .

Some common network ranges have also been added so you can select them
from a combo box. More info #73.

Added process.id operator operand for future use, in order to filter by
PID.
2020-12-04 01:11:47 +01:00
Gustavo Iñiguez Goia
ad2927d75d ui,rpm: added slugify dependency for SuSe systems 2020-12-03 21:27:38 +01:00
Gustavo Iñiguez Goia
a7babc7b63 ui,rpm: add python3-slugify as weak dependency
python3-slugify is not available in all rpm based distributions.

Adding it as weak dependency will install it if the package is
available, thus avoiding to install it using pip.
2020-12-03 00:46:43 +01:00
Gustavo Iñiguez Goia
6619124db7 Bumped versions to 1.3.0rc2 2020-11-28 12:26:39 +01:00
Gustavo Iñiguez Goia
3c06fbf8d3 ui: added .spec file for create UI rpms 2020-11-28 12:20:46 +01:00
Gustavo Iñiguez Goia
c25f49d8a7 ui: fixed launching the UI on more environments
Better resolve where the UI python package is.

related #59
2020-11-28 11:02:03 +01:00
Gustavo Iñiguez Goia
f9d9af9a5f ui: replaced deprecated tostring() by tobytes()
> Deprecated since version 3.2, will be removed in version 3.9.

And they did!

https://docs.python.org/3.9/library/array.html#array.array.tobytes
2020-11-28 01:41:46 +01:00
Gustavo Iñiguez Goia
df952d974e fixed errors when IPv6 is not enabled in the system
If IPv6 was not enabled we failed to add IPv6 rules.

closes #96
2020-11-26 16:25:48 +01:00
Gustavo Iñiguez Goia
0b85f6be10 ui, pop-ups: improved connections visualizing
The path and arguments of a process were not displayed correctly.
closes #93

On the other hand, the combo box option (allow/deny) "from this process"
was misleading. Changed by "from this executable". #94
2020-11-24 17:46:12 +01:00
Gustavo Iñiguez Goia
e8683e77be improved packets parsing
We were checking several times if a packet was IPv6.

Additionally we were itereating over all the layers of the packet, when
in reality we're only interested in network layer and transport layer.

This change brings down packets parsing from ~200µs to ~2µs.
2020-11-24 01:35:36 +01:00
Gustavo Iñiguez Goia
99afc6cccb audit: stop reading messages when calling Stop() 2020-11-22 13:31:10 +01:00
Gustavo Iñiguez Goia
26ca52d127 audit: schedule deletion of old events
Instead of check for old events every time we add a new one, do it every
5 minutes.

This improves the performance significantly.
2020-11-22 01:00:43 +01:00