feat(source2): lock dark mode, sans-serif typography, and all recent updates
This commit is contained in:
1 parent
dd4c8f6876
commit
9f24b56e97
259 files changed
+15596
-8966
No files matched your search
@@ -1,5 +1,6 @@
|
||||
const { Summary, DeviceStat, Threat, Flow, Event, AppStat } = require('../models/Schemas');
|
||||
const User = require('../models/User');
|
||||
const parseAgentSecurity = require('./agentSecurityParser');
|
||||
|
||||
module.exports = async function agentDetailsHandler(req, res, helpers) {
|
||||
try {
|
||||
@@ -32,7 +33,7 @@ module.exports = async function agentDetailsHandler(req, res, helpers) {
|
||||
Summary.findOne(baseQuery).sort({ timestamp: -1 }),
|
||||
DeviceStat.find(baseQuery).sort({ timestamp: -1, download: -1 }).lean(),
|
||||
Threat.find(baseQuery).sort({ detected_at: -1 }).lean(),
|
||||
Flow.find(baseQuery).sort({ timestamp: -1 }).limit(2000).lean(),
|
||||
Flow.find(baseQuery).sort({ timestamp: -1 }).limit(1000000).lean(),
|
||||
AppStat.find(baseQuery).sort({ timestamp: -1, download: -1 }).lean(),
|
||||
Event.find(baseQuery).sort({ timestamp: -1 }).lean(),
|
||||
getCustomLabelsMap()
|
||||
@@ -168,104 +169,9 @@ module.exports = async function agentDetailsHandler(req, res, helpers) {
|
||||
detected_at: d.last_seen
|
||||
}));
|
||||
|
||||
const insecure_protocols = [];
|
||||
const unencrypted_passwords = [];
|
||||
const ip_reputation = [];
|
||||
const tor_detections = [];
|
||||
const vpn_detections = [];
|
||||
|
||||
rawThreats.forEach(t => {
|
||||
const eTime = t.detected_at || t.timestamp?.toISOString() || new Date().toISOString();
|
||||
const ip = t.ip_address;
|
||||
const mac = t.mac_address || generateMacFromIp(ip);
|
||||
|
||||
if (t.threat_type === 'Insecure Plaintext Password') {
|
||||
unencrypted_passwords.push({
|
||||
ip_address: ip,
|
||||
mac_address: mac,
|
||||
dst_ip: t.dst_ip,
|
||||
dst_port: 80,
|
||||
protocol: 'HTTP',
|
||||
username: 'user_admin',
|
||||
severity: t.severity,
|
||||
download: 1024,
|
||||
upload: 512,
|
||||
detected_at: eTime
|
||||
});
|
||||
insecure_protocols.push({
|
||||
ip_address: ip,
|
||||
mac_address: mac,
|
||||
protocol: 'HTTP',
|
||||
risk: 'high',
|
||||
app_label: t.app_label || 'HTTP',
|
||||
dst_ip: t.dst_ip,
|
||||
dst_port: 80,
|
||||
download: 1024,
|
||||
upload: 512,
|
||||
detected_at: eTime
|
||||
});
|
||||
} else if (t.threat_type === 'Tor Exit Node Traffic') {
|
||||
tor_detections.push({
|
||||
ip_address: ip,
|
||||
mac_address: mac,
|
||||
exit_node: t.dst_ip,
|
||||
circuit_id: '1283921',
|
||||
country: 'Germany',
|
||||
download: 4096,
|
||||
upload: 2048,
|
||||
detected_at: eTime
|
||||
});
|
||||
} else if (t.threat_type === 'Malicious IP Reputation') {
|
||||
ip_reputation.push({
|
||||
ip_address: t.dst_ip,
|
||||
local_ip: ip,
|
||||
mac_address: mac,
|
||||
reputation: 'spam/botnet',
|
||||
score: 85,
|
||||
country: 'Russia',
|
||||
app_label: t.app_label || 'SMTP',
|
||||
blacklisted: true,
|
||||
download: 2048,
|
||||
upload: 1024,
|
||||
detected_at: eTime
|
||||
});
|
||||
} else if (t.threat_type === 'Unauthorized Port Scan') {
|
||||
insecure_protocols.push({
|
||||
ip_address: ip,
|
||||
mac_address: mac,
|
||||
protocol: 'TCP',
|
||||
risk: 'medium',
|
||||
app_label: t.app_label || 'SCAN',
|
||||
dst_ip: t.dst_ip,
|
||||
dst_port: 0,
|
||||
download: 512,
|
||||
upload: 512,
|
||||
detected_at: eTime
|
||||
});
|
||||
} else if (t.threat_type === 'Cryptomining Connection') {
|
||||
ip_reputation.push({
|
||||
ip_address: t.dst_ip,
|
||||
local_ip: ip,
|
||||
mac_address: mac,
|
||||
reputation: 'cryptomining',
|
||||
score: 90,
|
||||
country: 'US',
|
||||
app_label: t.app_label || 'Stratum',
|
||||
blacklisted: true,
|
||||
download: 4096,
|
||||
upload: 4096,
|
||||
detected_at: eTime
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const security = {
|
||||
encryption_audit,
|
||||
insecure_protocols,
|
||||
unencrypted_passwords,
|
||||
ip_reputation,
|
||||
tor_detections,
|
||||
vpn_detections
|
||||
...parseAgentSecurity(rawThreats)
|
||||
};
|
||||
|
||||
// 9. Server Discovery
|
||||
|
||||
Reference in new issue
Block a user