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.
82 lines • 2.36 kB
TypeScript
import { FeedConfiguration, ThreatFeedResult } from '../types';
interface AbuseIPDBResponse {
data: {
ipAddress: string;
isPublic: boolean;
ipVersion: number;
isWhitelisted: boolean;
abuseConfidencePercentage: number;
countryCode: string | null;
countryName: string | null;
usageType: string;
isp: string | null;
domain: string | null;
hostnames: string[];
totalReports: number;
numDistinctUsers: number;
lastReportedAt: string | null;
};
}
interface AbuseIPDBReportsResponse {
data: {
ipAddress: string;
reports: Array<{
reportedAt: string;
comment: string;
categories: number[];
reporterId: number;
reporterCountryCode: string;
reporterCountryName: string;
}>;
};
}
export declare class AbuseIPDBFeed {
private config;
private apiKey;
private baseUrl;
private rateLimitRemaining;
private rateLimitReset;
private requestCount;
private dailyLimit;
constructor(config?: Partial<FeedConfiguration>);
checkIP(ip: string, options?: {
maxAgeInDays?: number;
verbose?: boolean;
}): Promise<AbuseIPDBResponse>;
getReports(ip: string, options?: {
maxAgeInDays?: number;
perPage?: number;
page?: number;
}): Promise<AbuseIPDBReportsResponse>;
fetchThreatData(): Promise<ThreatFeedResult>;
fetchThreats(options?: {
ips?: string[];
maxAgeInDays?: number;
confidenceThreshold?: number;
includeReports?: boolean;
maxResults?: number;
}): Promise<ThreatFeedResult>;
private mapToThreatIndicator;
private calculateConfidence;
private mapSeverity;
private generateDescription;
private extractMalwareFamily;
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=AbuseIPDBFeed.d.ts.map