Skip to content

Commit a96ce9f

Browse files
Island: Set auth expiration time to 30 minutes
Issue: #2157 PR: #3075
1 parent cb41869 commit a96ce9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

monkey/monkey_island/cc/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from monkey_island.cc.setup.mongo.mongo_setup import MONGO_DB_HOST, MONGO_DB_NAME, MONGO_DB_PORT
5555

5656
HOME_FILE = "index.html"
57+
AUTH_EXPIRATION_TIME = 30 * 60 # 30 minutes authentication token expiration time
5758

5859

5960
def serve_static_file(static_path):
@@ -94,6 +95,8 @@ def setup_authentication(app, data_dir):
9495
app.config["SECURITY_USERNAME_REQUIRED"] = True
9596
app.config["SECURITY_REGISTERABLE"] = True
9697
app.config["SECURITY_SEND_REGISTER_EMAIL"] = False
98+
99+
app.config["SECURITY_TOKEN_MAX_AGE"] = AUTH_EXPIRATION_TIME
97100
# Ignore CSRF, because it's irrelevant for javascript applications
98101
app.config["WTF_CSRF_CHECK_DEFAULT"] = False
99102
app.config["SECURITY_CSRF_IGNORE_UNAUTH_ENDPOINTS"] = True

0 commit comments

Comments
 (0)