mcp-wordpress 2.2.0 → 2.3.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/dist/security/AISecurityScanner.d.ts +175 -0
- package/dist/security/AISecurityScanner.d.ts.map +1 -0
- package/dist/security/AISecurityScanner.js +645 -0
- package/dist/security/AISecurityScanner.js.map +1 -0
- package/dist/security/AutomatedRemediation.d.ts +145 -0
- package/dist/security/AutomatedRemediation.d.ts.map +1 -0
- package/dist/security/AutomatedRemediation.js +535 -0
- package/dist/security/AutomatedRemediation.js.map +1 -0
- package/dist/security/SecurityCIPipeline.d.ts +213 -0
- package/dist/security/SecurityCIPipeline.d.ts.map +1 -0
- package/dist/security/SecurityCIPipeline.js +684 -0
- package/dist/security/SecurityCIPipeline.js.map +1 -0
- package/dist/security/SecurityConfigManager.d.ts +294 -0
- package/dist/security/SecurityConfigManager.d.ts.map +1 -0
- package/dist/security/SecurityConfigManager.js +553 -0
- package/dist/security/SecurityConfigManager.js.map +1 -0
- package/dist/security/SecurityMonitoring.d.ts +245 -0
- package/dist/security/SecurityMonitoring.d.ts.map +1 -0
- package/dist/security/SecurityMonitoring.js +596 -0
- package/dist/security/SecurityMonitoring.js.map +1 -0
- package/dist/security/SecurityReviewer.d.ts +168 -0
- package/dist/security/SecurityReviewer.d.ts.map +1 -0
- package/dist/security/SecurityReviewer.js +683 -0
- package/dist/security/SecurityReviewer.js.map +1 -0
- package/dist/security/index.d.ts +182 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +189 -0
- package/dist/security/index.js.map +1 -0
- package/package.json +8 -3
- package/src/security/AISecurityScanner.ts +780 -0
- package/src/security/AutomatedRemediation.ts +665 -0
- package/src/security/SecurityCIPipeline.ts +969 -0
- package/src/security/SecurityConfigManager.ts +829 -0
- package/src/security/SecurityMonitoring.ts +841 -0
- package/src/security/SecurityReviewer.ts +855 -0
- package/src/security/index.ts +249 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Monitoring and Alerting System
|
|
3
|
+
* Provides real-time security monitoring, threat detection, and incident response
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
export interface SecurityEvent {
|
|
7
|
+
id: string;
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
type: "authentication" | "authorization" | "input-validation" | "data-access" | "system" | "anomaly";
|
|
10
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
11
|
+
source: string;
|
|
12
|
+
details: {
|
|
13
|
+
userId?: string;
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
ipAddress?: string;
|
|
16
|
+
userAgent?: string;
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
method?: string;
|
|
19
|
+
payload?: any;
|
|
20
|
+
error?: string;
|
|
21
|
+
metadata?: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
riskScore: number;
|
|
25
|
+
handled: boolean;
|
|
26
|
+
actions: SecurityAction[];
|
|
27
|
+
}
|
|
28
|
+
interface SecurityAction {
|
|
29
|
+
id: string;
|
|
30
|
+
type: "block" | "throttle" | "alert" | "log" | "investigate" | "escalate";
|
|
31
|
+
timestamp: Date;
|
|
32
|
+
automated: boolean;
|
|
33
|
+
result: "success" | "failure" | "pending";
|
|
34
|
+
details: string;
|
|
35
|
+
}
|
|
36
|
+
interface SecurityAlert {
|
|
37
|
+
id: string;
|
|
38
|
+
eventId: string;
|
|
39
|
+
timestamp: Date;
|
|
40
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
category: string;
|
|
44
|
+
affectedSystems: string[];
|
|
45
|
+
indicators: {
|
|
46
|
+
type: string;
|
|
47
|
+
value: string;
|
|
48
|
+
confidence: number;
|
|
49
|
+
}[];
|
|
50
|
+
recommendations: string[];
|
|
51
|
+
status: "new" | "investigating" | "resolved" | "false-positive";
|
|
52
|
+
assignee?: string;
|
|
53
|
+
resolution?: {
|
|
54
|
+
timestamp: Date;
|
|
55
|
+
action: string;
|
|
56
|
+
details: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface ThreatIntelligence {
|
|
60
|
+
id: string;
|
|
61
|
+
type: "ip" | "domain" | "hash" | "pattern" | "signature";
|
|
62
|
+
value: string;
|
|
63
|
+
confidence: number;
|
|
64
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
65
|
+
source: string;
|
|
66
|
+
description: string;
|
|
67
|
+
indicators: string[];
|
|
68
|
+
lastSeen: Date;
|
|
69
|
+
expiry?: Date;
|
|
70
|
+
}
|
|
71
|
+
interface SecurityMetrics {
|
|
72
|
+
timestamp: Date;
|
|
73
|
+
events: {
|
|
74
|
+
total: number;
|
|
75
|
+
byType: Record<string, number>;
|
|
76
|
+
bySeverity: Record<string, number>;
|
|
77
|
+
};
|
|
78
|
+
threats: {
|
|
79
|
+
blocked: number;
|
|
80
|
+
detected: number;
|
|
81
|
+
investigated: number;
|
|
82
|
+
};
|
|
83
|
+
alerts: {
|
|
84
|
+
new: number;
|
|
85
|
+
resolved: number;
|
|
86
|
+
falsePositives: number;
|
|
87
|
+
};
|
|
88
|
+
performance: {
|
|
89
|
+
responseTime: number;
|
|
90
|
+
detectionRate: number;
|
|
91
|
+
falsePositiveRate: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Real-time Security Monitor
|
|
96
|
+
*/
|
|
97
|
+
export declare class SecurityMonitor extends EventEmitter {
|
|
98
|
+
private events;
|
|
99
|
+
private alerts;
|
|
100
|
+
private threatIntel;
|
|
101
|
+
private anomalyPatterns;
|
|
102
|
+
private metrics;
|
|
103
|
+
private isMonitoring;
|
|
104
|
+
private metricsInterval?;
|
|
105
|
+
constructor();
|
|
106
|
+
/**
|
|
107
|
+
* Start security monitoring
|
|
108
|
+
*/
|
|
109
|
+
start(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Stop security monitoring
|
|
112
|
+
*/
|
|
113
|
+
stop(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Log security event
|
|
116
|
+
*/
|
|
117
|
+
logSecurityEvent(eventData: Omit<SecurityEvent, "id" | "timestamp" | "handled" | "actions">): Promise<SecurityEvent>;
|
|
118
|
+
/**
|
|
119
|
+
* Process security event and take automated actions
|
|
120
|
+
*/
|
|
121
|
+
private processSecurityEvent;
|
|
122
|
+
/**
|
|
123
|
+
* Create security action
|
|
124
|
+
*/
|
|
125
|
+
private createAction;
|
|
126
|
+
/**
|
|
127
|
+
* Execute block action
|
|
128
|
+
*/
|
|
129
|
+
private executeBlockAction;
|
|
130
|
+
/**
|
|
131
|
+
* Execute throttle action
|
|
132
|
+
*/
|
|
133
|
+
private executeThrottleAction;
|
|
134
|
+
/**
|
|
135
|
+
* Execute alert action
|
|
136
|
+
*/
|
|
137
|
+
private executeAlertAction;
|
|
138
|
+
/**
|
|
139
|
+
* Execute log action
|
|
140
|
+
*/
|
|
141
|
+
private executeLogAction;
|
|
142
|
+
/**
|
|
143
|
+
* Create security alert
|
|
144
|
+
*/
|
|
145
|
+
private createAlert;
|
|
146
|
+
/**
|
|
147
|
+
* Extract indicators from security event
|
|
148
|
+
*/
|
|
149
|
+
private extractIndicators;
|
|
150
|
+
/**
|
|
151
|
+
* Generate recommendations for event
|
|
152
|
+
*/
|
|
153
|
+
private generateRecommendations;
|
|
154
|
+
/**
|
|
155
|
+
* Check for suspicious activity from IP
|
|
156
|
+
*/
|
|
157
|
+
private checkSuspiciousActivity;
|
|
158
|
+
/**
|
|
159
|
+
* Get failed authentication attempts for user
|
|
160
|
+
*/
|
|
161
|
+
private getFailedAuthAttempts;
|
|
162
|
+
/**
|
|
163
|
+
* Check for anomalies
|
|
164
|
+
*/
|
|
165
|
+
private checkForAnomalies;
|
|
166
|
+
/**
|
|
167
|
+
* Check if event matches anomaly pattern
|
|
168
|
+
*/
|
|
169
|
+
private matchesAnomalyPattern;
|
|
170
|
+
/**
|
|
171
|
+
* Initialize default anomaly patterns
|
|
172
|
+
*/
|
|
173
|
+
private initializeAnomalyPatterns;
|
|
174
|
+
/**
|
|
175
|
+
* Collect security metrics
|
|
176
|
+
*/
|
|
177
|
+
private collectMetrics;
|
|
178
|
+
/**
|
|
179
|
+
* Group array by property
|
|
180
|
+
*/
|
|
181
|
+
private groupBy;
|
|
182
|
+
/**
|
|
183
|
+
* Calculate average response time for security events
|
|
184
|
+
*/
|
|
185
|
+
private calculateAverageResponseTime;
|
|
186
|
+
/**
|
|
187
|
+
* Calculate detection rate
|
|
188
|
+
*/
|
|
189
|
+
private calculateDetectionRate;
|
|
190
|
+
/**
|
|
191
|
+
* Calculate false positive rate
|
|
192
|
+
*/
|
|
193
|
+
private calculateFalsePositiveRate;
|
|
194
|
+
/**
|
|
195
|
+
* Add threat intelligence
|
|
196
|
+
*/
|
|
197
|
+
addThreatIntelligence(threat: ThreatIntelligence): void;
|
|
198
|
+
/**
|
|
199
|
+
* Remove threat intelligence
|
|
200
|
+
*/
|
|
201
|
+
removeThreatIntelligence(value: string): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Update alert status
|
|
204
|
+
*/
|
|
205
|
+
updateAlertStatus(alertId: string, status: SecurityAlert["status"], assignee?: string): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Get security events
|
|
208
|
+
*/
|
|
209
|
+
getEvents(options?: {
|
|
210
|
+
limit?: number;
|
|
211
|
+
offset?: number;
|
|
212
|
+
severity?: string;
|
|
213
|
+
type?: string;
|
|
214
|
+
since?: Date;
|
|
215
|
+
}): SecurityEvent[];
|
|
216
|
+
/**
|
|
217
|
+
* Get security alerts
|
|
218
|
+
*/
|
|
219
|
+
getAlerts(options?: {
|
|
220
|
+
limit?: number;
|
|
221
|
+
offset?: number;
|
|
222
|
+
severity?: string;
|
|
223
|
+
status?: string;
|
|
224
|
+
since?: Date;
|
|
225
|
+
}): SecurityAlert[];
|
|
226
|
+
/**
|
|
227
|
+
* Get security metrics
|
|
228
|
+
*/
|
|
229
|
+
getMetrics(options?: {
|
|
230
|
+
since?: Date;
|
|
231
|
+
until?: Date;
|
|
232
|
+
}): SecurityMetrics[];
|
|
233
|
+
/**
|
|
234
|
+
* Get system status
|
|
235
|
+
*/
|
|
236
|
+
getStatus(): {
|
|
237
|
+
monitoring: boolean;
|
|
238
|
+
eventsToday: number;
|
|
239
|
+
alertsOpen: number;
|
|
240
|
+
threatsBlocked: number;
|
|
241
|
+
systemHealth: "healthy" | "degraded" | "critical";
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
export {};
|
|
245
|
+
//# sourceMappingURL=SecurityMonitoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityMonitoring.d.ts","sourceRoot":"","sources":["../../src/security/SecurityMonitoring.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,gBAAgB,GAAG,eAAe,GAAG,kBAAkB,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;IACrG,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KA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