@iota-big3/sdk-security
Version:
Advanced security features including zero trust, quantum-safe crypto, and ML threat detection
584 lines • 13.8 kB
TypeScript
/**
* Penetration Testing Types
* Enterprise-grade security testing and vulnerability assessment
*/
/**
* Test types
*/
export declare enum PenTestType {
NETWORK = "NETWORK",
WEB_APPLICATION = "WEB_APPLICATION",
API = "API",
WIRELESS = "WIRELESS",
SOCIAL_ENGINEERING = "SOCIAL_ENGINEERING",
PHYSICAL = "PHYSICAL",
CLOUD = "CLOUD",
MOBILE = "MOBILE",
IOT = "IOT"
}
/**
* Test methodology
*/
export declare enum TestMethodology {
BLACK_BOX = "BLACK_BOX",// No prior knowledge
WHITE_BOX = "WHITE_BOX",// Full knowledge
GRAY_BOX = "GRAY_BOX"
}
/**
* Vulnerability severity
*/
export declare enum VulnerabilitySeverity {
CRITICAL = "CRITICAL",
HIGH = "HIGH",
MEDIUM = "MEDIUM",
LOW = "LOW",
INFO = "INFO"
}
/**
* Attack vectors
*/
export declare enum AttackVector {
NETWORK = "NETWORK",
ADJACENT = "ADJACENT",
LOCAL = "LOCAL",
PHYSICAL = "PHYSICAL"
}
/**
* Exploit status
*/
export declare enum ExploitStatus {
NOT_ATTEMPTED = "NOT_ATTEMPTED",
ATTEMPTED = "ATTEMPTED",
SUCCESSFUL = "SUCCESSFUL",
FAILED = "FAILED",
PARTIAL = "PARTIAL"
}
/**
* Penetration test configuration
*/
export interface PenTestConfig {
scope: TestScope;
methodology: TestMethodology;
testTypes: PenTestType[];
authorization: TestAuthorization;
constraints?: TestConstraints;
reporting: ReportingConfig;
}
/**
* Test scope definition
*/
export interface TestScope {
targets: TestTarget[];
ipRanges?: string[];
domains?: string[];
applications?: ApplicationTarget[];
exclusions?: string[];
timeWindow?: {
start: Date;
end: Date;
blackoutPeriods?: TimeWindow[];
};
}
/**
* Test target
*/
export interface TestTarget {
id: string;
type: 'HOST' | 'NETWORK' | 'APPLICATION' | 'API' | 'CLOUD';
address: string;
description?: string;
credentials?: Credential[];
metadata?: Record<string, any>;
}
/**
* Application target
*/
export interface ApplicationTarget {
url: string;
name: string;
technology?: string[];
authentication?: AuthenticationInfo;
apiEndpoints?: string[];
}
/**
* Test authorization
*/
export interface TestAuthorization {
authorized: boolean;
authorizedBy: string;
authorizationDate: Date;
documentReference?: string;
contactInfo: ContactInfo;
emergencyContact: ContactInfo;
}
/**
* Contact information
*/
export interface ContactInfo {
name: string;
email: string;
phone: string;
role?: string;
}
/**
* Test constraints
*/
export interface TestConstraints {
rateLimit?: {
requestsPerSecond?: number;
concurrentThreads?: number;
};
exploitationAllowed: boolean;
dosAllowed: boolean;
bruteForceAllowed: boolean;
dataExfiltrationAllowed: boolean;
dataDeletionAllowed: boolean;
excludedTechniques?: string[];
excludedVulnerabilities?: string[];
}
/**
* Reporting configuration
*/
export interface ReportingConfig {
format: ReportFormat[];
detail: ReportDetail;
includeProofOfConcept: boolean;
includeRemediation: boolean;
executiveSummary: boolean;
technicalAppendix: boolean;
}
export declare enum ReportFormat {
PDF = "PDF",
HTML = "HTML",
JSON = "JSON",
XML = "XML",
MARKDOWN = "MARKDOWN"
}
export declare enum ReportDetail {
EXECUTIVE = "EXECUTIVE",
SUMMARY = "SUMMARY",
DETAILED = "DETAILED",
TECHNICAL = "TECHNICAL"
}
/**
* Vulnerability definition
*/
export interface Vulnerability {
id: string;
title: string;
description: string;
severity: VulnerabilitySeverity;
cvss?: CVSSScore;
category: VulnerabilityCategory;
cwe?: string;
cve?: string[];
discoveredAt: Date;
discoveredBy: string;
testType: PenTestType;
affectedTarget: TestTarget;
affectedComponent?: string;
attackVector: AttackVector;
exploitComplexity: 'LOW' | 'HIGH';
privilegesRequired: 'NONE' | 'LOW' | 'HIGH';
userInteraction: 'NONE' | 'REQUIRED';
evidence: Evidence[];
exploitStatus: ExploitStatus;
exploitDetails?: ExploitDetails;
impact: Impact;
remediation: Remediation;
riskScore: number;
likelihood: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
}
/**
* CVSS Score
*/
export interface CVSSScore {
version: '3.0' | '3.1';
baseScore: number;
vector: string;
temporalScore?: number;
environmentalScore?: number;
}
/**
* Vulnerability categories
*/
export declare enum VulnerabilityCategory {
INJECTION = "INJECTION",
BROKEN_AUTHENTICATION = "BROKEN_AUTHENTICATION",
SENSITIVE_DATA_EXPOSURE = "SENSITIVE_DATA_EXPOSURE",
XXE = "XXE",
BROKEN_ACCESS_CONTROL = "BROKEN_ACCESS_CONTROL",
SECURITY_MISCONFIGURATION = "SECURITY_MISCONFIGURATION",
XSS = "XSS",
INSECURE_DESERIALIZATION = "INSECURE_DESERIALIZATION",
USING_VULNERABLE_COMPONENTS = "USING_VULNERABLE_COMPONENTS",
INSUFFICIENT_LOGGING = "INSUFFICIENT_LOGGING",
SSRF = "SSRF",
CSRF = "CSRF",
BUFFER_OVERFLOW = "BUFFER_OVERFLOW",
PRIVILEGE_ESCALATION = "PRIVILEGE_ESCALATION",
INFORMATION_DISCLOSURE = "INFORMATION_DISCLOSURE",
DENIAL_OF_SERVICE = "DENIAL_OF_SERVICE",
BUSINESS_LOGIC = "BUSINESS_LOGIC",
OTHER = "OTHER"
}
/**
* Evidence of vulnerability
*/
export interface Evidence {
type: EvidenceType;
data: string;
screenshot?: string;
timestamp: Date;
description?: string;
}
export declare enum EvidenceType {
REQUEST = "REQUEST",
RESPONSE = "RESPONSE",
SCREENSHOT = "SCREENSHOT",
LOG = "LOG",
CODE = "CODE",
CONFIGURATION = "CONFIGURATION",
NETWORK_CAPTURE = "NETWORK_CAPTURE",
OTHER = "OTHER"
}
/**
* Exploit details
*/
export interface ExploitDetails {
exploitCode?: string;
exploitSteps: string[];
toolsUsed: string[];
timeToExploit: number;
reliability: 'LOW' | 'MEDIUM' | 'HIGH';
prerequisites?: string[];
}
/**
* Impact assessment
*/
export interface Impact {
confidentiality: ImpactLevel;
integrity: ImpactLevel;
availability: ImpactLevel;
businessImpact?: {
financial?: string;
reputation?: string;
regulatory?: string;
operational?: string;
};
affectedData?: string[];
affectedUsers?: number;
dataClassification?: string;
}
export declare enum ImpactLevel {
NONE = "NONE",
LOW = "LOW",
HIGH = "HIGH",
CRITICAL = "CRITICAL"
}
/**
* Remediation guidance
*/
export interface Remediation {
summary: string;
steps: string[];
effort: 'LOW' | 'MEDIUM' | 'HIGH';
priority: 'IMMEDIATE' | 'HIGH' | 'MEDIUM' | 'LOW';
references?: string[];
patches?: PatchInfo[];
workarounds?: string[];
validationSteps?: string[];
retestRequired: boolean;
}
/**
* Patch information
*/
export interface PatchInfo {
vendor: string;
product: string;
version: string;
patchUrl?: string;
releaseDate?: Date;
}
/**
* Penetration test session
*/
export interface PenTestSession {
id: string;
projectName: string;
startTime: Date;
endTime?: Date;
status: TestStatus;
config: PenTestConfig;
testers: Tester[];
vulnerabilities: Vulnerability[];
statistics: TestStatistics;
timeline: TestEvent[];
reports: TestReport[];
}
export declare enum TestStatus {
PLANNING = "PLANNING",
IN_PROGRESS = "IN_PROGRESS",
COMPLETED = "COMPLETED",
PAUSED = "PAUSED",
ABORTED = "ABORTED"
}
/**
* Tester information
*/
export interface Tester {
id: string;
name: string;
role: 'LEAD' | 'TESTER' | 'REVIEWER';
certifications?: string[];
specializations?: PenTestType[];
}
/**
* Test statistics
*/
export interface TestStatistics {
totalTargets: number;
targetsScanned: number;
vulnerabilitiesFound: number;
criticalVulnerabilities: number;
highVulnerabilities: number;
exploitsSuccessful: number;
testDuration: number;
vulnerabilitiesByCategory: Record<VulnerabilityCategory, number>;
coveragePercentage: number;
testTypesCompleted: PenTestType[];
}
/**
* Test event for timeline
*/
export interface TestEvent {
timestamp: Date;
type: EventType;
description: string;
tester: string;
target?: string;
severity?: VulnerabilitySeverity;
metadata?: Record<string, any>;
}
export declare enum EventType {
TEST_STARTED = "TEST_STARTED",
TEST_COMPLETED = "TEST_COMPLETED",
SCAN_STARTED = "SCAN_STARTED",
SCAN_COMPLETED = "SCAN_COMPLETED",
VULNERABILITY_FOUND = "VULNERABILITY_FOUND",
EXPLOIT_ATTEMPTED = "EXPLOIT_ATTEMPTED",
EXPLOIT_SUCCESSFUL = "EXPLOIT_SUCCESSFUL",
EXPLOIT_FAILED = "EXPLOIT_FAILED",
ESCALATION = "ESCALATION",
FINDING_VERIFIED = "FINDING_VERIFIED",
OTHER = "OTHER"
}
/**
* Test report
*/
export interface TestReport {
id: string;
title: string;
type: ReportDetail;
generatedAt: Date;
generatedBy: string;
format: ReportFormat;
executiveSummary?: string;
methodology?: string;
scope?: string;
findings: ReportFinding[];
recommendations: string[];
conclusion: string;
appendices?: ReportAppendix[];
reviewedBy?: string;
approvedBy?: string;
}
/**
* Report finding
*/
export interface ReportFinding {
vulnerability: Vulnerability;
risk: RiskRating;
exploited: boolean;
businessContext?: string;
remediationTimeline?: string;
}
/**
* Risk rating
*/
export interface RiskRating {
score: number;
level: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
justification: string;
}
/**
* Report appendix
*/
export interface ReportAppendix {
title: string;
content: string;
type: 'TECHNICAL' | 'METHODOLOGY' | 'TOOLS' | 'REFERENCES';
}
/**
* Scanning tools and techniques
*/
export interface ScanningTool {
name: string;
type: ToolType;
version?: string;
configuration?: Record<string, any>;
}
export declare enum ToolType {
NETWORK_SCANNER = "NETWORK_SCANNER",
WEB_SCANNER = "WEB_SCANNER",
VULNERABILITY_SCANNER = "VULNERABILITY_SCANNER",
EXPLOIT_FRAMEWORK = "EXPLOIT_FRAMEWORK",
PROXY = "PROXY",
FUZZER = "FUZZER",
PASSWORD_CRACKER = "PASSWORD_CRACKER",
CUSTOM = "CUSTOM"
}
/**
* Credential for testing
*/
export interface Credential {
type: 'USERNAME_PASSWORD' | 'API_KEY' | 'CERTIFICATE' | 'TOKEN';
username?: string;
password?: string;
apiKey?: string;
token?: string;
certificate?: string;
description?: string;
}
/**
* Time window
*/
export interface TimeWindow {
start: Date;
end: Date;
reason?: string;
}
/**
* Authentication info
*/
export interface AuthenticationInfo {
method: 'BASIC' | 'BEARER' | 'OAUTH2' | 'SAML' | 'CUSTOM';
endpoint?: string;
credentials?: Credential;
metadata?: Record<string, any>;
}
/**
* Penetration test manager interface
*/
export interface PenTestManager {
createSession(config: PenTestConfig): Promise<PenTestSession>;
getSession(id: string): Promise<PenTestSession>;
updateSession(id: string, updates: Partial<PenTestSession>): Promise<void>;
startTest(sessionId: string): Promise<void>;
pauseTest(sessionId: string): Promise<void>;
resumeTest(sessionId: string): Promise<void>;
stopTest(sessionId: string): Promise<void>;
scanTarget(sessionId: string, target: TestTarget): Promise<ScanResult>;
scanNetwork(sessionId: string, range: string): Promise<NetworkScanResult>;
scanWebApp(sessionId: string, url: string): Promise<WebScanResult>;
reportVulnerability(sessionId: string, vuln: Vulnerability): Promise<void>;
verifyVulnerability(vulnId: string): Promise<boolean>;
exploitVulnerability(vulnId: string): Promise<ExploitResult>;
generateReport(sessionId: string, config: ReportingConfig): Promise<TestReport>;
exportReport(reportId: string, format: ReportFormat): Promise<Buffer>;
}
/**
* Scan result
*/
export interface ScanResult {
target: TestTarget;
startTime: Date;
endTime: Date;
vulnerabilities: Vulnerability[];
openPorts?: number[];
services?: Service[];
metadata?: Record<string, any>;
}
/**
* Network scan result
*/
export interface NetworkScanResult extends ScanResult {
discoveredHosts: string[];
networkMap?: NetworkTopology;
}
/**
* Web scan result
*/
export interface WebScanResult extends ScanResult {
crawledUrls: string[];
forms: WebForm[];
cookies: Cookie[];
headers: Record<string, string>;
}
/**
* Exploit result
*/
export interface ExploitResult {
success: boolean;
output?: string;
shellAccess?: boolean;
privilegeLevel?: string;
artifacts?: string[];
screenshot?: string;
}
/**
* Service information
*/
export interface Service {
port: number;
protocol: string;
name: string;
version?: string;
banner?: string;
}
/**
* Network topology
*/
export interface NetworkTopology {
nodes: NetworkNode[];
edges: NetworkEdge[];
}
export interface NetworkNode {
id: string;
ip: string;
hostname?: string;
type: 'HOST' | 'ROUTER' | 'SWITCH' | 'FIREWALL';
os?: string;
}
export interface NetworkEdge {
source: string;
target: string;
type: 'DIRECT' | 'ROUTED';
}
/**
* Web form
*/
export interface WebForm {
action: string;
method: string;
inputs: FormInput[];
}
export interface FormInput {
name: string;
type: string;
value?: string;
required?: boolean;
}
/**
* Cookie
*/
export interface Cookie {
name: string;
value: string;
domain: string;
path: string;
secure: boolean;
httpOnly: boolean;
sameSite?: string;
}
//# sourceMappingURL=types.d.ts.map