opensnitch
opensnitch copied to clipboard
[Feature Request] Apply rule if pattern does not match
I want to create a rule to block all but localhost connections. Rules editor tells me to use negated character classes:
[x] Action: deny
[x] To this destination IP: [^:127.0.0.1:]
AFAIK, there are no custom character classes in regex, and the above pattern is equivalent to [^0127.:], i.e. it's gonna match 172.21.0.17 and similar addresses besides 127.0.0.1.
Since negative lookarounds are not supported, can you please add an ability to invert a match (like grep -v)?
Maybe you could do it with two rules :
The first with a name like 000-allow-application_name wich allow connections to ^(127.0.0.1)$ and check the case Priority rule in the rules editor.
The second with a name like 111-deny-application_name wich deny all connections and check the case Priority rule in the rules editor.
Making an allow priority rule does work in this case.
Nonetheless, I'm leaving this feature request open, since an ability to invert a match is nice to have.