Fix jwt-token
This commit is contained in:
@@ -59,19 +59,26 @@ class AlertService {
|
||||
// Adjust threat level based on drone type (if classified)
|
||||
const droneTypes = {
|
||||
0: 'Consumer/Hobby',
|
||||
1: 'Professional/Military',
|
||||
2: 'Racing/High-speed',
|
||||
3: 'Unknown/Custom'
|
||||
1: 'Orlan/Military', // Orlan drones - highest threat
|
||||
2: 'Professional/Commercial',
|
||||
3: 'Racing/High-speed',
|
||||
4: 'Unknown/Custom'
|
||||
};
|
||||
|
||||
// CRITICAL: Orlan drones (type 1) - ALWAYS CRITICAL regardless of distance
|
||||
if (droneType === 1) {
|
||||
// Military/Professional drone - escalate threat
|
||||
threatLevel = 'critical';
|
||||
description = 'CRITICAL THREAT: ORLAN MILITARY DRONE DETECTED - IMMEDIATE RESPONSE REQUIRED';
|
||||
actionRequired = true;
|
||||
console.log(`🚨 ORLAN DRONE DETECTED - Force escalating to CRITICAL threat level (RSSI: ${rssi})`);
|
||||
} else if (droneType === 2) {
|
||||
// Professional/Commercial drone - escalate threat
|
||||
if (threatLevel === 'low') threatLevel = 'medium';
|
||||
if (threatLevel === 'medium') threatLevel = 'high';
|
||||
if (threatLevel === 'high') threatLevel = 'critical';
|
||||
description += ' - PROFESSIONAL/MILITARY DRONE DETECTED';
|
||||
description += ' - PROFESSIONAL/COMMERCIAL DRONE DETECTED';
|
||||
actionRequired = true;
|
||||
} else if (droneType === 2) {
|
||||
} else if (droneType === 3) {
|
||||
// Racing/Fast drone - escalate if close
|
||||
if (rssi >= -55 && threatLevel !== 'critical') {
|
||||
threatLevel = 'high';
|
||||
@@ -177,6 +184,12 @@ class AlertService {
|
||||
|
||||
async shouldTriggerAlert(rule, detection, threatAssessment) {
|
||||
try {
|
||||
// CRITICAL SECURITY: Orlan drones (type 1) ALWAYS trigger alerts regardless of any other conditions
|
||||
if (detection.drone_type === 1) {
|
||||
console.log(`🚨 ORLAN DRONE DETECTED - Force triggering alert for rule ${rule.name} (bypassing all filters)`);
|
||||
return true;
|
||||
}
|
||||
|
||||
// SECURITY ENHANCEMENT: Check threat level requirements
|
||||
if (rule.min_threat_level) {
|
||||
const threatLevels = { 'monitoring': 0, 'low': 1, 'medium': 2, 'high': 3, 'critical': 4 };
|
||||
|
||||
Reference in New Issue
Block a user