Skip to content

Commit 2ab4cff

Browse files
committed
Add FirewallLists to the connection manager
1 parent f598f1e commit 2ab4cff

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

aikido_zen/background_process/cloud_connection_manager/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from aikido_zen.storage.hostnames import Hostnames
1212
from ..realtime.start_polling_for_changes import start_polling_for_changes
1313
from ...storage.ai_statistics import AIStatistics
14+
from ...storage.firewall_lists import FirewallLists
1415
from ...storage.statistics import Statistics
1516

1617
# Import functions :
@@ -41,6 +42,7 @@ def __init__(self, block, api, token, serverless):
4142
bypassed_ips=[],
4243
received_any_stats=True,
4344
)
45+
self.firewall_lists = FirewallLists()
4446
self.rate_limiter = RateLimiter(
4547
max_items=5000, time_to_live_in_ms=120 * 60 * 1000 # 120 minutes
4648
)

aikido_zen/background_process/cloud_connection_manager/update_firewall_lists.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def update_firewall_lists(connection_manager):
2424
if not isinstance(blocked_user_agents, str):
2525
return
2626

27-
connection_manager.conf.set_blocked_ips(blocked_ips)
28-
connection_manager.conf.set_allowed_ips(allowed_ips)
29-
connection_manager.conf.set_blocked_user_agents(blocked_user_agents)
27+
connection_manager.firewall_lists.set_blocked_ips(blocked_ips)
28+
connection_manager.firewall_lists.set_allowed_ips(allowed_ips)
29+
connection_manager.firewall_lists.set_blocked_user_agents(blocked_user_agents)
3030

3131
except Exception as e:
3232
logger.debug("Exception in update_firewall_lists: %s", e)

0 commit comments

Comments
 (0)