diff --git a/server/src/uds/REST/methods/actor_v3.py b/server/src/uds/REST/methods/actor_v3.py index ab54bb79b..905a667ee 100644 --- a/server/src/uds/REST/methods/actor_v3.py +++ b/server/src/uds/REST/methods/actor_v3.py @@ -66,6 +66,8 @@ class BlockAccess(Exception): # Helpers def checkBlockedIp(ip: str)-> None: + if GlobalConfig.BLOCK_ACTOR_FAILURES.getBool() is False: + return cache = Cache('actorv3') fails = cache.get(ip) or 0 if fails > ALLOWED_FAILS: diff --git a/server/src/uds/core/util/config.py b/server/src/uds/core/util/config.py index ea84d6dc9..53c0f80d8 100644 --- a/server/src/uds/core/util/config.py +++ b/server/src/uds/core/util/config.py @@ -314,6 +314,9 @@ class GlobalConfig: # If we use new logout mechanics EXCLUSIVE_LOGOUT: Config.Value = Config.section(SECURITY_SECTION).value('Exclusive Logout', '0', type=Config.BOOLEAN_FIELD) + # Enable/Disable Actor attack block + BLOCK_ACTOR_FAILURES: Config.Value = Config.section(SECURITY_SECTION).value('Block actor failures', '1', type=Config.BOOLEAN_FIELD) + # Clusters related vars # Maximum desired CPU Load. If cpu is over this value, a migration of a service is "desirable"