pompelmi 0.34.10 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -15
- package/dist/pompelmi.audit.cjs +13 -15
- package/dist/pompelmi.audit.cjs.map +1 -1
- package/dist/pompelmi.audit.esm.js +13 -15
- package/dist/pompelmi.audit.esm.js.map +1 -1
- package/dist/pompelmi.browser.cjs +585 -534
- package/dist/pompelmi.browser.cjs.map +1 -1
- package/dist/pompelmi.browser.esm.js +585 -534
- package/dist/pompelmi.browser.esm.js.map +1 -1
- package/dist/pompelmi.cjs +2066 -2016
- package/dist/pompelmi.cjs.map +1 -1
- package/dist/pompelmi.esm.js +2066 -2016
- package/dist/pompelmi.esm.js.map +1 -1
- package/dist/pompelmi.hooks.cjs +2 -2
- package/dist/pompelmi.hooks.cjs.map +1 -1
- package/dist/pompelmi.hooks.esm.js +2 -2
- package/dist/pompelmi.hooks.esm.js.map +1 -1
- package/dist/pompelmi.policy-packs.cjs +74 -73
- package/dist/pompelmi.policy-packs.cjs.map +1 -1
- package/dist/pompelmi.policy-packs.esm.js +74 -73
- package/dist/pompelmi.policy-packs.esm.js.map +1 -1
- package/dist/pompelmi.quarantine.cjs +135 -133
- package/dist/pompelmi.quarantine.cjs.map +1 -1
- package/dist/pompelmi.quarantine.esm.js +135 -133
- package/dist/pompelmi.quarantine.esm.js.map +1 -1
- package/dist/pompelmi.react.cjs +585 -534
- package/dist/pompelmi.react.cjs.map +1 -1
- package/dist/pompelmi.react.esm.js +585 -534
- package/dist/pompelmi.react.esm.js.map +1 -1
- package/dist/types/audit.d.ts +12 -12
- package/dist/types/browser-index.d.ts +12 -12
- package/dist/types/config.d.ts +4 -4
- package/dist/types/engines/dynamic-taint.d.ts +1 -1
- package/dist/types/engines/hybrid-orchestrator.d.ts +1 -1
- package/dist/types/engines/hybrid-taint-integration.d.ts +6 -6
- package/dist/types/engines/taint-policies.d.ts +4 -4
- package/dist/types/hipaa-compliance.d.ts +2 -2
- package/dist/types/hooks.d.ts +2 -2
- package/dist/types/index.d.ts +20 -20
- package/dist/types/node/scanDir.d.ts +5 -5
- package/dist/types/policy-packs.d.ts +2 -2
- package/dist/types/presets.d.ts +3 -3
- package/dist/types/quarantine/index.d.ts +3 -3
- package/dist/types/quarantine/storage.d.ts +1 -1
- package/dist/types/quarantine/types.d.ts +3 -3
- package/dist/types/quarantine/workflow.d.ts +4 -4
- package/dist/types/react-index.d.ts +2 -2
- package/dist/types/risk.d.ts +1 -1
- package/dist/types/scan/remote.d.ts +2 -2
- package/dist/types/scan.d.ts +5 -5
- package/dist/types/scanners/common-heuristics.d.ts +1 -1
- package/dist/types/scanners/zip-bomb-guard.d.ts +1 -1
- package/dist/types/src/audit.d.ts +84 -0
- package/dist/types/src/browser-index.d.ts +29 -0
- package/dist/types/src/config.d.ts +143 -0
- package/dist/types/src/engines/dynamic-taint.d.ts +102 -0
- package/dist/types/src/engines/hybrid-orchestrator.d.ts +65 -0
- package/dist/types/src/engines/hybrid-taint-integration.d.ts +129 -0
- package/dist/types/src/engines/taint-policies.d.ts +84 -0
- package/dist/types/src/hipaa-compliance.d.ts +110 -0
- package/dist/types/src/hooks.d.ts +89 -0
- package/dist/types/src/index.d.ts +29 -0
- package/dist/types/src/magic.d.ts +7 -0
- package/dist/types/src/node/scanDir.d.ts +30 -0
- package/dist/types/src/policy-packs.d.ts +98 -0
- package/dist/types/src/policy.d.ts +12 -0
- package/dist/types/src/presets.d.ts +72 -0
- package/dist/types/src/quarantine/index.d.ts +18 -0
- package/dist/types/src/quarantine/storage.d.ts +77 -0
- package/dist/types/src/quarantine/types.d.ts +78 -0
- package/dist/types/src/quarantine/workflow.d.ts +97 -0
- package/dist/types/src/react-index.d.ts +13 -0
- package/dist/types/src/risk.d.ts +18 -0
- package/dist/types/src/scan/remote.d.ts +12 -0
- package/dist/types/src/scan.d.ts +17 -0
- package/dist/types/src/scanners/common-heuristics.d.ts +14 -0
- package/dist/types/src/scanners/zip-bomb-guard.d.ts +9 -0
- package/dist/types/src/scanners/zipTraversalGuard.d.ts +19 -0
- package/dist/types/src/stream.d.ts +10 -0
- package/dist/types/src/types/decompilation.d.ts +96 -0
- package/dist/types/src/types/taint-tracking.d.ts +495 -0
- package/dist/types/src/types.d.ts +48 -0
- package/dist/types/src/useFileScanner.d.ts +15 -0
- package/dist/types/src/utils/advanced-detection.d.ts +21 -0
- package/dist/types/src/utils/batch-scanner.d.ts +62 -0
- package/dist/types/src/utils/cache-manager.d.ts +95 -0
- package/dist/types/src/utils/export.d.ts +51 -0
- package/dist/types/src/utils/performance-metrics.d.ts +68 -0
- package/dist/types/src/utils/threat-intelligence.d.ts +96 -0
- package/dist/types/src/validate.d.ts +7 -0
- package/dist/types/src/verdict.d.ts +2 -0
- package/dist/types/src/yara/browser.d.ts +7 -0
- package/dist/types/src/yara/index.d.ts +17 -0
- package/dist/types/src/yara/node.d.ts +2 -0
- package/dist/types/src/yara/remote.d.ts +10 -0
- package/dist/types/src/yara-bridge.d.ts +3 -0
- package/dist/types/src/zip.d.ts +13 -0
- package/dist/types/types/decompilation.d.ts +4 -4
- package/dist/types/types/taint-tracking.d.ts +19 -19
- package/dist/types/types.d.ts +3 -3
- package/dist/types/useFileScanner.d.ts +1 -1
- package/dist/types/utils/advanced-detection.d.ts +1 -1
- package/dist/types/utils/batch-scanner.d.ts +3 -3
- package/dist/types/utils/cache-manager.d.ts +1 -1
- package/dist/types/utils/export.d.ts +2 -2
- package/dist/types/utils/threat-intelligence.d.ts +4 -4
- package/dist/types/verdict.d.ts +1 -1
- package/dist/types/yara/browser.d.ts +1 -1
- package/dist/types/yara/index.d.ts +1 -1
- package/dist/types/yara/node.d.ts +1 -1
- package/dist/types/yara/remote.d.ts +2 -2
- package/package.json +6 -6
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
*
|
|
16
16
|
* For the React hook, import from 'pompelmi/react'.
|
|
17
17
|
*/
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
18
|
+
export { DEFAULT_POLICY, definePolicy } from "./policy";
|
|
19
|
+
export { ARCHIVES, CONSERVATIVE_DEFAULT, DOCUMENTS_ONLY, getPolicyPack, IMAGES_ONLY, POLICY_PACKS, type PolicyPackName, STRICT_PUBLIC_UPLOAD, } from "./policy-packs";
|
|
20
|
+
export { type ComposeScannerOptions, composeScanners, createPresetScanner, type NamedScanner, type PresetName, type PresetOptions, } from "./presets";
|
|
21
|
+
export { type ScanOptions, scanBytes, scanFile, scanFiles } from "./scan";
|
|
22
|
+
export { CommonHeuristicsScanner } from "./scanners/common-heuristics";
|
|
23
|
+
export { createZipBombGuard } from "./scanners/zip-bomb-guard";
|
|
24
|
+
export type { FileInfo, Match, ScanContext, ScanFn, Scanner, ScanReport, Uint8ArrayLike, Verdict, YaraMatch, } from "./types";
|
|
25
|
+
export { analyzeNestedArchives, detectObfuscatedScripts, detectPolyglot, } from "./utils/advanced-detection";
|
|
26
|
+
export { type ExportFormat, type ExportOptions, exportScanResults, ScanResultExporter, } from "./utils/export";
|
|
27
|
+
export { aggregateScanStats, type PerformanceMetrics, PerformanceTracker, type ScanStatistics, } from "./utils/performance-metrics";
|
|
28
|
+
export { validateFile } from "./validate";
|
|
29
|
+
export { mapMatchesToVerdict } from "./verdict";
|
package/dist/types/config.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Advanced configuration system for pompelmi
|
|
3
3
|
* @module config
|
|
4
4
|
*/
|
|
5
|
-
import type { PresetName, PresetOptions } from
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
5
|
+
import type { PresetName, PresetOptions } from "./presets";
|
|
6
|
+
import type { ScanReport } from "./types";
|
|
7
|
+
import type { CacheOptions } from "./utils/cache-manager";
|
|
8
8
|
export interface ScannerConfig {
|
|
9
9
|
/** Default preset to use */
|
|
10
10
|
defaultPreset?: PresetName;
|
|
@@ -50,7 +50,7 @@ export interface ScannerConfig {
|
|
|
50
50
|
/** Enable detailed logging */
|
|
51
51
|
verbose?: boolean;
|
|
52
52
|
/** Log level (debug, info, warn, error) */
|
|
53
|
-
level?:
|
|
53
|
+
level?: "debug" | "info" | "warn" | "error";
|
|
54
54
|
/** Enable scan statistics */
|
|
55
55
|
enableStats?: boolean;
|
|
56
56
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Advanced taint tracking implementation for comprehensive data flow analysis
|
|
5
5
|
* with support for memory tainting, register tracking, and vulnerability detection.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { TaintAnalysisResult, TaintCapableEngine, TaintConfig, TaintedMemory, TaintedRegister, TaintLabel, TaintSource } from "../types/taint-tracking";
|
|
8
8
|
/**
|
|
9
9
|
* Advanced dynamic taint analysis engine with comprehensive tracking capabilities
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Advanced orchestration framework for coordinating multiple analysis engines
|
|
5
5
|
* including Binary Ninja, Ghidra, dynamic taint tracking, and custom engines.
|
|
6
6
|
*/
|
|
7
|
-
import type { AnalysisEngine, AnalysisPhase, EngineCapability,
|
|
7
|
+
import type { AnalysisEngine, AnalysisPhase, EngineCapability, HybridAnalysisResult, HybridConfig, HybridOrchestrator } from "../types/taint-tracking";
|
|
8
8
|
/**
|
|
9
9
|
* Main hybrid orchestration engine
|
|
10
10
|
*/
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Complete integration package for dynamic taint tracking and hybrid orchestration
|
|
5
5
|
* with existing Pompelmi decompilation engines and HIPAA compliance.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
7
|
+
import type { DecompilationResult, DecompilationScanner } from "../types/decompilation";
|
|
8
|
+
import type { AnalysisEngine, HybridAnalysisResult, HybridConfig, TaintAnalysisResult, TaintConfig } from "../types/taint-tracking";
|
|
9
|
+
import type { TaintPolicy } from "./taint-policies";
|
|
10
10
|
/**
|
|
11
11
|
* Enhanced analysis result combining all engines
|
|
12
12
|
*/
|
|
@@ -33,7 +33,7 @@ export interface EnhancedAnalysisResult {
|
|
|
33
33
|
riskScore: number;
|
|
34
34
|
vulnerabilities: Array<{
|
|
35
35
|
type: string;
|
|
36
|
-
severity:
|
|
36
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
37
37
|
confidence: number;
|
|
38
38
|
description: string;
|
|
39
39
|
evidence: any;
|
|
@@ -46,7 +46,7 @@ export interface EnhancedAnalysisResult {
|
|
|
46
46
|
hipaaCompliant: boolean;
|
|
47
47
|
issues: Array<{
|
|
48
48
|
type: string;
|
|
49
|
-
severity:
|
|
49
|
+
severity: "info" | "warning" | "critical";
|
|
50
50
|
description: string;
|
|
51
51
|
remediation: string;
|
|
52
52
|
}>;
|
|
@@ -91,7 +91,7 @@ export declare class HybridTaintAnalyzer {
|
|
|
91
91
|
/**
|
|
92
92
|
* Get policies by use case
|
|
93
93
|
*/
|
|
94
|
-
getPoliciesByUseCase(useCase:
|
|
94
|
+
getPoliciesByUseCase(useCase: "malware" | "vulnerability" | "compliance" | "forensics" | "general"): TaintPolicy[];
|
|
95
95
|
/**
|
|
96
96
|
* Register a custom analysis policy
|
|
97
97
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* analysis scenarios including malware analysis, vulnerability assessment,
|
|
6
6
|
* and compliance auditing.
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { AnalysisEngine, HybridConfig, OrchestrationStrategy, TaintConfig } from "../types/taint-tracking";
|
|
9
9
|
/**
|
|
10
10
|
* Policy template for different analysis scenarios
|
|
11
11
|
*/
|
|
@@ -15,7 +15,7 @@ export interface TaintPolicy {
|
|
|
15
15
|
/** Policy description */
|
|
16
16
|
description: string;
|
|
17
17
|
/** Target use case */
|
|
18
|
-
useCase:
|
|
18
|
+
useCase: "malware" | "vulnerability" | "compliance" | "forensics" | "general";
|
|
19
19
|
/** Taint tracking configuration */
|
|
20
20
|
taintConfig: TaintConfig;
|
|
21
21
|
/** Hybrid orchestration strategy */
|
|
@@ -26,7 +26,7 @@ export interface TaintPolicy {
|
|
|
26
26
|
author: string;
|
|
27
27
|
created: string;
|
|
28
28
|
tags: string[];
|
|
29
|
-
riskLevel:
|
|
29
|
+
riskLevel: "low" | "medium" | "high" | "critical";
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -47,7 +47,7 @@ export declare class TaintPolicyManager {
|
|
|
47
47
|
/**
|
|
48
48
|
* Get policies by use case
|
|
49
49
|
*/
|
|
50
|
-
getPoliciesByUseCase(useCase: TaintPolicy[
|
|
50
|
+
getPoliciesByUseCase(useCase: TaintPolicy["useCase"]): TaintPolicy[];
|
|
51
51
|
/**
|
|
52
52
|
* Register a custom policy
|
|
53
53
|
*/
|
|
@@ -22,7 +22,7 @@ export interface HipaaConfig {
|
|
|
22
22
|
}
|
|
23
23
|
export interface AuditEvent {
|
|
24
24
|
timestamp: string;
|
|
25
|
-
eventType:
|
|
25
|
+
eventType: "file_scan" | "temp_file_created" | "temp_file_deleted" | "error_occurred" | "phi_detected" | "security_violation";
|
|
26
26
|
sessionId: string;
|
|
27
27
|
userId?: string;
|
|
28
28
|
details: {
|
|
@@ -66,7 +66,7 @@ declare class HipaaComplianceManager {
|
|
|
66
66
|
/**
|
|
67
67
|
* Log audit event
|
|
68
68
|
*/
|
|
69
|
-
auditLog(eventType: AuditEvent[
|
|
69
|
+
auditLog(eventType: AuditEvent["eventType"], details: Partial<AuditEvent["details"]>): void;
|
|
70
70
|
/**
|
|
71
71
|
* Write audit event to file
|
|
72
72
|
*/
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
*
|
|
29
29
|
* @module hooks
|
|
30
30
|
*/
|
|
31
|
-
import type {
|
|
32
|
-
import type {
|
|
31
|
+
import type { QuarantineEntry } from "./quarantine/types";
|
|
32
|
+
import type { ScanContext, ScanReport } from "./types";
|
|
33
33
|
export interface ScanStartContext extends ScanContext {
|
|
34
34
|
/** Unique identifier for this scan invocation (useful for correlating logs). */
|
|
35
35
|
scanId?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
* For browser-safe usage, import from 'pompelmi/browser'.
|
|
8
8
|
* For React hooks, import from 'pompelmi/react'.
|
|
9
9
|
*/
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
10
|
+
export { CONFIG_PRESETS, ConfigManager, createConfig, DEFAULT_CONFIG, getPresetConfig, type ScannerConfig, } from "./config";
|
|
11
|
+
export { type AuditEvent, createHipaaError, getHipaaManager, type HipaaConfig, HipaaTemp, initializeHipaaCompliance, } from "./hipaa-compliance";
|
|
12
|
+
export type { NodeFileEntry, NodeScanOptions } from "./node/scanDir";
|
|
13
|
+
export { DEFAULT_POLICY, definePolicy } from "./policy";
|
|
14
|
+
export { ARCHIVES, CONSERVATIVE_DEFAULT, DOCUMENTS_ONLY, getPolicyPack, IMAGES_ONLY, POLICY_PACKS, type PolicyPackName, STRICT_PUBLIC_UPLOAD, } from "./policy-packs";
|
|
15
|
+
export { type ComposeScannerOptions, composeScanners, createPresetScanner, type NamedScanner, type PresetName, type PresetOptions, } from "./presets";
|
|
16
|
+
export { type ScanOptions, scanBytes, scanFile, scanFiles } from "./scan";
|
|
17
|
+
export { scanFilesWithRemoteYara } from "./scan/remote";
|
|
18
|
+
export { CommonHeuristicsScanner } from "./scanners/common-heuristics";
|
|
19
|
+
export { createZipBombGuard } from "./scanners/zip-bomb-guard";
|
|
20
|
+
export * from "./types";
|
|
21
|
+
export { analyzeNestedArchives, detectObfuscatedScripts, detectPolyglot, } from "./utils/advanced-detection";
|
|
22
|
+
export { BatchScanner, type BatchScanOptions, type BatchScanResult, batchScan, type ScanTask, } from "./utils/batch-scanner";
|
|
23
|
+
export { type CacheEntry, type CacheOptions, type CacheStats, getDefaultCache, resetDefaultCache, ScanCacheManager, } from "./utils/cache-manager";
|
|
24
|
+
export { type ExportFormat, type ExportOptions, exportScanResults, ScanResultExporter, } from "./utils/export";
|
|
25
|
+
export { aggregateScanStats, type PerformanceMetrics, PerformanceTracker, type ScanStatistics, } from "./utils/performance-metrics";
|
|
26
|
+
export { createThreatIntelligence, type EnhancedScanReport, getFileHash, LocalThreatIntelligence, type ThreatInfo, ThreatIntelligenceAggregator, type ThreatIntelligenceSource, } from "./utils/threat-intelligence";
|
|
27
|
+
export { validateFile } from "./validate";
|
|
28
|
+
export { mapMatchesToVerdict } from "./verdict";
|
|
29
|
+
export type { YaraMatch } from "./yara/index";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { YaraMatch } from
|
|
1
|
+
import type { YaraMatch } from "../yara/index";
|
|
2
2
|
export interface NodeScanOptions {
|
|
3
3
|
enableYara?: boolean;
|
|
4
4
|
yaraRules?: string;
|
|
@@ -9,14 +9,14 @@ export interface NodeScanOptions {
|
|
|
9
9
|
yaraSampleBytes?: number;
|
|
10
10
|
yaraPreferBuffer?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export type NodeYaraVerdict =
|
|
12
|
+
export type NodeYaraVerdict = "malicious" | "suspicious" | "clean";
|
|
13
13
|
export interface NodeYaraResult {
|
|
14
14
|
matches: YaraMatch[];
|
|
15
|
-
status:
|
|
15
|
+
status: "scanned" | "skipped" | "error";
|
|
16
16
|
/** per i 'skipped', perché abbiamo saltato */
|
|
17
|
-
reason?:
|
|
17
|
+
reason?: "max-size" | "filtered-ext" | "not-enabled" | "engine-missing" | "error";
|
|
18
18
|
/** come abbiamo scansionato quando status = 'scanned' */
|
|
19
|
-
mode?:
|
|
19
|
+
mode?: "async" | "file" | "buffer" | "buffer-sampled";
|
|
20
20
|
/** verdetto derivato dai match (solo quando status='scanned') */
|
|
21
21
|
verdict?: NodeYaraVerdict;
|
|
22
22
|
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module policy-packs
|
|
25
25
|
*/
|
|
26
|
-
import { type Policy } from
|
|
26
|
+
import { type Policy } from "./policy";
|
|
27
27
|
/**
|
|
28
28
|
* Documents-only policy.
|
|
29
29
|
*
|
|
@@ -81,7 +81,7 @@ export declare const CONSERVATIVE_DEFAULT: Policy;
|
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
83
|
export declare const ARCHIVES: Policy;
|
|
84
|
-
export type PolicyPackName =
|
|
84
|
+
export type PolicyPackName = "documents-only" | "images-only" | "strict-public-upload" | "conservative-default" | "archives";
|
|
85
85
|
/**
|
|
86
86
|
* Named map of all built-in policy packs.
|
|
87
87
|
*
|
package/dist/types/presets.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type PresetName =
|
|
1
|
+
import type { AnalysisDepth, ScanFn, Scanner, Verdict } from "./types";
|
|
2
|
+
export type PresetName = "basic" | "advanced" | "malware-analysis" | "decompilation-basic" | "decompilation-deep" | string;
|
|
3
3
|
export interface PresetOptions {
|
|
4
4
|
yaraRules?: string | string[];
|
|
5
5
|
yaraTimeout?: number;
|
|
6
6
|
enableDecompilation?: boolean;
|
|
7
|
-
decompilationEngine?:
|
|
7
|
+
decompilationEngine?: "binaryninja-hlil" | "ghidra-pcode" | "both";
|
|
8
8
|
decompilationDepth?: AnalysisDepth;
|
|
9
9
|
decompilationTimeout?: number;
|
|
10
10
|
binaryNinjaPath?: string;
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* This module is Node.js-only (uses fs/crypto/path).
|
|
14
14
|
* It is NOT included in the 'pompelmi/browser' or 'pompelmi/react' bundles.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
16
|
+
export { FilesystemQuarantineStorage, type FilesystemQuarantineStorageOptions, type QuarantineStorage, } from "./storage";
|
|
17
|
+
export type { QuarantineDecision, QuarantinedFileInfo, QuarantineEntry, QuarantineFilter, QuarantineReport, QuarantineReview, QuarantineStatus, } from "./types";
|
|
18
|
+
export { QuarantineManager, type QuarantineManagerOptions } from "./workflow";
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module quarantine/storage
|
|
13
13
|
*/
|
|
14
|
-
import type { QuarantineEntry, QuarantineFilter } from
|
|
14
|
+
import type { QuarantineEntry, QuarantineFilter } from "./types";
|
|
15
15
|
/**
|
|
16
16
|
* Storage adapter for the quarantine workflow.
|
|
17
17
|
* Implement this interface to support any backend (S3, GCS, DB, etc.).
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module quarantine/types
|
|
12
12
|
*/
|
|
13
|
-
import type { ScanReport } from
|
|
13
|
+
import type { ScanReport } from "../types";
|
|
14
14
|
/** The review status of a quarantined file. */
|
|
15
|
-
export type QuarantineStatus =
|
|
15
|
+
export type QuarantineStatus = "pending" | "reviewing" | "promoted" | "deleted";
|
|
16
16
|
/** Immutable metadata about the file at upload time. */
|
|
17
17
|
export interface QuarantinedFileInfo {
|
|
18
18
|
/** Original filename supplied by the uploader. */
|
|
@@ -52,7 +52,7 @@ export interface QuarantineEntry {
|
|
|
52
52
|
tags?: string[];
|
|
53
53
|
}
|
|
54
54
|
/** The outcome of a manual review. */
|
|
55
|
-
export type QuarantineDecision =
|
|
55
|
+
export type QuarantineDecision = "promote" | "delete";
|
|
56
56
|
/** Input required to resolve a quarantine entry. */
|
|
57
57
|
export interface QuarantineReview {
|
|
58
58
|
decision: QuarantineDecision;
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @module quarantine/workflow
|
|
27
27
|
*/
|
|
28
|
-
import type { ScanReport } from
|
|
29
|
-
import type {
|
|
30
|
-
import type {
|
|
28
|
+
import type { ScanReport } from "../types";
|
|
29
|
+
import type { QuarantineStorage } from "./storage";
|
|
30
|
+
import type { QuarantinedFileInfo, QuarantineEntry, QuarantineFilter, QuarantineReport, QuarantineReview } from "./types";
|
|
31
31
|
export interface QuarantineManagerOptions {
|
|
32
32
|
/** Storage adapter — use `FilesystemQuarantineStorage` for local deployments. */
|
|
33
33
|
storage: QuarantineStorage;
|
|
@@ -64,7 +64,7 @@ export declare class QuarantineManager {
|
|
|
64
64
|
* @param report The scan report that triggered quarantine.
|
|
65
65
|
* @param fileInfo Partial metadata; `sha256` is derived from `bytes` if omitted.
|
|
66
66
|
*/
|
|
67
|
-
quarantine(bytes: Uint8Array, report: ScanReport, fileInfo: Omit<QuarantinedFileInfo,
|
|
67
|
+
quarantine(bytes: Uint8Array, report: ScanReport, fileInfo: Omit<QuarantinedFileInfo, "sha256"> & {
|
|
68
68
|
sha256?: string;
|
|
69
69
|
}): Promise<QuarantineEntry>;
|
|
70
70
|
/**
|
package/dist/types/risk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { YaraMatch } from
|
|
2
|
-
import type { RemoteEngineOptions } from
|
|
1
|
+
import type { YaraMatch } from "../yara/index";
|
|
2
|
+
import type { RemoteEngineOptions } from "../yara/remote";
|
|
3
3
|
export interface RemoteScanResult {
|
|
4
4
|
file: File;
|
|
5
5
|
matches: YaraMatch[];
|
package/dist/types/scan.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
1
|
+
import type { ScannerConfig } from "./config";
|
|
2
|
+
import { type PresetName } from "./presets";
|
|
3
|
+
import type { ScanContext, ScanReport } from "./types";
|
|
4
4
|
export type ScanOptions = {
|
|
5
5
|
preset?: PresetName;
|
|
6
6
|
ctx?: ScanContext;
|
|
@@ -12,6 +12,6 @@ export type ScanOptions = {
|
|
|
12
12
|
/** Scan di bytes (browser/node) usando preset (default: zip-basic) */
|
|
13
13
|
export declare function scanBytes(input: Uint8Array, opts?: ScanOptions): Promise<ScanReport>;
|
|
14
14
|
/** Scan di un file su disco (Node). Import dinamico per non vincolare il bundle browser. */
|
|
15
|
-
export declare function scanFile(filePath: string, opts?: Omit<ScanOptions,
|
|
15
|
+
export declare function scanFile(filePath: string, opts?: Omit<ScanOptions, "ctx">): Promise<ScanReport>;
|
|
16
16
|
/** Scan multipli File (browser) usando scanBytes + preset di default */
|
|
17
|
-
export declare function scanFiles(files: ArrayLike<File>, opts?: Omit<ScanOptions,
|
|
17
|
+
export declare function scanFiles(files: ArrayLike<File>, opts?: Omit<ScanOptions, "ctx">): Promise<ScanReport[]>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type HeuristicMatch = {
|
|
7
7
|
rule: string;
|
|
8
|
-
severity?:
|
|
8
|
+
severity?: "info" | "low" | "medium" | "high" | "critical" | "suspicious" | "malicious";
|
|
9
9
|
meta?: Record<string, unknown>;
|
|
10
10
|
};
|
|
11
11
|
export interface SimpleScanner {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit trail for Pompelmi scan and quarantine events.
|
|
3
|
+
*
|
|
4
|
+
* Produces structured, append-only audit records suitable for:
|
|
5
|
+
* - compliance logging (HIPAA, SOC 2, ISO 27001)
|
|
6
|
+
* - SIEM ingestion
|
|
7
|
+
* - operational dashboards
|
|
8
|
+
* - incident response
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { AuditTrail } from 'pompelmi/audit';
|
|
13
|
+
*
|
|
14
|
+
* const audit = new AuditTrail({ dest: 'file', path: './audit.jsonl' });
|
|
15
|
+
* audit.logScanComplete({ filename: 'upload.zip', verdict: 'suspicious', ... });
|
|
16
|
+
* audit.logQuarantine({ entryId: '...', sha256: '...', ... });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @module audit
|
|
20
|
+
*/
|
|
21
|
+
import type { QuarantineEntry } from "./quarantine/types";
|
|
22
|
+
import type { ScanReport } from "./types";
|
|
23
|
+
export type AuditEventType = "scan.complete" | "scan.error" | "threat.detected" | "quarantine.created" | "quarantine.resolved" | "quarantine.deleted";
|
|
24
|
+
interface BaseAuditRecord {
|
|
25
|
+
/** ISO-8601 timestamp. */
|
|
26
|
+
timestamp: string;
|
|
27
|
+
/** Event type for structured log routing. */
|
|
28
|
+
event: AuditEventType;
|
|
29
|
+
/** Application-assigned session or request id for correlation. */
|
|
30
|
+
correlationId?: string;
|
|
31
|
+
/** Uploader identity. */
|
|
32
|
+
uploadedBy?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ScanAuditRecord extends BaseAuditRecord {
|
|
35
|
+
event: "scan.complete" | "scan.error" | "threat.detected";
|
|
36
|
+
filename?: string;
|
|
37
|
+
mimeType?: string;
|
|
38
|
+
sizeBytes?: number;
|
|
39
|
+
sha256?: string;
|
|
40
|
+
verdict: ScanReport["verdict"];
|
|
41
|
+
matchCount: number;
|
|
42
|
+
durationMs?: number;
|
|
43
|
+
engine?: string;
|
|
44
|
+
error?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface QuarantineAuditRecord extends BaseAuditRecord {
|
|
47
|
+
event: "quarantine.created" | "quarantine.resolved" | "quarantine.deleted";
|
|
48
|
+
quarantineId: string;
|
|
49
|
+
filename?: string;
|
|
50
|
+
sha256: string;
|
|
51
|
+
decision?: "promote" | "delete";
|
|
52
|
+
reviewedBy?: string;
|
|
53
|
+
reviewNote?: string;
|
|
54
|
+
}
|
|
55
|
+
export type AuditRecord = ScanAuditRecord | QuarantineAuditRecord;
|
|
56
|
+
export type AuditDest = {
|
|
57
|
+
dest: "console";
|
|
58
|
+
} | {
|
|
59
|
+
dest: "file";
|
|
60
|
+
path: string;
|
|
61
|
+
} | {
|
|
62
|
+
dest: "custom";
|
|
63
|
+
write: (record: AuditRecord) => void | Promise<void>;
|
|
64
|
+
};
|
|
65
|
+
export interface AuditTrailOptions {
|
|
66
|
+
/** Where to write audit records. Default: 'console'. */
|
|
67
|
+
output?: AuditDest;
|
|
68
|
+
/** If true, pretty-print JSON. Useful for debugging. Default: false. */
|
|
69
|
+
pretty?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export declare class AuditTrail {
|
|
72
|
+
private readonly options;
|
|
73
|
+
constructor(options?: AuditTrailOptions);
|
|
74
|
+
/** Log a completed scan. */
|
|
75
|
+
logScanComplete(report: ScanReport, extra?: Pick<ScanAuditRecord, "filename" | "sizeBytes" | "sha256" | "correlationId" | "uploadedBy">): void;
|
|
76
|
+
/** Log a scan error. */
|
|
77
|
+
logScanError(error: unknown, extra?: Pick<ScanAuditRecord, "filename" | "correlationId" | "uploadedBy">): void;
|
|
78
|
+
/** Log a new quarantine entry. */
|
|
79
|
+
logQuarantine(entry: QuarantineEntry, correlationId?: string): void;
|
|
80
|
+
/** Log a quarantine resolution (promote or delete). */
|
|
81
|
+
logQuarantineResolved(entry: QuarantineEntry, correlationId?: string): void;
|
|
82
|
+
private write;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* src/browser-index.ts — Browser-safe entry point for Pompelmi.
|
|
3
|
+
*
|
|
4
|
+
* This bundle contains ONLY modules that are safe to use in a browser/bundler
|
|
5
|
+
* environment. It does NOT include:
|
|
6
|
+
* - HIPAA compliance module (uses Node.js crypto/os/path)
|
|
7
|
+
* - Cache manager (uses Node.js crypto for content hashing)
|
|
8
|
+
* - Threat intelligence (uses Node.js crypto)
|
|
9
|
+
* - ZIP streaming (uses unzipper, a Node.js stream library)
|
|
10
|
+
* - YARA native bindings
|
|
11
|
+
* - Batch scanner (Node.js-optimised concurrency)
|
|
12
|
+
*
|
|
13
|
+
* For the full Node.js API (all of the above included), import from 'pompelmi'
|
|
14
|
+
* or 'pompelmi/node'.
|
|
15
|
+
*
|
|
16
|
+
* For the React hook, import from 'pompelmi/react'.
|
|
17
|
+
*/
|
|
18
|
+
export { DEFAULT_POLICY, definePolicy } from "./policy";
|
|
19
|
+
export { ARCHIVES, CONSERVATIVE_DEFAULT, DOCUMENTS_ONLY, getPolicyPack, IMAGES_ONLY, POLICY_PACKS, type PolicyPackName, STRICT_PUBLIC_UPLOAD, } from "./policy-packs";
|
|
20
|
+
export { type ComposeScannerOptions, composeScanners, createPresetScanner, type NamedScanner, type PresetName, type PresetOptions, } from "./presets";
|
|
21
|
+
export { type ScanOptions, scanBytes, scanFile, scanFiles } from "./scan";
|
|
22
|
+
export { CommonHeuristicsScanner } from "./scanners/common-heuristics";
|
|
23
|
+
export { createZipBombGuard } from "./scanners/zip-bomb-guard";
|
|
24
|
+
export type { FileInfo, Match, ScanContext, ScanFn, Scanner, ScanReport, Uint8ArrayLike, Verdict, YaraMatch, } from "./types";
|
|
25
|
+
export { analyzeNestedArchives, detectObfuscatedScripts, detectPolyglot, } from "./utils/advanced-detection";
|
|
26
|
+
export { type ExportFormat, type ExportOptions, exportScanResults, ScanResultExporter, } from "./utils/export";
|
|
27
|
+
export { aggregateScanStats, type PerformanceMetrics, PerformanceTracker, type ScanStatistics, } from "./utils/performance-metrics";
|
|
28
|
+
export { validateFile } from "./validate";
|
|
29
|
+
export { mapMatchesToVerdict } from "./verdict";
|