Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
firewall
Commits
bdfab7f1
Commit
bdfab7f1
authored
Jan 04, 2021
by
Benjamin Graillot
Committed by
root
Jan 04, 2021
Browse files
Oopsie
parent
4324f30e
Changes
1
Hide whitespace changes
Inline
Side-by-side
firewall.py
View file @
bdfab7f1
...
...
@@ -119,11 +119,11 @@ if __name__ == "__main__":
opening
=
entry
[
'description'
][
0
].
decode
(
'utf-8'
).
strip
()
opening
=
opening
.
split
(
','
)
opening
=
[
tuple
(
open
.
split
(
':'
))
for
open
in
opening
]
if
subnet
in
config
[
'DEFAULT_SERVICES'
]:
opening
+=
tuple
(
config
[
'DEFAULT_SERVICES'
][
subnet
])
ip_addresses
=
[
ipaddress
.
ip_address
(
ip
.
decode
(
'utf-8'
))
for
ip
in
entry
[
'ipHostNumber'
]]
opening_in
=
{
open
[
1
]
for
open
in
opening
if
open
[
0
]
==
'in'
}
opening_out
=
{
open
[
1
]
for
open
in
opening
if
open
[
0
]
==
'out'
}
if
subnet
in
config
[
'DEFAULT_SERVICES'
]:
opening
+=
config
[
'DEFAULT_SERVICES'
][
subnet
]
for
ip
in
ip_addresses
:
tcp_ports_in
=
[
services
[
service
][
0
]
for
service
in
opening_in
if
'tcp'
in
services
[
service
][
1
]
]
tcp_ports_in
.
sort
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment