Compare commits

..

No commits in common. "e2cd688eff1464a90800fe9d4dead36efcf2deee" and "7a6f64fce0c3afcea3667f7324ee6798d5915ea8" have entirely different histories.

6 changed files with 1487 additions and 1504 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1480
dist/assets/index-DwAImxSO.js vendored Normal file

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View file

@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<script type="module" crossorigin src="/assets/index-Bxk5297m.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BaLleNnd.css">
<script type="module" crossorigin src="/assets/index-DwAImxSO.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index--WxSYaVD.css">
</head>
<body>
<div id="app"></div>

View file

@ -61,7 +61,6 @@ def read_exercise_dir():
def backup_exercises_progress():
global LAST_BACKUP
toBackup = {
'EXERCISES_STATUS': db.EXERCISES_STATUS,
'SELECTED_EXERCISES': db.SELECTED_EXERCISES,
@ -248,8 +247,8 @@ def get_available_tasks_for_user(user_id: int) -> list[str]:
def get_model_action(data: dict):
if 'Log' in data or 'AuditLog' in data:
data = data['Log'] if 'Log' in data else data['AuditLog']
if 'Log' in data:
data = data['Log']
if 'model' in data and 'action' in data:
return (data['model'], data['action'],)
return (None, None,)
@ -261,9 +260,8 @@ def is_accepted_query(data: dict) -> bool:
# # improved condition below. It blocks some queries
# if data['Log']['change'].startswith('attribute_count'):
# return False
if 'Log' in data:
if data['Log']['change'].startswith('Validation errors:'):
return False
if data['Log']['change'].startswith('Validation errors:'):
return False
return True
if data.get('user_agent', None) == 'misp-exercise-dashboard':
@ -432,13 +430,6 @@ def parse_event_id_from_log(data: dict) -> Union[int, None]:
if event_id_search is not None:
event_id = event_id_search.group(1)
return event_id
elif 'AuditLog' in data:
log = data['AuditLog']
if 'model' in log and 'model_id' in log and log['model'] == 'Event':
return int(log['model_id'])
if 'change' in log:
if 'event_id' in log:
return int(log['event_id'])
return None

View file

@ -75,10 +75,6 @@ def get_user_id(data: dict):
data = data['Log']
if 'user_id' in data:
return int(data['user_id'])
if 'AuditLog' in data:
data = data['AuditLog']
if 'user_id' in data:
return int(data['user_id'])
return None