evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.91k stars 509 forks source link

Multiple conditions rules #151

Closed tetraf closed 6 years ago

tetraf commented 6 years ago

I would like to specifically allow thunderbird to connect to port 143 on a specific host.

As of now I can allow:

evilsocket commented 6 years ago

duplicate of #117

jkozera commented 5 years ago

@tetraf It's not custom JavasSript as per #117 but I needed something similar. So at my fork with https://github.com/jkozera/opensnitch/commit/25e85b05b782ff44de2b4a86d29e8e0d894be98e it is now possible to do what you've asked for, although only by editing .json rule files manually, for instance:

  "operator": {
    "type": "list",
    "operand": "list",
    "list": [
      {
        "type": "regexp",
        "operand": "dest.port",
        "data": "143"
      },
      {
        "type": "simple",
        "operand": "dest.host",
        "data": "somehost"
      },
      {
        "type": "simple",
        "operand": "process.path",
        "data": "path_to_thunderbird"
      }
    ]
  }

(Also note the fork adds support for catching UDP broadcasts with https://github.com/jkozera/opensnitch/commit/78b16fc11c006df4710e5ec6109a0b946a129aa8)