-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
140 lines (126 loc) · 3.13 KB
/
Copy pathtypes.ts
File metadata and controls
140 lines (126 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Shared threat intelligence types used across backend & frontend
export type Severity = "critical" | "high" | "medium" | "low" | "info";
export type AttackType =
| "ddos"
| "brute-force"
| "malware"
| "phishing"
| "port-scan"
| "sql-injection"
| "xss"
| "ransomware"
| "botnet"
| "exploit"
| "credential-stuffing"
| "ssh-attack"
| "web-exploit";
export type ThreatCategory =
| "malware"
| "botnet"
| "spam"
| "phishing"
| "scanner"
| "exploit"
| "proxy"
| "tor"
| "ransomware";
/** A live attack event flowing on the world map. */
export interface AttackEvent {
id: string;
sourceCountry: string; // ISO-2 code, e.g. "CN"
sourceCountryName: string;
sourceCoords: [number, number]; // [lng, lat]
targetCountry: string;
targetCountryName: string;
targetCoords: [number, number];
type: AttackType;
severity: Severity;
sourceIp: string;
targetIp: string;
port: number;
timestamp: number;
}
/** A threat indicator from a feed (abuse.ch / alienvault / pulsedive / abuseipdb). */
export interface ThreatIndicator {
id: string;
ioc: string; // IP / domain / hash / url
type: "ip" | "domain" | "url" | "hash" | "email";
country?: string;
countryName?: string;
category: ThreatCategory;
confidence: number; // 0-100
tags: string[];
source: "abuseipdb" | "abusech" | "alienvault" | "pulsedive";
firstSeen: string;
lastSeen: string;
description?: string;
malware?: string; // malware family / campaign name (abuse.ch ThreatFox)
}
/** IP reputation result from AbuseIPDB. */
export interface IpReputation {
ip: string;
abuseScore: number; // 0-100
confidence: "clean" | "low" | "medium" | "high" | "critical";
country: string;
countryName: string;
isp: string;
usageType: string;
domain: string;
totalReports: number;
numDistinctUsers: number;
lastReportedAt: string;
hostnames: string[];
categories: { id: number; name: string }[];
}
export interface NewsItem {
id: string;
title: string;
description: string;
source: string;
url: string;
publishedAt: string;
imageUrl?: string;
}
export interface DashboardStats {
totalAttacks: number;
blockedAttacks: number;
activeThreats: number;
monitoredCountries: number;
topAttackTypes: { type: AttackType; count: number }[];
threatLevel: "low" | "guarded" | "elevated" | "high" | "critical";
threatsPerMin: number;
lastUpdated: number;
}
export interface CountryAttackStat {
code: string;
name: string;
attacks: number;
coords: [number, number];
}
export interface ThreatTimelinePoint {
time: string;
attacks: number;
blocked: number;
critical: number;
}
/** Unified API response shape for the live attack stream. */
export interface AttacksResponse {
attacks: AttackEvent[];
topSources: CountryAttackStat[];
topTargets: CountryAttackStat[];
generatedAt: number;
}
export interface FeedResponse {
indicators: ThreatIndicator[];
total: number;
sources: string[];
generatedAt: number;
}
export interface NewsResponse {
articles: NewsItem[];
total: number;
generatedAt: number;
}
export interface StatsResponse extends DashboardStats {
timeline: ThreatTimelinePoint[];
}