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,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-Powered Security Code Reviewer
|
|
3
|
+
* Provides intelligent security code review and analysis
|
|
4
|
+
*/
|
|
5
|
+
interface SecurityReviewRule {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
category: "authentication" | "authorization" | "input-validation" | "crypto" | "session" | "config" | "general";
|
|
10
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
11
|
+
pattern: RegExp;
|
|
12
|
+
message: string;
|
|
13
|
+
recommendation: string;
|
|
14
|
+
cweId?: string;
|
|
15
|
+
examples: {
|
|
16
|
+
vulnerable: string;
|
|
17
|
+
secure: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CodeReviewResult {
|
|
21
|
+
reviewId: string;
|
|
22
|
+
timestamp: Date;
|
|
23
|
+
file: string;
|
|
24
|
+
findings: SecurityFinding[];
|
|
25
|
+
summary: {
|
|
26
|
+
totalFindings: number;
|
|
27
|
+
criticalFindings: number;
|
|
28
|
+
highFindings: number;
|
|
29
|
+
mediumFindings: number;
|
|
30
|
+
lowFindings: number;
|
|
31
|
+
infoFindings: number;
|
|
32
|
+
};
|
|
33
|
+
overallRating: "secure" | "needs-review" | "vulnerable" | "critical";
|
|
34
|
+
recommendations: string[];
|
|
35
|
+
}
|
|
36
|
+
interface SecurityFinding {
|
|
37
|
+
id: string;
|
|
38
|
+
rule: string;
|
|
39
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
40
|
+
line: number;
|
|
41
|
+
column: number;
|
|
42
|
+
code: string;
|
|
43
|
+
message: string;
|
|
44
|
+
recommendation: string;
|
|
45
|
+
confidence: number;
|
|
46
|
+
category: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* AI-Powered Security Code Reviewer
|
|
50
|
+
*/
|
|
51
|
+
export declare class SecurityReviewer {
|
|
52
|
+
private reviewHistory;
|
|
53
|
+
/**
|
|
54
|
+
* Perform comprehensive security review of a file
|
|
55
|
+
*/
|
|
56
|
+
reviewFile(filePath: string, options?: {
|
|
57
|
+
rules?: string[];
|
|
58
|
+
excludeRules?: string[];
|
|
59
|
+
aiAnalysis?: boolean;
|
|
60
|
+
}): Promise<CodeReviewResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Review multiple files
|
|
63
|
+
*/
|
|
64
|
+
reviewDirectory(dirPath: string, options?: {
|
|
65
|
+
recursive?: boolean;
|
|
66
|
+
filePattern?: RegExp;
|
|
67
|
+
rules?: string[];
|
|
68
|
+
excludeRules?: string[];
|
|
69
|
+
aiAnalysis?: boolean;
|
|
70
|
+
}): Promise<CodeReviewResult[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Apply security rules to code content
|
|
73
|
+
*/
|
|
74
|
+
private applySecurityRules;
|
|
75
|
+
/**
|
|
76
|
+
* Get applicable security rules based on options
|
|
77
|
+
*/
|
|
78
|
+
private getApplicableRules;
|
|
79
|
+
/**
|
|
80
|
+
* Perform AI-powered code analysis
|
|
81
|
+
*/
|
|
82
|
+
private performAIAnalysis;
|
|
83
|
+
/**
|
|
84
|
+
* Calculate code complexity
|
|
85
|
+
*/
|
|
86
|
+
private calculateComplexity;
|
|
87
|
+
/**
|
|
88
|
+
* Calculate security score
|
|
89
|
+
*/
|
|
90
|
+
private calculateSecurityScore;
|
|
91
|
+
/**
|
|
92
|
+
* Analyze code patterns
|
|
93
|
+
*/
|
|
94
|
+
private analyzePatterns;
|
|
95
|
+
/**
|
|
96
|
+
* Generate AI recommendations
|
|
97
|
+
*/
|
|
98
|
+
private generateAIRecommendations;
|
|
99
|
+
/**
|
|
100
|
+
* Assess overall risk
|
|
101
|
+
*/
|
|
102
|
+
private assessRisk;
|
|
103
|
+
/**
|
|
104
|
+
* Calculate confidence score for a finding
|
|
105
|
+
*/
|
|
106
|
+
private calculateConfidence;
|
|
107
|
+
/**
|
|
108
|
+
* Generate summary of findings
|
|
109
|
+
*/
|
|
110
|
+
private generateSummary;
|
|
111
|
+
/**
|
|
112
|
+
* Calculate overall security rating
|
|
113
|
+
*/
|
|
114
|
+
private calculateOverallRating;
|
|
115
|
+
/**
|
|
116
|
+
* Generate recommendations based on findings
|
|
117
|
+
*/
|
|
118
|
+
private generateRecommendations;
|
|
119
|
+
/**
|
|
120
|
+
* Get line number from character index
|
|
121
|
+
*/
|
|
122
|
+
private getLineNumber;
|
|
123
|
+
/**
|
|
124
|
+
* Get column number from character index
|
|
125
|
+
*/
|
|
126
|
+
private getColumnNumber;
|
|
127
|
+
/**
|
|
128
|
+
* Get review history
|
|
129
|
+
*/
|
|
130
|
+
getReviewHistory(): CodeReviewResult[];
|
|
131
|
+
/**
|
|
132
|
+
* Get security rules
|
|
133
|
+
*/
|
|
134
|
+
getSecurityRules(): SecurityReviewRule[];
|
|
135
|
+
/**
|
|
136
|
+
* Add custom security rule
|
|
137
|
+
*/
|
|
138
|
+
addCustomRule(rule: SecurityReviewRule): void;
|
|
139
|
+
/**
|
|
140
|
+
* Remove security rule
|
|
141
|
+
*/
|
|
142
|
+
removeRule(ruleId: string): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Generate security report
|
|
145
|
+
*/
|
|
146
|
+
generateSecurityReport(results: CodeReviewResult[]): {
|
|
147
|
+
summary: {
|
|
148
|
+
filesReviewed: number;
|
|
149
|
+
totalFindings: number;
|
|
150
|
+
criticalFindings: number;
|
|
151
|
+
highFindings: number;
|
|
152
|
+
overallRating: "secure" | "needs-review" | "vulnerable" | "critical";
|
|
153
|
+
};
|
|
154
|
+
topIssues: SecurityFinding[];
|
|
155
|
+
recommendations: string[];
|
|
156
|
+
riskFactors: string[];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Calculate overall project security rating
|
|
160
|
+
*/
|
|
161
|
+
private calculateProjectRating;
|
|
162
|
+
/**
|
|
163
|
+
* Identify project-wide risk factors
|
|
164
|
+
*/
|
|
165
|
+
private identifyRiskFactors;
|
|
166
|
+
}
|
|
167
|
+
export {};
|
|
168
|
+
//# sourceMappingURL=SecurityReviewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityReviewer.d.ts","sourceRoot":"","sources":["../../src/security/SecurityReviewer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,gBAAgB,GAAG,eAAe,GAAG,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAChH,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,aAAa,EAAE,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;IACrE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM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