forked from shaba/openuds
Added actor block on failure security config
This commit is contained in:
parent
1505fd346b
commit
ba716be0f3
@ -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:
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user