firewall: Don't show tun interface in internal zone warning

- We are mention in the internal zone warning that services are available when
connected over VPN.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-05-25 20:55:02 -07:00 committed by James Valleroy
parent e7be53723f
commit d379c981bb
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -4,6 +4,7 @@ App component for other apps to use firewall functionality.
"""
import logging
import re
from django.utils.translation import ugettext_lazy as _
@ -100,8 +101,16 @@ class Firewall(app.FollowerComponent):
@staticmethod
def get_internal_interfaces():
"""Returns a list of interfaces in a firewall zone."""
return firewall.get_interfaces('internal')
"""Returns a list of interfaces in a firewall zone.
Filter out tun interfaces as they are always assumed to be internal
interfaces.
"""
return [
interface for interface in firewall.get_interfaces('internal')
if not re.fullmatch(r'tun\d+', interface)
]
def diagnose(self):
"""Check if the firewall ports are open and only as expected.