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.
Files changed (36) hide show
  1. package/dist/security/AISecurityScanner.d.ts +175 -0
  2. package/dist/security/AISecurityScanner.d.ts.map +1 -0
  3. package/dist/security/AISecurityScanner.js +645 -0
  4. package/dist/security/AISecurityScanner.js.map +1 -0
  5. package/dist/security/AutomatedRemediation.d.ts +145 -0
  6. package/dist/security/AutomatedRemediation.d.ts.map +1 -0
  7. package/dist/security/AutomatedRemediation.js +535 -0
  8. package/dist/security/AutomatedRemediation.js.map +1 -0
  9. package/dist/security/SecurityCIPipeline.d.ts +213 -0
  10. package/dist/security/SecurityCIPipeline.d.ts.map +1 -0
  11. package/dist/security/SecurityCIPipeline.js +684 -0
  12. package/dist/security/SecurityCIPipeline.js.map +1 -0
  13. package/dist/security/SecurityConfigManager.d.ts +294 -0
  14. package/dist/security/SecurityConfigManager.d.ts.map +1 -0
  15. package/dist/security/SecurityConfigManager.js +553 -0
  16. package/dist/security/SecurityConfigManager.js.map +1 -0
  17. package/dist/security/SecurityMonitoring.d.ts +245 -0
  18. package/dist/security/SecurityMonitoring.d.ts.map +1 -0
  19. package/dist/security/SecurityMonitoring.js +596 -0
  20. package/dist/security/SecurityMonitoring.js.map +1 -0
  21. package/dist/security/SecurityReviewer.d.ts +168 -0
  22. package/dist/security/SecurityReviewer.d.ts.map +1 -0
  23. package/dist/security/SecurityReviewer.js +683 -0
  24. package/dist/security/SecurityReviewer.js.map +1 -0
  25. package/dist/security/index.d.ts +182 -0
  26. package/dist/security/index.d.ts.map +1 -0
  27. package/dist/security/index.js +189 -0
  28. package/dist/security/index.js.map +1 -0
  29. package/package.json +8 -3
  30. package/src/security/AISecurityScanner.ts +780 -0
  31. package/src/security/AutomatedRemediation.ts +665 -0
  32. package/src/security/SecurityCIPipeline.ts +969 -0
  33. package/src/security/SecurityConfigManager.ts +829 -0
  34. package/src/security/SecurityMonitoring.ts +841 -0
  35. package/src/security/SecurityReviewer.ts +855 -0
  36. package/src/security/index.ts +249 -0
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Security System Index
3
+ * Central export for all security components
4
+ */
5
+
6
+ // Core Security Components
7
+ export { SecurityConfig, SecurityUtils, createSecureError, getEnvironmentSecurity } from "./SecurityConfig";
8
+ import { SecurityValidationError } from "./InputValidator";
9
+ export {
10
+ InputSanitizer,
11
+ SecuritySchemas,
12
+ SecurityLimiter,
13
+ SecurityValidationError,
14
+ validateSecurity,
15
+ ToolSchemas,
16
+ } from "./InputValidator";
17
+
18
+ // AI-Powered Security Scanner
19
+ import { AISecurityScanner } from "./AISecurityScanner";
20
+ export { AISecurityScanner } from "./AISecurityScanner";
21
+
22
+ // Automated Remediation System
23
+ import { AutomatedRemediation, RemediationResult as _RemediationResult } from "./AutomatedRemediation";
24
+ export { AutomatedRemediation, RemediationResult } from "./AutomatedRemediation";
25
+
26
+ // Security Code Reviewer
27
+ import { SecurityReviewer, CodeReviewResult as _CodeReviewResult } from "./SecurityReviewer";
28
+ export { SecurityReviewer, CodeReviewResult } from "./SecurityReviewer";
29
+
30
+ // Security Configuration Manager
31
+ import { SecurityConfigManager } from "./SecurityConfigManager";
32
+ export { SecurityConfigManager } from "./SecurityConfigManager";
33
+
34
+ // Security Monitoring and Alerting
35
+ import { SecurityMonitor, SecurityEvent as _SecurityEvent } from "./SecurityMonitoring";
36
+ export { SecurityMonitor, SecurityEvent } from "./SecurityMonitoring";
37
+
38
+ // CI/CD Pipeline Integration
39
+ import { SecurityCIPipeline, PipelineSecurityReport as _PipelineSecurityReport } from "./SecurityCIPipeline";
40
+ export { SecurityCIPipeline, PipelineSecurityReport } from "./SecurityCIPipeline";
41
+
42
+ // Type definitions for external use
43
+ export interface SecurityScanOptions {
44
+ targets?: string[];
45
+ depth?: "shallow" | "deep" | "comprehensive";
46
+ includeFileSystem?: boolean;
47
+ includeRuntime?: boolean;
48
+ }
49
+
50
+ export interface SecurityReviewOptions {
51
+ rules?: string[];
52
+ excludeRules?: string[];
53
+ aiAnalysis?: boolean;
54
+ recursive?: boolean;
55
+ }
56
+
57
+ export interface SecurityGateOptions {
58
+ skipNonBlocking?: boolean;
59
+ continueOnFailure?: boolean;
60
+ dryRun?: boolean;
61
+ }
62
+
63
+ /**
64
+ * Security System Manager
65
+ * Orchestrates all security components
66
+ */
67
+ export class SecuritySystem {
68
+ private scanner: AISecurityScanner;
69
+ private remediation: AutomatedRemediation;
70
+ private reviewer: SecurityReviewer;
71
+ private configManager: SecurityConfigManager;
72
+ private monitor: SecurityMonitor;
73
+ private pipeline: SecurityCIPipeline;
74
+ private initialized = false;
75
+
76
+ constructor() {
77
+ this.scanner = new AISecurityScanner();
78
+ this.remediation = new AutomatedRemediation();
79
+ this.reviewer = new SecurityReviewer();
80
+ this.configManager = new SecurityConfigManager();
81
+ this.monitor = new SecurityMonitor();
82
+ this.pipeline = new SecurityCIPipeline();
83
+ }
84
+
85
+ /**
86
+ * Initialize the security system
87
+ */
88
+ async initialize(): Promise<void> {
89
+ if (this.initialized) {
90
+ console.log("[Security System] Already initialized");
91
+ return;
92
+ }
93
+
94
+ console.log("[Security System] Initializing comprehensive security system...");
95
+
96
+ try {
97
+ // Initialize all components
98
+ await this.configManager.initialize();
99
+ await this.pipeline.initialize();
100
+
101
+ // Start monitoring
102
+ this.monitor.start();
103
+
104
+ this.initialized = true;
105
+ console.log("[Security System] Security system initialized successfully");
106
+ } catch (error) {
107
+ console.error("[Security System] Initialization failed:", error);
108
+ throw new SecurityValidationError("Security system initialization failed", [{ message: String(error) }]);
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Perform comprehensive security scan
114
+ */
115
+ async scan(options?: SecurityScanOptions) {
116
+ this.ensureInitialized();
117
+ return await this.scanner.performScan(options);
118
+ }
119
+
120
+ /**
121
+ * Perform security code review
122
+ */
123
+ async review(filePath: string, options?: SecurityReviewOptions): Promise<_CodeReviewResult> {
124
+ this.ensureInitialized();
125
+ return await this.reviewer.reviewFile(filePath, options);
126
+ }
127
+
128
+ /**
129
+ * Create and execute remediation plan
130
+ */
131
+ async remediate(scanResult: any, dryRun = false): Promise<_RemediationResult[]> {
132
+ this.ensureInitialized();
133
+ const plan = await this.remediation.createRemediationPlan(scanResult);
134
+ return await this.remediation.executeRemediationPlan(plan, { dryRun });
135
+ }
136
+
137
+ /**
138
+ * Execute security gates for CI/CD
139
+ */
140
+ async executeGates(stage: string, context: any, options?: SecurityGateOptions): Promise<_PipelineSecurityReport> {
141
+ this.ensureInitialized();
142
+ return await this.pipeline.executeSecurityGates(stage as any, context, options);
143
+ }
144
+
145
+ /**
146
+ * Log security event
147
+ */
148
+ async logEvent(eventData: any): Promise<_SecurityEvent> {
149
+ this.ensureInitialized();
150
+ return await this.monitor.logSecurityEvent(eventData);
151
+ }
152
+
153
+ /**
154
+ * Get security status
155
+ */
156
+ getStatus() {
157
+ this.ensureInitialized();
158
+ return {
159
+ system: this.initialized,
160
+ monitoring: this.monitor.getStatus(),
161
+ scanner: this.scanner.getLatestScan(),
162
+ pipeline: this.pipeline.getStatistics(),
163
+ };
164
+ }
165
+
166
+ /**
167
+ * Shutdown security system
168
+ */
169
+ shutdown(): void {
170
+ if (!this.initialized) {
171
+ return;
172
+ }
173
+
174
+ console.log("[Security System] Shutting down security system...");
175
+
176
+ this.monitor.stop();
177
+ this.initialized = false;
178
+
179
+ console.log("[Security System] Security system shutdown complete");
180
+ }
181
+
182
+ /**
183
+ * Ensure system is initialized
184
+ */
185
+ private ensureInitialized(): void {
186
+ if (!this.initialized) {
187
+ throw new SecurityValidationError("Security system not initialized", [{ message: "Call initialize() first" }]);
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Get individual components for advanced usage
193
+ */
194
+ getComponents() {
195
+ return {
196
+ scanner: this.scanner,
197
+ remediation: this.remediation,
198
+ reviewer: this.reviewer,
199
+ configManager: this.configManager,
200
+ monitor: this.monitor,
201
+ pipeline: this.pipeline,
202
+ };
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Default security system instance
208
+ */
209
+ export const securitySystem = new SecuritySystem();
210
+
211
+ /**
212
+ * Convenience functions for common operations
213
+ */
214
+ export const security = {
215
+ /**
216
+ * Quick security scan
217
+ */
218
+ scan: (options?: SecurityScanOptions) => securitySystem.scan(options),
219
+
220
+ /**
221
+ * Quick security review
222
+ */
223
+ review: (filePath: string, options?: SecurityReviewOptions) => securitySystem.review(filePath, options),
224
+
225
+ /**
226
+ * Quick remediation
227
+ */
228
+ remediate: (scanResult: any, dryRun = true) => securitySystem.remediate(scanResult, dryRun),
229
+
230
+ /**
231
+ * Log security event
232
+ */
233
+ logEvent: (eventData: any) => securitySystem.logEvent(eventData),
234
+
235
+ /**
236
+ * Get security status
237
+ */
238
+ status: () => securitySystem.getStatus(),
239
+
240
+ /**
241
+ * Initialize security system
242
+ */
243
+ init: () => securitySystem.initialize(),
244
+
245
+ /**
246
+ * Shutdown security system
247
+ */
248
+ shutdown: () => securitySystem.shutdown(),
249
+ };