Skip to content
Snippets Groups Projects
Commit c777928e authored by Tomáš Čejka's avatar Tomáš Čejka
Browse files

settings. add PERMIT_PRIVATE_IP_TARGETS to allow/forbid private IPs

parent ab2d8a77
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,10 @@ def get_network(ip): ...@@ -18,7 +18,10 @@ def get_network(ip):
def clean_ip(address): def clean_ip(address):
if False and address.is_private: if not hasattr(settings, "PERMIT_PRIVATE_IP_TARGETS"):
settings.PERMIT_PRIVATE_IP_TARGETS = True
if settings.PERMIT_PRIVATE_IP_TARGETS == False and address.is_private:
return _('Private addresses not allowed') return _('Private addresses not allowed')
if address.version == 4 and int(address.prefixlen) == 32: if address.version == 4 and int(address.prefixlen) == 32:
......
...@@ -393,6 +393,9 @@ SNMP_MAX_SAMPLECOUNT = 12 ...@@ -393,6 +393,9 @@ SNMP_MAX_SAMPLECOUNT = 12
# Age of inactive routes that can be already removed (in seconds) # Age of inactive routes that can be already removed (in seconds)
SNMP_REMOVE_RULES_AFTER = 3600 SNMP_REMOVE_RULES_AFTER = 3600
# If PERMIT_PRIVATE_IP_TARGETS is False, then users are not allowed to enter IP addresses from private IP ranges; it is True by default
PERMIT_PRIVATE_IP_TARGETS = True
############################################################################## ##############################################################################
############################################################################## ##############################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment