Commit graph

9 commits

Author SHA1 Message Date
workturnedplay
17428ae483
fix UI due to 000-allow-localhost6.json description
the description for this rule, in the UI, vertically centers the 3 lines(2 text and one empty newline in the middle) thus showing only a few pixels of the first and last lines' text as the description for this rule making you believe there's something wrong with the font rendering. Removing one `\n` allows the two text lines to remain visible enough to be readable.
2026-06-08 21:12:54 +02:00
Gustavo Iñiguez Goia
f2e2e52aef removed parameters from init services
The daemon no longer requires the parameter -rules-path.

The default path is /etc/opensnitchd/rules, and it's configurable from
the configuration.
2025-12-10 21:31:33 +01:00
Gustavo Iñiguez Goia
9891d106cc
init services moved to data/init/ 2025-11-24 00:07:07 +01:00
Gustavo Iñiguez Goia
2c142620c4
daemon default configuration files moved to data/ 2025-11-23 23:11:31 +01:00
Gustavo Iñiguez Goia
afa0500539
rules: updated default localhost rules
Restrict permissions to 127.0.0.1 and ::1 instead of the whole loopback
range.

This way, we allow localhost connections from common processes (dirmngr,
kdeinit5, xbrlapi, etc.), while giving users control to allow or deny
DNS queries to the local DNS stub resolver (which for example usually
listens on 127.0.0.53).

More info: #1416.
2025-09-12 11:19:12 +02:00
Gustavo Iñiguez Goia
66ee50bf7d
tasks: allow to load tasks from disk
Now it's possible to load tasks from disk.

There's a central file which contains the defined tasks:
/etc/opensnitchd/tasks/tasks.json

with this format:
{
    "tasks": [
        {
            "enabled": false,
            "name": "downloader",
            "configfile":
"/etc/opensnitchd/tasks/downloader/downloader.json",
        }
    ]
}

The field "name" defines the type of task to load, defined in each task.
It's static.

Whenever the tasks.json is modified, if the tasks are enabled, the task
configuration file defined in the "configfile" field will be loaded.

Configuration format of each task:

{
  "name": "downloader",
  "parent": "downloader",
  "data": {}
}

The field "name" is dynamic, unique, and identifies the instance of the
task. If there're two tasks configured with the same name, only one will
be loaded.
The "parent" field is used to know what's the base task. If it's not
specified, we'll try to use the "name" as the base task.

This allows you to run multiple instances of the same task with
different configurations: a downloader to update malware blocklists,
another to update IP blocklists, etc.

The "data" field depends of each task. It's generic, and each task is
responsible for defining it. For example for the Downloader task:

"data": {
    "interval": "1h",
    "timeout": "5s",
    "urls": [
        {
            "name": "adaway",
            "enabled": true,
            "remote": "https://adaway.o/hosts.txt",
            "localfile": "/tmp/blocklist/ads-adaway-hosts.txt"
        }
    ]
}

The tasks configuration file are also monitored for changes, and
whenever a change is detected the task is reloaded.

----

Notifications (WIP)

It's not yet fully defined and it'll change, but this is the state as
of today.

For real-time tasks, like pid-monitor, sockets monitor and node monitor,
the GUI initiates the task with a unique ID (a timestamp), to know who
is sending what, and display the data properly on the GUI.

For permanent tasks we use a unique ID defined for each task.

Right now, if we don't have the notifications channel opened and the
notification ID corresponds with one of the tasks, we'll post an alert
to the GUI, to display a desktop notification.

Each task can define if send notifications or not. For example:

{
  "name": "downloader",
  "data": {
      (...)
      "notify": {
          "enabled": true
      }
  }
}

then in each task, act accordingly to what is defined in the
configuration.
2025-09-11 12:19:38 +02:00
Gustavo Iñiguez Goia
d513c9312a
updated predefined rules description 2025-08-08 01:33:53 +02:00
Self Denial
056e2ec2ee
refactor: Update localhost rules and add IPv6
- Changed the local host rule from using regexp to network operator
- Updated destination IP check from specific addresses to CIDR notation (127.0.0.0/8)
- Added new rule for IPv6 localhost connections (::1/128)
- Added nolog property to prevent logging of localhost traffic
2025-04-23 12:48:28 -06:00
Gustavo Iñiguez Goia
8b4c8922c5
Added sample rule to allow localhost connections 2023-07-23 22:30:49 +02:00