Due to how QsqlDatabase works from different threads, a connection to
the DB can only be used from the thread that created it.
In order to access a database from different threads you create a new
QsqlDatabase connection to the DB specifying the DB name/file.
With DBs written to the disk, the database file/name is always the
same (say /tmp/file.db).
But with in-memory databases, whenever you create a new connection with
:memory:, it always create a new in-memory DB, so the DB is empty for
the Cleaner() task, and that's why it was not deleting old events.
Closes#844
Added option to create rules from events, filling up the fields of the
new rule with the properties of a connection.
By default the rules' fields are not enabled.
Closes: #843
When using proc monitor method + interceptUnknown, allow to ask the user
about connections not associated with a process. Usually they're safe to
discard, but on some special cases it helps not disrupt some services.
Block of code to find connections via netstat moved to procmon/
Added more options for auto excluding/deleting temporary rules.
If the GUI was configured to store events to disk, you could end up
having thousands of temporary rules over time.
Closes: #622
Added ability to perform actions on different parts of the GUI, based on
conditions defined in json files.
There's only one Action of type Highlight for now, to colorize cells and
rows.
There're 3 Highlight actions defined by default:
- rules: applied to the rules view to colorize the columns Enabled and
Action.
- firewall: applied to the fw rules to colorize the columns Action and
Enabled.
- common: applied to the rest of the views to colorize the column
Action.
Users can add new actions to the directory
~/.config/opensnitch/actions/, as .json files. The format is defined
below.
Example of a Highlight action to colorize cells and rows, based on
different texts (simple texts/strings for now):
{
"name": "commonDelegateConfig",
"actions": {
"highlight": {
"cells": [
{
"text": ["allow", "✓ online"],
"cols": [1, 2, 3],
"color": "green",
"bgcolor": "",
"alignment": ["center"]
}
],
"rows": [
{
"text": ["block-domains"],
"cols": [8],
"color": "white",
"bgcolor": "darkMagenta",
"alignment": []
}
]
}
}
Closes: #555