Skip to content

Commit

Permalink
Update update_whitelist.py
Browse files Browse the repository at this point in the history
  • Loading branch information
l4rm4nd authored Mar 18, 2024
1 parent 6e3bbbe commit 35353c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions update_whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def send_notification(message):
return False

def overwrite_middleware():
# Get default source range from environment variable
DEFAULT_PRIVATE_CLASS_SOURCE_RANGE = os.getenv('DEFAULT_PRIVATE_CLASS_SOURCE_RANGE')

if DEFAULT_PRIVATE_CLASS_SOURCE_RANGE == "True":
# allow private class ranges as default
DEFAULT_SOURCE_RANGE = ['127.0.0.1/32', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
else:
# allow localhost only as default
DEFAULT_SOURCE_RANGE = ['127.0.0.1/32']

# Overwrite the middleware file to ensure only 127.0.0.1/32 is added
whitelist_file = 'dynamic-whitelist.yml'
whitelist = {
Expand Down

0 comments on commit 35353c8

Please # to comment.