Merge branch 'priority-rules' into main
Added option to let the users define iptables rules.
The system rules are added in the file /etc/opensnitchd/system-fw.json
with this format:
```
{
"SystemRules": [
{
"Rule": {
"Description": "Allow pptp VPN",
"Table": "mangle",
"Chain": "OUTPUT",
"Parameters": "-p gre",
"Target": "ACCEPT",
"TargetParameters": ""
}
}
]
}
```
On the mangle table, OUTPUT chain, these rules are added before
the NFQUEUE interception rule, so any rule you add there bypasses the
interception. Useful to allow traffic you don't want to intercept.
This feature solves in some way the issue some users have connecting to
VPNs when the Default Action configured in the daemon is Deny.
For example:
- OpenVPN when keepalive is configured and ICMP is used.
- PPTP because the GRE routing protocol is blocked.
- probably others like IPSEC.
(regarding WireGuard, as far as I can tell it works just fine, see #61).
closes #47
2020-11-13 00:14:39 +01:00
|
|
|
{
|
2022-05-03 22:05:12 +02:00
|
|
|
"Enabled": true,
|
|
|
|
"Version": 1,
|
|
|
|
"SystemRules": [
|
|
|
|
{
|
|
|
|
"Rule": {
|
|
|
|
"Table": "mangle",
|
|
|
|
"Chain": "OUTPUT",
|
|
|
|
"Enabled": false,
|
|
|
|
"Position": "0",
|
|
|
|
"Description": "Allow icmp",
|
|
|
|
"Parameters": "-p icmp",
|
|
|
|
"Expressions": [],
|
|
|
|
"Target": "ACCEPT",
|
|
|
|
"TargetParameters": ""
|
|
|
|
},
|
|
|
|
"Chains": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Chains": [
|
|
|
|
{
|
|
|
|
"Name": "forward",
|
|
|
|
"Table": "filter",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "filter",
|
|
|
|
"Hook": "forward",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "output",
|
|
|
|
"Table": "filter",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "filter",
|
|
|
|
"Hook": "output",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "input",
|
|
|
|
"Table": "filter",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "filter",
|
|
|
|
"Hook": "input",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": [
|
|
|
|
{
|
|
|
|
"Enabled": false,
|
|
|
|
"Position": "0",
|
|
|
|
"Description": "Allow SSH server connections when input policy is DROP",
|
|
|
|
"Parameters": "",
|
|
|
|
"Expressions": [
|
|
|
|
{
|
|
|
|
"Statement": {
|
|
|
|
"Op": "",
|
|
|
|
"Name": "tcp",
|
|
|
|
"Values": [
|
|
|
|
{
|
|
|
|
"Key": "dport",
|
|
|
|
"Value": "22"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Target": "accept",
|
|
|
|
"TargetParameters": ""
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "filter-prerouting",
|
|
|
|
"Table": "nat",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "filter",
|
|
|
|
"Hook": "prerouting",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "prerouting",
|
|
|
|
"Table": "mangle",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "mangle",
|
|
|
|
"Hook": "prerouting",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "postrouting",
|
|
|
|
"Table": "mangle",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "mangle",
|
|
|
|
"Hook": "postrouting",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "prerouting",
|
|
|
|
"Table": "nat",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "natdest",
|
|
|
|
"Hook": "prerouting",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "postrouting",
|
|
|
|
"Table": "nat",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "natsource",
|
|
|
|
"Hook": "postrouting",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "input",
|
|
|
|
"Table": "nat",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "natsource",
|
|
|
|
"Hook": "input",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "output",
|
|
|
|
"Table": "nat",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "natdest",
|
|
|
|
"Hook": "output",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "output",
|
|
|
|
"Table": "mangle",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "mangle",
|
|
|
|
"Hook": "output",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": [
|
|
|
|
{
|
|
|
|
"Enabled": true,
|
|
|
|
"Position": "0",
|
|
|
|
"Description": "Allow ICMP",
|
|
|
|
"Expressions": [
|
|
|
|
{
|
|
|
|
"Statement": {
|
|
|
|
"Op": "",
|
|
|
|
"Name": "icmp",
|
|
|
|
"Values": [
|
|
|
|
{
|
2022-07-02 18:02:27 +02:00
|
|
|
"Key": "type",
|
|
|
|
"Value": "echo-request"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Key": "type",
|
|
|
|
"Value": "echo-reply"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Target": "accept",
|
|
|
|
"TargetParameters": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Enabled": true,
|
|
|
|
"Position": 0,
|
|
|
|
"Description": "Allow ICMPv6",
|
|
|
|
"Expressions": [
|
|
|
|
{
|
|
|
|
"Statement": {
|
|
|
|
"Op": "",
|
|
|
|
"Name": "icmpv6",
|
|
|
|
"Values": [
|
|
|
|
{
|
2022-05-03 22:05:12 +02:00
|
|
|
"Key": "type",
|
|
|
|
"Value": "echo-request"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Key": "type",
|
|
|
|
"Value": "echo-reply"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Target": "accept",
|
|
|
|
"TargetParameters": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Enabled": false,
|
|
|
|
"Position": "0",
|
|
|
|
"Description": "Exclude WireGuard VPN from being intercepted",
|
|
|
|
"Parameters": "",
|
|
|
|
"Expressions": [
|
|
|
|
{
|
|
|
|
"Statement": {
|
|
|
|
"Op": "",
|
|
|
|
"Name": "tcp",
|
|
|
|
"Values": [
|
|
|
|
{
|
|
|
|
"Key": "dport",
|
|
|
|
"Value": "51820"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Target": "accept",
|
|
|
|
"TargetParameters": ""
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Name": "forward",
|
|
|
|
"Table": "mangle",
|
|
|
|
"Family": "inet",
|
|
|
|
"Priority": "",
|
|
|
|
"Type": "mangle",
|
|
|
|
"Hook": "forward",
|
|
|
|
"Policy": "accept",
|
|
|
|
"Rules": [
|
|
|
|
{
|
|
|
|
"UUID": "7d7394e1-100d-4b87-a90a-cd68c46edb0b",
|
|
|
|
"Enabled": false,
|
|
|
|
"Position": "0",
|
|
|
|
"Description": "Intercept forwarded connections (docker, etc)",
|
|
|
|
"Expressions": [
|
|
|
|
{
|
|
|
|
"Statement": {
|
|
|
|
"Op": "",
|
|
|
|
"Name": "ct",
|
|
|
|
"Values": [
|
|
|
|
{
|
|
|
|
"Key": "state",
|
|
|
|
"Value": "new"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Target": "queue",
|
|
|
|
"TargetParameters": "num 0"
|
Merge branch 'priority-rules' into main
Added option to let the users define iptables rules.
The system rules are added in the file /etc/opensnitchd/system-fw.json
with this format:
```
{
"SystemRules": [
{
"Rule": {
"Description": "Allow pptp VPN",
"Table": "mangle",
"Chain": "OUTPUT",
"Parameters": "-p gre",
"Target": "ACCEPT",
"TargetParameters": ""
}
}
]
}
```
On the mangle table, OUTPUT chain, these rules are added before
the NFQUEUE interception rule, so any rule you add there bypasses the
interception. Useful to allow traffic you don't want to intercept.
This feature solves in some way the issue some users have connecting to
VPNs when the Default Action configured in the daemon is Deny.
For example:
- OpenVPN when keepalive is configured and ICMP is used.
- PPTP because the GRE routing protocol is blocked.
- probably others like IPSEC.
(regarding WireGuard, as far as I can tell it works just fine, see #61).
closes #47
2020-11-13 00:14:39 +01:00
|
|
|
}
|
2022-05-03 22:05:12 +02:00
|
|
|
]
|
Merge branch 'priority-rules' into main
Added option to let the users define iptables rules.
The system rules are added in the file /etc/opensnitchd/system-fw.json
with this format:
```
{
"SystemRules": [
{
"Rule": {
"Description": "Allow pptp VPN",
"Table": "mangle",
"Chain": "OUTPUT",
"Parameters": "-p gre",
"Target": "ACCEPT",
"TargetParameters": ""
}
}
]
}
```
On the mangle table, OUTPUT chain, these rules are added before
the NFQUEUE interception rule, so any rule you add there bypasses the
interception. Useful to allow traffic you don't want to intercept.
This feature solves in some way the issue some users have connecting to
VPNs when the Default Action configured in the daemon is Deny.
For example:
- OpenVPN when keepalive is configured and ICMP is used.
- PPTP because the GRE routing protocol is blocked.
- probably others like IPSEC.
(regarding WireGuard, as far as I can tell it works just fine, see #61).
closes #47
2020-11-13 00:14:39 +01:00
|
|
|
}
|
2022-05-03 22:05:12 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
Merge branch 'priority-rules' into main
Added option to let the users define iptables rules.
The system rules are added in the file /etc/opensnitchd/system-fw.json
with this format:
```
{
"SystemRules": [
{
"Rule": {
"Description": "Allow pptp VPN",
"Table": "mangle",
"Chain": "OUTPUT",
"Parameters": "-p gre",
"Target": "ACCEPT",
"TargetParameters": ""
}
}
]
}
```
On the mangle table, OUTPUT chain, these rules are added before
the NFQUEUE interception rule, so any rule you add there bypasses the
interception. Useful to allow traffic you don't want to intercept.
This feature solves in some way the issue some users have connecting to
VPNs when the Default Action configured in the daemon is Deny.
For example:
- OpenVPN when keepalive is configured and ICMP is used.
- PPTP because the GRE routing protocol is blocked.
- probably others like IPSEC.
(regarding WireGuard, as far as I can tell it works just fine, see #61).
closes #47
2020-11-13 00:14:39 +01:00
|
|
|
}
|