+
+
+
{t('crowdsecConfig.whitelist.title', 'IP Whitelist')}
+
+
+ {t('crowdsecConfig.whitelist.description', 'Whitelisted IPs and CIDRs are never blocked by CrowdSec, even if they trigger alerts.')}
+
+
+ {/* Add entry form */}
+
+
+ {
+ setWhitelistForm((prev) => ({ ...prev, ip_or_cidr: e.target.value }))
+ if (addWhitelistMutation.error) addWhitelistMutation.reset()
+ }}
+ error={whitelistInlineError ?? undefined}
+ errorTestId="whitelist-ip-error"
+ aria-required={true}
+ data-testid="whitelist-ip-input"
+ />
+
+
+ setWhitelistForm((prev) => ({ ...prev, reason: e.target.value }))}
+ data-testid="whitelist-reason-input"
+ />
+
+
+
+
+
+
+
+ {/* Entries table */}
+ {whitelistQuery.isLoading ? (
+
+
+
+
+
+ ) : !whitelistQuery.data?.length ? (
+
+ {t('crowdsecConfig.whitelist.none', 'No whitelist entries')}
+
+ ) : (
+
+
+
+
+ |
+ {t('crowdsecConfig.whitelist.columnIp', 'IP / CIDR')}
+ |
+
+ {t('crowdsecConfig.whitelist.columnReason', 'Reason')}
+ |
+
+ {t('crowdsecConfig.whitelist.columnAdded', 'Added')}
+ |
+
+ {t('crowdsecConfig.bannedIps.actions')}
+ |
+
+
+
+ {whitelistQuery.data.map((entry) => (
+
+ | {entry.ip_or_cidr} |
+ {entry.reason || '-'} |
+
+ {entry.created_at ? new Date(entry.created_at).toLocaleString() : '-'}
+ |
+
+
+ |
+
+ ))}
+
+
+
+ )}
+
+