/** * Package.json Security Analyzer * Deep analysis of npm package manifests for supply chain threats * * Detects typosquatting, malicious scripts, suspicious dependencies */ import { Severity, ThreatType, FindingCategory } from '../../types'; /** * Package.json analysis finding */ export interface PackageJsonFinding { /** Finding type */ type: PackageJsonFindingType; /** Finding name */ name: string; /** Description */ description: string; /** Severity */ severity: Severity; /** Threat type */ threatType: ThreatType; /** Category */ category: FindingCategory; /** Affected field */ field: string; /** Value that triggered the finding */ value: string; /** Confidence 0-100 */ confidence: number; /** Remediation advice */ remediation: string; /** Additional context */ context?: Record; } /** * Types of package.json findings */ export declare enum PackageJsonFindingType { MALICIOUS_SCRIPT = "malicious_script", TYPOSQUATTING = "typosquatting", SUSPICIOUS_DEPENDENCY = "suspicious_dependency", PRIVATE_REGISTRY = "private_registry", GIT_DEPENDENCY = "git_dependency", LOCAL_PATH_DEPENDENCY = "local_path_dependency", OVERLY_PERMISSIVE_VERSION = "overly_permissive_version", DANGEROUS_POSTINSTALL = "dangerous_postinstall", OUTDATED_DEPENDENCY = "outdated_dependency", DEPRECATED_PACKAGE = "deprecated_package", INSTALL_SCRIPT_ABUSE = "install_script_abuse", SUSPICIOUS_MAINTAINER = "suspicious_maintainer" } /** * Package.json Analyzer Class */ export declare class PackageJsonAnalyzer { private findings; /** * Analyze a package.json file */ analyze(content: string, filePath: string): PackageJsonFinding[]; /** * Analyze npm scripts for malicious patterns */ private analyzeScripts; /** * Analyze dependencies for security issues */ private analyzeDependencies; /** * Check for typosquatting against popular packages */ private checkTyposquatting; /** * Check bundled dependencies */ private checkBundledDependencies; /** * Analyze package metadata for suspicious patterns */ private analyzeMetadata; /** * Check if content looks obfuscated */ private looksObfuscated; } export default PackageJsonAnalyzer; //# sourceMappingURL=packageJsonAnalyzer.d.ts.map