mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
fw rules: beautify rules escription
make it more nftables style: ip daddr 127.0.0.1 tcp dport 53 accept instead of: ip daddr == 127.0.0.1 tcp dport == 53 accept It'll be easier to translate our rules to nftables rules in this way.
This commit is contained in:
parent
9bad34bb16
commit
77c3cf4512
1 changed files with 10 additions and 1 deletions
|
@ -2,6 +2,7 @@ from PyQt5.QtCore import QObject, pyqtSignal
|
|||
from PyQt5.QtCore import QCoreApplication as QC
|
||||
import uuid
|
||||
from opensnitch import ui_pb2
|
||||
from .enums import *
|
||||
|
||||
class Rules(QObject):
|
||||
rulesUpdated = pyqtSignal()
|
||||
|
@ -276,7 +277,15 @@ class Rules(QObject):
|
|||
for e in rule.Expressions:
|
||||
exprs += "{0} {1}".format(
|
||||
e.Statement.Name,
|
||||
"".join(["{0} {1} {2} ".format(h.Key, e.Statement.Op, h.Value) for h in e.Statement.Values ])
|
||||
"".join(
|
||||
[
|
||||
"{0} {1}{2} ".format(
|
||||
h.Key,
|
||||
e.Statement.Op + " " if e.Statement.Op != Operator.EQUAL.value else "",
|
||||
h.Value
|
||||
) for h in e.Statement.Values
|
||||
]
|
||||
)
|
||||
)
|
||||
cols.append(exprs)
|
||||
cols.append(rule.Target)
|
||||
|
|
Loading…
Add table
Reference in a new issue