fix: IPv4 ::ffff: prefix supprimé partout
🔧 FIX COMPLET IPv4: • IncidentsView.tsx - cleanIP() appliqué • CorrelationGraph.tsx - cleanIP() appliqué • Toutes les affichages IP nettoyés • Navigation URLs nettoyées • Export STIX nettoyé FONCTION cleanIP(): • Enlève le prefix ::ffff: des IPv4 • Appliqué sur cluster.subnet • Appliqué sur cluster.subnet.split('/')[0] • Affichage propre dans tous les composants RÉSULTAT: Avant: ::ffff:192.168.1.100 Après: 192.168.1.100 ✅ Build Docker: SUCCESS ✅ Container: healthy Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -106,6 +106,12 @@ export function IncidentsView() {
|
|||||||
return code.toUpperCase().replace(/./g, char => String.fromCodePoint(char.charCodeAt(0) + 127397));
|
return code.toUpperCase().replace(/./g, char => String.fromCodePoint(char.charCodeAt(0) + 127397));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Nettoyer une adresse IP (enlever ::ffff: prefix)
|
||||||
|
const cleanIP = (address: string): string => {
|
||||||
|
if (!address) return '';
|
||||||
|
return address.replace(/^::ffff:/i, '');
|
||||||
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center h-64">
|
<div className="flex items-center justify-center h-64">
|
||||||
@ -249,7 +255,7 @@ export function IncidentsView() {
|
|||||||
</span>
|
</span>
|
||||||
<span className="text-lg font-bold text-text-primary">{cluster.id}</span>
|
<span className="text-lg font-bold text-text-primary">{cluster.id}</span>
|
||||||
<span className="text-text-secondary">|</span>
|
<span className="text-text-secondary">|</span>
|
||||||
<span className="font-mono text-sm text-text-primary">{cluster.subnet}</span>
|
<span className="font-mono text-sm text-text-primary">{cleanIP(cluster.subnet || '')}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
@ -303,13 +309,13 @@ export function IncidentsView() {
|
|||||||
|
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={() => navigate(`/investigation/${cluster.subnet?.split('/')[0] || ''}`)}
|
onClick={() => navigate(`/investigation/${cleanIP(cluster.subnet?.split('/')[0] || '')}`)}
|
||||||
className="px-3 py-1.5 bg-accent-primary text-white rounded text-sm hover:bg-accent-primary/80 transition-colors"
|
className="px-3 py-1.5 bg-accent-primary text-white rounded text-sm hover:bg-accent-primary/80 transition-colors"
|
||||||
>
|
>
|
||||||
Investiguer
|
Investiguer
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => navigate(`/entities/ip/${cluster.subnet?.split('/')[0] || ''}`)}
|
onClick={() => navigate(`/entities/ip/${cleanIP(cluster.subnet?.split('/')[0] || '')}`)}
|
||||||
className="px-3 py-1.5 bg-background-card text-text-primary rounded text-sm hover:bg-background-card/80 transition-colors"
|
className="px-3 py-1.5 bg-background-card text-text-primary rounded text-sm hover:bg-background-card/80 transition-colors"
|
||||||
>
|
>
|
||||||
Voir détails
|
Voir détails
|
||||||
@ -317,7 +323,7 @@ export function IncidentsView() {
|
|||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// Quick classify
|
// Quick classify
|
||||||
navigate(`/bulk-classify?ips=${encodeURIComponent(cluster.subnet?.split('/')[0] || '')}`);
|
navigate(`/bulk-classify?ips=${encodeURIComponent(cleanIP(cluster.subnet?.split('/')[0] || ''))}`);
|
||||||
}}
|
}}
|
||||||
className="px-3 py-1.5 bg-background-card text-text-primary rounded text-sm hover:bg-background-card/80 transition-colors"
|
className="px-3 py-1.5 bg-background-card text-text-primary rounded text-sm hover:bg-background-card/80 transition-colors"
|
||||||
>
|
>
|
||||||
@ -332,7 +338,7 @@ export function IncidentsView() {
|
|||||||
objects: [{
|
objects: [{
|
||||||
type: 'indicator',
|
type: 'indicator',
|
||||||
id: `indicator--${cluster.id}`,
|
id: `indicator--${cluster.id}`,
|
||||||
pattern: `[ipv4-addr:value = '${cluster.subnet?.split('/')[0]}'`,
|
pattern: `[ipv4-addr:value = '${cleanIP(cluster.subnet?.split('/')[0] || '')}'`,
|
||||||
pattern_type: 'stix'
|
pattern_type: 'stix'
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
@ -396,7 +402,7 @@ export function IncidentsView() {
|
|||||||
>
|
>
|
||||||
<td className="px-4 py-3 text-text-secondary">{index + 1}</td>
|
<td className="px-4 py-3 text-text-secondary">{index + 1}</td>
|
||||||
<td className="px-4 py-3 font-mono text-sm text-text-primary">
|
<td className="px-4 py-3 font-mono text-sm text-text-primary">
|
||||||
{cluster.subnet?.split('/')[0] || 'Unknown'}
|
{cleanIP(cluster.subnet?.split('/')[0] || 'Unknown')}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-3 text-sm text-text-secondary">IP</td>
|
<td className="px-4 py-3 text-sm text-text-secondary">IP</td>
|
||||||
<td className="px-4 py-3">
|
<td className="px-4 py-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user