trojanhorse-js
Version:
A comprehensive JavaScript library for fetching, managing, and analyzing global threat intelligence from multiple open-source feeds and security news sources. Unlike its mythological namesake, this Trojan protects your digital fortress.
146 lines • 3.71 kB
TypeScript
import { FeedConfiguration, ThreatFeedResult } from '../types';
interface CrowdSecIPInfo {
ip: string;
ip_range?: string;
ip_range_score?: number;
country?: string;
city?: string;
latitude?: number;
longitude?: number;
as_name?: string;
as_num?: number;
background_noise_score?: number;
scores?: {
overall?: {
aggressiveness: number;
threat: number;
trust: number;
anomaly: number;
total: number;
};
};
attack_details?: Array<{
name: string;
label: string;
description: string;
references?: string[];
}>;
behaviors?: Array<{
name: string;
label: string;
description: string;
}>;
history?: {
first_seen: string;
last_seen: string;
full_age: number;
days_age: number;
};
classifications?: {
false_positives?: Array<{
name: string;
label: string;
description: string;
}>;
classifications?: Array<{
name: string;
label: string;
description: string;
}>;
};
target_countries?: Record<string, number>;
background_noise?: boolean;
cves?: string[];
}
interface CrowdSecSmokeResponse {
ip_range_score: number;
ip: string;
ip_range: string;
as_name: string;
as_num: number;
location: {
country: string;
city: string;
latitude: number;
longitude: number;
};
reverse_dns: string;
behaviors: Array<{
name: string;
label: string;
description: string;
}>;
history: {
first_seen: string;
last_seen: string;
full_age: number;
days_age: number;
};
classifications: {
false_positives: any[];
classifications: Array<{
name: string;
label: string;
description: string;
}>;
};
attack_details: Array<{
name: string;
label: string;
description: string;
references: string[];
}>;
target_countries: Record<string, number>;
background_noise: boolean;
scores: {
overall: {
aggressiveness: number;
threat: number;
trust: number;
anomaly: number;
total: number;
};
};
}
export declare class CrowdSecFeed {
private config;
private apiKey;
private baseUrl;
private rateLimitRemaining;
private rateLimitReset;
private requestCount;
private dailyLimit;
constructor(config?: Partial<FeedConfiguration>);
fetchThreatData(): Promise<ThreatFeedResult>;
fetchRecentThreats(): Promise<ThreatFeedResult>;
fetchIPInfo(ip: string): Promise<CrowdSecIPInfo>;
fetchSmokeData(ip: string): Promise<CrowdSecSmokeResponse>;
fetchThreats(options?: {
ips?: string[];
includeSmoke?: boolean;
maxResults?: number;
}): Promise<ThreatFeedResult>;
private mapToThreatIndicator;
private calculateThreatLevel;
private calculateConfidence;
private mapSeverity;
private generateDescription;
private checkRateLimit;
private updateRateLimitInfo;
getStats(): {
requestCount: number;
rateLimitRemaining: number;
rateLimitReset: Date;
dailyLimit: number;
isEnabled: boolean;
hasApiKey: boolean;
rateLimit: FeedConfiguration['rateLimit'];
};
testConnection(): Promise<{
success: boolean;
message: string;
details?: any;
}>;
}
export {};
//# sourceMappingURL=CrowdSecFeed.d.ts.map