feat(security): migrate content scanning and bounce detection to Rust security bridge; add scanContent IPC command and Rust content scanner with tests; update TS RustSecurityBridge and callers, and adjust CI package references
This commit is contained in:
@@ -59,6 +59,13 @@ interface IReputationResult {
|
||||
total_checked: number;
|
||||
}
|
||||
|
||||
interface IContentScanResult {
|
||||
threatScore: number;
|
||||
threatType: string | null;
|
||||
threatDetails: string | null;
|
||||
scannedElements: string[];
|
||||
}
|
||||
|
||||
interface IVersionInfo {
|
||||
bin: string;
|
||||
core: string;
|
||||
@@ -102,6 +109,15 @@ type TMailerCommands = {
|
||||
params: { ip: string; heloDomain: string; hostname?: string; mailFrom: string };
|
||||
result: ISpfResult;
|
||||
};
|
||||
scanContent: {
|
||||
params: {
|
||||
subject?: string;
|
||||
textBody?: string;
|
||||
htmlBody?: string;
|
||||
attachmentNames?: string[];
|
||||
};
|
||||
result: IContentScanResult;
|
||||
};
|
||||
verifyEmail: {
|
||||
params: {
|
||||
rawMessage: string;
|
||||
@@ -243,6 +259,16 @@ export class RustSecurityBridge {
|
||||
return this.bridge.sendCommand('detectBounce', opts);
|
||||
}
|
||||
|
||||
/** Scan email content for threats (phishing, spam, malware, etc.). */
|
||||
public async scanContent(opts: {
|
||||
subject?: string;
|
||||
textBody?: string;
|
||||
htmlBody?: string;
|
||||
attachmentNames?: string[];
|
||||
}): Promise<IContentScanResult> {
|
||||
return this.bridge.sendCommand('scanContent', opts);
|
||||
}
|
||||
|
||||
/** Check IP reputation via DNSBL. */
|
||||
public async checkIpReputation(ip: string): Promise<IReputationResult> {
|
||||
return this.bridge.sendCommand('checkIpReputation', { ip });
|
||||
@@ -298,6 +324,7 @@ export type {
|
||||
IEmailSecurityResult,
|
||||
IValidationResult,
|
||||
IBounceDetection,
|
||||
IContentScanResult,
|
||||
IReputationResult as IRustReputationResult,
|
||||
IVersionInfo,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user