@trentapps/manager-protocol 1.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/LICENSE +21 -0
- package/README.md +639 -0
- package/dist/analyzers/ArchitectureDetector.d.ts +44 -0
- package/dist/analyzers/ArchitectureDetector.d.ts.map +1 -0
- package/dist/analyzers/ArchitectureDetector.js +218 -0
- package/dist/analyzers/ArchitectureDetector.js.map +1 -0
- package/dist/analyzers/CSSAnalyzer.d.ts +284 -0
- package/dist/analyzers/CSSAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/CSSAnalyzer.js +1180 -0
- package/dist/analyzers/CSSAnalyzer.js.map +1 -0
- package/dist/analyzers/index.d.ts +5 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +5 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +174 -0
- package/dist/cli.js.map +1 -0
- package/dist/design-system/index.d.ts +6 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +6 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/tokens.d.ts +106 -0
- package/dist/design-system/tokens.d.ts.map +1 -0
- package/dist/design-system/tokens.js +554 -0
- package/dist/design-system/tokens.js.map +1 -0
- package/dist/engine/AuditLogger.d.ts +506 -0
- package/dist/engine/AuditLogger.d.ts.map +1 -0
- package/dist/engine/AuditLogger.js +1491 -0
- package/dist/engine/AuditLogger.js.map +1 -0
- package/dist/engine/GitHubApprovalManager.d.ts +123 -0
- package/dist/engine/GitHubApprovalManager.d.ts.map +1 -0
- package/dist/engine/GitHubApprovalManager.js +347 -0
- package/dist/engine/GitHubApprovalManager.js.map +1 -0
- package/dist/engine/GitHubClient.d.ts +183 -0
- package/dist/engine/GitHubClient.d.ts.map +1 -0
- package/dist/engine/GitHubClient.js +411 -0
- package/dist/engine/GitHubClient.js.map +1 -0
- package/dist/engine/RateLimiter.d.ts +81 -0
- package/dist/engine/RateLimiter.d.ts.map +1 -0
- package/dist/engine/RateLimiter.js +215 -0
- package/dist/engine/RateLimiter.js.map +1 -0
- package/dist/engine/RuleDependencyAnalyzer.d.ts +73 -0
- package/dist/engine/RuleDependencyAnalyzer.d.ts.map +1 -0
- package/dist/engine/RuleDependencyAnalyzer.js +475 -0
- package/dist/engine/RuleDependencyAnalyzer.js.map +1 -0
- package/dist/engine/RulesEngine.d.ts +176 -0
- package/dist/engine/RulesEngine.d.ts.map +1 -0
- package/dist/engine/RulesEngine.js +705 -0
- package/dist/engine/RulesEngine.js.map +1 -0
- package/dist/engine/TaskManager.d.ts +174 -0
- package/dist/engine/TaskManager.d.ts.map +1 -0
- package/dist/engine/TaskManager.js +663 -0
- package/dist/engine/TaskManager.js.map +1 -0
- package/dist/engine/index.d.ts +11 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +13 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/architecture.d.ts +9 -0
- package/dist/rules/architecture.d.ts.map +1 -0
- package/dist/rules/architecture.js +322 -0
- package/dist/rules/architecture.js.map +1 -0
- package/dist/rules/azure.d.ts +7 -0
- package/dist/rules/azure.d.ts.map +1 -0
- package/dist/rules/azure.js +136 -0
- package/dist/rules/azure.js.map +1 -0
- package/dist/rules/compliance.d.ts +9 -0
- package/dist/rules/compliance.d.ts.map +1 -0
- package/dist/rules/compliance.js +286 -0
- package/dist/rules/compliance.js.map +1 -0
- package/dist/rules/condition-optimizer.d.ts +151 -0
- package/dist/rules/condition-optimizer.d.ts.map +1 -0
- package/dist/rules/condition-optimizer.js +479 -0
- package/dist/rules/condition-optimizer.js.map +1 -0
- package/dist/rules/css.d.ts +10 -0
- package/dist/rules/css.d.ts.map +1 -0
- package/dist/rules/css.js +1777 -0
- package/dist/rules/css.js.map +1 -0
- package/dist/rules/field-standards.d.ts +1172 -0
- package/dist/rules/field-standards.d.ts.map +1 -0
- package/dist/rules/field-standards.js +908 -0
- package/dist/rules/field-standards.js.map +1 -0
- package/dist/rules/flask.d.ts +7 -0
- package/dist/rules/flask.d.ts.map +1 -0
- package/dist/rules/flask.js +142 -0
- package/dist/rules/flask.js.map +1 -0
- package/dist/rules/index.d.ts +827 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +556 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/ml-ai.d.ts +7 -0
- package/dist/rules/ml-ai.d.ts.map +1 -0
- package/dist/rules/ml-ai.js +148 -0
- package/dist/rules/ml-ai.js.map +1 -0
- package/dist/rules/operational.d.ts +9 -0
- package/dist/rules/operational.d.ts.map +1 -0
- package/dist/rules/operational.js +318 -0
- package/dist/rules/operational.js.map +1 -0
- package/dist/rules/patterns.d.ts +568 -0
- package/dist/rules/patterns.d.ts.map +1 -0
- package/dist/rules/patterns.js +1359 -0
- package/dist/rules/patterns.js.map +1 -0
- package/dist/rules/security.d.ts +9 -0
- package/dist/rules/security.d.ts.map +1 -0
- package/dist/rules/security.js +848 -0
- package/dist/rules/security.js.map +1 -0
- package/dist/rules/shared-patterns.d.ts +268 -0
- package/dist/rules/shared-patterns.d.ts.map +1 -0
- package/dist/rules/shared-patterns.js +556 -0
- package/dist/rules/shared-patterns.js.map +1 -0
- package/dist/rules/storage.d.ts +13 -0
- package/dist/rules/storage.d.ts.map +1 -0
- package/dist/rules/storage.js +672 -0
- package/dist/rules/storage.js.map +1 -0
- package/dist/rules/stripe.d.ts +7 -0
- package/dist/rules/stripe.d.ts.map +1 -0
- package/dist/rules/stripe.js +133 -0
- package/dist/rules/stripe.js.map +1 -0
- package/dist/rules/testing.d.ts +7 -0
- package/dist/rules/testing.d.ts.map +1 -0
- package/dist/rules/testing.js +135 -0
- package/dist/rules/testing.js.map +1 -0
- package/dist/rules/ux.d.ts +9 -0
- package/dist/rules/ux.d.ts.map +1 -0
- package/dist/rules/ux.js +280 -0
- package/dist/rules/ux.js.map +1 -0
- package/dist/rules/websocket.d.ts +7 -0
- package/dist/rules/websocket.d.ts.map +1 -0
- package/dist/rules/websocket.js +128 -0
- package/dist/rules/websocket.js.map +1 -0
- package/dist/server.d.ts +43 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1967 -0
- package/dist/server.js.map +1 -0
- package/dist/supervisor/AgentSupervisor.d.ts +195 -0
- package/dist/supervisor/AgentSupervisor.d.ts.map +1 -0
- package/dist/supervisor/AgentSupervisor.js +569 -0
- package/dist/supervisor/AgentSupervisor.js.map +1 -0
- package/dist/supervisor/ManagedServerRegistry.d.ts +185 -0
- package/dist/supervisor/ManagedServerRegistry.d.ts.map +1 -0
- package/dist/supervisor/ManagedServerRegistry.js +729 -0
- package/dist/supervisor/ManagedServerRegistry.js.map +1 -0
- package/dist/supervisor/ProjectTracker.d.ts +210 -0
- package/dist/supervisor/ProjectTracker.d.ts.map +1 -0
- package/dist/supervisor/ProjectTracker.js +709 -0
- package/dist/supervisor/ProjectTracker.js.map +1 -0
- package/dist/supervisor/index.d.ts +6 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +6 -0
- package/dist/supervisor/index.js.map +1 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +12 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/rule-tester.d.ts +217 -0
- package/dist/testing/rule-tester.d.ts.map +1 -0
- package/dist/testing/rule-tester.examples.d.ts +57 -0
- package/dist/testing/rule-tester.examples.d.ts.map +1 -0
- package/dist/testing/rule-tester.examples.js +375 -0
- package/dist/testing/rule-tester.examples.js.map +1 -0
- package/dist/testing/rule-tester.js +381 -0
- package/dist/testing/rule-tester.js.map +1 -0
- package/dist/testing/rule-validator.d.ts +141 -0
- package/dist/testing/rule-validator.d.ts.map +1 -0
- package/dist/testing/rule-validator.js +640 -0
- package/dist/testing/rule-validator.js.map +1 -0
- package/dist/types/index.d.ts +1282 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +386 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/errors.d.ts +86 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +171 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rate-limiting.d.ts +268 -0
- package/dist/utils/rate-limiting.d.ts.map +1 -0
- package/dist/utils/rate-limiting.js +403 -0
- package/dist/utils/rate-limiting.js.map +1 -0
- package/dist/utils/shared.d.ts +306 -0
- package/dist/utils/shared.d.ts.map +1 -0
- package/dist/utils/shared.js +464 -0
- package/dist/utils/shared.js.map +1 -0
- package/dist/utils/shell.d.ts +22 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +29 -0
- package/dist/utils/shell.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enterprise Agent Supervisor - Storage Rules
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive governance rules for all storage types:
|
|
5
|
+
* - Browser Storage (localStorage, sessionStorage, IndexedDB)
|
|
6
|
+
* - Database Access (SQL, NoSQL, transactions)
|
|
7
|
+
* - File System (read, write, configuration)
|
|
8
|
+
* - Cache (memory, distributed, CDN)
|
|
9
|
+
* - Blob/Object Storage (S3, Azure Blob, GCS)
|
|
10
|
+
*/
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// BROWSER STORAGE RULES
|
|
13
|
+
// ============================================================================
|
|
14
|
+
const browserStorageRules = [
|
|
15
|
+
{
|
|
16
|
+
id: 'storage-001',
|
|
17
|
+
name: 'Monitor localStorage Quota Usage',
|
|
18
|
+
description: 'localStorage usage must be monitored to prevent quota exceeded errors',
|
|
19
|
+
type: 'operational',
|
|
20
|
+
enabled: true,
|
|
21
|
+
priority: 900,
|
|
22
|
+
conditions: [
|
|
23
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_modification' },
|
|
24
|
+
{ field: 'storageType', operator: 'equals', value: 'localStorage' },
|
|
25
|
+
{ field: 'estimatedSize', operator: 'greater_than', value: 4000000 }
|
|
26
|
+
],
|
|
27
|
+
conditionLogic: 'all',
|
|
28
|
+
actions: [
|
|
29
|
+
{ type: 'warn', message: 'localStorage usage >4MB - approaching quota limit (5-10MB)' }
|
|
30
|
+
],
|
|
31
|
+
riskWeight: 30,
|
|
32
|
+
tags: ['storage', 'localStorage', 'quota', 'browser']
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'storage-002',
|
|
36
|
+
name: 'Require Auto-Cleanup of Old Data',
|
|
37
|
+
description: 'localStorage must have cleanup strategy for old data',
|
|
38
|
+
type: 'architecture',
|
|
39
|
+
enabled: true,
|
|
40
|
+
priority: 850,
|
|
41
|
+
conditions: [
|
|
42
|
+
{ field: 'storageType', operator: 'equals', value: 'localStorage' },
|
|
43
|
+
{ field: 'hasCleanupStrategy', operator: 'not_equals', value: true }
|
|
44
|
+
],
|
|
45
|
+
conditionLogic: 'all',
|
|
46
|
+
actions: [
|
|
47
|
+
{ type: 'warn', message: 'Implement localStorage cleanup (TTL, LRU, size-based eviction)' }
|
|
48
|
+
],
|
|
49
|
+
riskWeight: 25,
|
|
50
|
+
tags: ['storage', 'localStorage', 'cleanup', 'maintenance']
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'storage-003',
|
|
54
|
+
name: 'Prohibit Sensitive Data in localStorage',
|
|
55
|
+
description: 'Sensitive data must not be stored in localStorage',
|
|
56
|
+
type: 'security',
|
|
57
|
+
enabled: true,
|
|
58
|
+
priority: 960,
|
|
59
|
+
conditions: [
|
|
60
|
+
{ field: 'storageType', operator: 'in', value: ['localStorage', 'sessionStorage'] },
|
|
61
|
+
{ field: 'dataClassification', operator: 'in', value: ['confidential', 'restricted'] }
|
|
62
|
+
],
|
|
63
|
+
conditionLogic: 'all',
|
|
64
|
+
actions: [
|
|
65
|
+
{ type: 'deny', message: 'Sensitive data prohibited in localStorage (use secure HTTP-only cookies or encrypted storage)' }
|
|
66
|
+
],
|
|
67
|
+
riskWeight: 55,
|
|
68
|
+
tags: ['storage', 'security', 'localStorage', 'sensitive-data']
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'storage-004',
|
|
72
|
+
name: 'Deny Base64 Image Storage',
|
|
73
|
+
description: 'Base64 images must not be stored in localStorage due to size',
|
|
74
|
+
type: 'operational',
|
|
75
|
+
enabled: true,
|
|
76
|
+
priority: 920,
|
|
77
|
+
conditions: [
|
|
78
|
+
{ field: 'storageType', operator: 'equals', value: 'localStorage' },
|
|
79
|
+
{ field: 'dataType', operator: 'equals', value: 'base64_image' }
|
|
80
|
+
],
|
|
81
|
+
conditionLogic: 'all',
|
|
82
|
+
actions: [
|
|
83
|
+
{ type: 'deny', message: 'Base64 images prohibited in localStorage (use blob URLs, IndexedDB, or server storage)' }
|
|
84
|
+
],
|
|
85
|
+
riskWeight: 40,
|
|
86
|
+
tags: ['storage', 'localStorage', 'images', 'quota']
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'storage-005',
|
|
90
|
+
name: 'Validate localStorage Access Error Handling',
|
|
91
|
+
description: 'localStorage operations must handle quota exceeded errors',
|
|
92
|
+
type: 'architecture',
|
|
93
|
+
enabled: true,
|
|
94
|
+
priority: 880,
|
|
95
|
+
conditions: [
|
|
96
|
+
{ field: 'storageType', operator: 'equals', value: 'localStorage' },
|
|
97
|
+
{ field: 'hasErrorHandling', operator: 'not_equals', value: true }
|
|
98
|
+
],
|
|
99
|
+
conditionLogic: 'all',
|
|
100
|
+
actions: [
|
|
101
|
+
{ type: 'warn', message: 'Wrap localStorage operations in try/catch for quota exceeded errors' }
|
|
102
|
+
],
|
|
103
|
+
riskWeight: 20,
|
|
104
|
+
tags: ['storage', 'localStorage', 'error-handling']
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'storage-006',
|
|
108
|
+
name: 'Use IndexedDB for Large Data',
|
|
109
|
+
description: 'Large datasets should use IndexedDB instead of localStorage',
|
|
110
|
+
type: 'architecture',
|
|
111
|
+
enabled: true,
|
|
112
|
+
priority: 800,
|
|
113
|
+
conditions: [
|
|
114
|
+
{ field: 'storageType', operator: 'equals', value: 'localStorage' },
|
|
115
|
+
{ field: 'dataSize', operator: 'greater_than', value: 1000000 }
|
|
116
|
+
],
|
|
117
|
+
conditionLogic: 'all',
|
|
118
|
+
actions: [
|
|
119
|
+
{ type: 'warn', message: 'Large data (>1MB) should use IndexedDB instead of localStorage' }
|
|
120
|
+
],
|
|
121
|
+
riskWeight: 15,
|
|
122
|
+
tags: ['storage', 'indexeddb', 'performance']
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'storage-007',
|
|
126
|
+
name: 'No Tokens in localStorage',
|
|
127
|
+
description: 'Auth tokens and API keys must not be stored in localStorage',
|
|
128
|
+
type: 'security',
|
|
129
|
+
enabled: true,
|
|
130
|
+
priority: 980,
|
|
131
|
+
conditions: [
|
|
132
|
+
{ field: 'storageType', operator: 'in', value: ['localStorage', 'sessionStorage'] },
|
|
133
|
+
{ field: 'dataType', operator: 'in', value: ['auth_token', 'api_key', 'jwt'] }
|
|
134
|
+
],
|
|
135
|
+
conditionLogic: 'all',
|
|
136
|
+
actions: [
|
|
137
|
+
{ type: 'deny', message: 'Auth tokens/API keys prohibited in localStorage (use secure HTTP-only cookies)' }
|
|
138
|
+
],
|
|
139
|
+
riskWeight: 70,
|
|
140
|
+
tags: ['storage', 'security', 'localStorage', 'tokens', 'authentication']
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// DATABASE ACCESS RULES
|
|
145
|
+
// ============================================================================
|
|
146
|
+
const databaseStorageRules = [
|
|
147
|
+
{
|
|
148
|
+
id: 'storage-db-001',
|
|
149
|
+
name: 'Database Connection Pool Limit',
|
|
150
|
+
description: 'Database connections must use connection pooling with limits',
|
|
151
|
+
type: 'operational',
|
|
152
|
+
enabled: true,
|
|
153
|
+
priority: 880,
|
|
154
|
+
conditions: [
|
|
155
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql', 'mongodb'] },
|
|
156
|
+
{ field: 'connectionPoolEnabled', operator: 'not_equals', value: true }
|
|
157
|
+
],
|
|
158
|
+
conditionLogic: 'all',
|
|
159
|
+
actions: [
|
|
160
|
+
{ type: 'warn', message: 'Database operations should use connection pooling to prevent exhaustion' }
|
|
161
|
+
],
|
|
162
|
+
riskWeight: 30,
|
|
163
|
+
tags: ['storage', 'database', 'connection-pool', 'performance']
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 'storage-db-002',
|
|
167
|
+
name: 'Transaction Boundary Required',
|
|
168
|
+
description: 'Multi-table database operations require explicit transaction boundaries',
|
|
169
|
+
type: 'architecture',
|
|
170
|
+
enabled: true,
|
|
171
|
+
priority: 900,
|
|
172
|
+
conditions: [
|
|
173
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_modification' },
|
|
174
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql'] },
|
|
175
|
+
{ field: 'multiTableOperation', operator: 'equals', value: true },
|
|
176
|
+
{ field: 'transactionBoundary', operator: 'not_exists', value: null }
|
|
177
|
+
],
|
|
178
|
+
conditionLogic: 'all',
|
|
179
|
+
actions: [
|
|
180
|
+
{ type: 'warn', message: 'Multi-table operations should define transaction boundaries for data consistency' }
|
|
181
|
+
],
|
|
182
|
+
riskWeight: 35,
|
|
183
|
+
tags: ['storage', 'database', 'transactions', 'consistency']
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'storage-db-003',
|
|
187
|
+
name: 'Prevent Unbounded Queries',
|
|
188
|
+
description: 'Database queries must have result limits to prevent memory exhaustion',
|
|
189
|
+
type: 'operational',
|
|
190
|
+
enabled: true,
|
|
191
|
+
priority: 920,
|
|
192
|
+
conditions: [
|
|
193
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_access' },
|
|
194
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql', 'mongodb', 'cosmos-db'] },
|
|
195
|
+
{ field: 'hasResultLimit', operator: 'not_equals', value: true },
|
|
196
|
+
{ field: 'returnsCollection', operator: 'equals', value: true }
|
|
197
|
+
],
|
|
198
|
+
conditionLogic: 'all',
|
|
199
|
+
actions: [
|
|
200
|
+
{ type: 'warn', message: 'Database queries returning collections should have LIMIT/TOP clause' }
|
|
201
|
+
],
|
|
202
|
+
riskWeight: 25,
|
|
203
|
+
tags: ['storage', 'database', 'performance', 'pagination']
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 'storage-db-004',
|
|
207
|
+
name: 'Index Required for Frequent Queries',
|
|
208
|
+
description: 'Frequently executed queries should use indexed fields',
|
|
209
|
+
type: 'architecture',
|
|
210
|
+
enabled: true,
|
|
211
|
+
priority: 800,
|
|
212
|
+
conditions: [
|
|
213
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_access' },
|
|
214
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql', 'mongodb'] },
|
|
215
|
+
{ field: 'queryFrequency', operator: 'equals', value: 'high' },
|
|
216
|
+
{ field: 'usesIndex', operator: 'not_equals', value: true }
|
|
217
|
+
],
|
|
218
|
+
conditionLogic: 'all',
|
|
219
|
+
actions: [
|
|
220
|
+
{ type: 'warn', message: 'High-frequency queries should use indexed fields for performance' }
|
|
221
|
+
],
|
|
222
|
+
riskWeight: 20,
|
|
223
|
+
tags: ['storage', 'database', 'indexing', 'performance']
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'storage-db-005',
|
|
227
|
+
name: 'Parameterized Queries Required',
|
|
228
|
+
description: 'Database queries must use parameterized statements to prevent injection',
|
|
229
|
+
type: 'security',
|
|
230
|
+
enabled: true,
|
|
231
|
+
priority: 980,
|
|
232
|
+
conditions: [
|
|
233
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_access' },
|
|
234
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql'] },
|
|
235
|
+
{ field: 'queryParameterized', operator: 'not_equals', value: true }
|
|
236
|
+
],
|
|
237
|
+
conditionLogic: 'all',
|
|
238
|
+
actions: [
|
|
239
|
+
{ type: 'deny', message: 'Database queries must use parameterized statements (SQL injection prevention)' }
|
|
240
|
+
],
|
|
241
|
+
riskWeight: 70,
|
|
242
|
+
tags: ['storage', 'database', 'security', 'sql-injection']
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: 'storage-db-006',
|
|
246
|
+
name: 'Database Backup Before Schema Change',
|
|
247
|
+
description: 'Schema changes in production require backup verification',
|
|
248
|
+
type: 'operational',
|
|
249
|
+
enabled: true,
|
|
250
|
+
priority: 950,
|
|
251
|
+
conditions: [
|
|
252
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql', 'mongodb'] },
|
|
253
|
+
{ field: 'operation', operator: 'in', value: ['alter_table', 'drop_table', 'create_index', 'drop_index', 'migration'] },
|
|
254
|
+
{ field: 'environment', operator: 'equals', value: 'production' },
|
|
255
|
+
{ field: 'backupVerified', operator: 'not_equals', value: true }
|
|
256
|
+
],
|
|
257
|
+
conditionLogic: 'all',
|
|
258
|
+
actions: [
|
|
259
|
+
{ type: 'require_approval', message: 'Production schema changes require backup verification' }
|
|
260
|
+
],
|
|
261
|
+
riskWeight: 50,
|
|
262
|
+
tags: ['storage', 'database', 'schema', 'backup', 'migration']
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: 'storage-db-007',
|
|
266
|
+
name: 'Read Replica for Heavy Reads',
|
|
267
|
+
description: 'High-volume read operations should use read replicas',
|
|
268
|
+
type: 'architecture',
|
|
269
|
+
enabled: true,
|
|
270
|
+
priority: 750,
|
|
271
|
+
conditions: [
|
|
272
|
+
{ field: 'actionCategory', operator: 'equals', value: 'data_access' },
|
|
273
|
+
{ field: 'storageType', operator: 'in', value: ['sql', 'postgresql', 'mysql'] },
|
|
274
|
+
{ field: 'queryVolume', operator: 'equals', value: 'high' },
|
|
275
|
+
{ field: 'usesReadReplica', operator: 'not_equals', value: true },
|
|
276
|
+
{ field: 'environment', operator: 'equals', value: 'production' }
|
|
277
|
+
],
|
|
278
|
+
conditionLogic: 'all',
|
|
279
|
+
actions: [
|
|
280
|
+
{ type: 'warn', message: 'High-volume reads should consider read replicas to reduce primary load' }
|
|
281
|
+
],
|
|
282
|
+
riskWeight: 15,
|
|
283
|
+
tags: ['storage', 'database', 'read-replica', 'scaling']
|
|
284
|
+
}
|
|
285
|
+
];
|
|
286
|
+
// ============================================================================
|
|
287
|
+
// FILE SYSTEM RULES
|
|
288
|
+
// ============================================================================
|
|
289
|
+
const fileSystemStorageRules = [
|
|
290
|
+
{
|
|
291
|
+
id: 'storage-fs-001',
|
|
292
|
+
name: 'Block Access to System Files',
|
|
293
|
+
description: 'Prevents access to critical system files and directories',
|
|
294
|
+
type: 'security',
|
|
295
|
+
enabled: true,
|
|
296
|
+
priority: 990,
|
|
297
|
+
conditions: [
|
|
298
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
299
|
+
{ field: 'filePath', operator: 'matches_regex', value: '^(/etc|/sys|/proc|/boot|C:\\\\Windows|C:\\\\System32)' }
|
|
300
|
+
],
|
|
301
|
+
conditionLogic: 'all',
|
|
302
|
+
actions: [
|
|
303
|
+
{ type: 'deny', message: 'Access to system files is prohibited' }
|
|
304
|
+
],
|
|
305
|
+
riskWeight: 65,
|
|
306
|
+
tags: ['storage', 'filesystem', 'security', 'system-files']
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: 'storage-fs-002',
|
|
310
|
+
name: 'Require Approval for Config File Changes',
|
|
311
|
+
description: 'Configuration file modifications require approval in production',
|
|
312
|
+
type: 'security',
|
|
313
|
+
enabled: true,
|
|
314
|
+
priority: 900,
|
|
315
|
+
conditions: [
|
|
316
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
317
|
+
{ field: 'operation', operator: 'in', value: ['write', 'delete', 'modify'] },
|
|
318
|
+
{ field: 'filePath', operator: 'matches_regex', value: '\\.(conf|config|yml|yaml|json|env|ini|toml)$' },
|
|
319
|
+
{ field: 'environment', operator: 'equals', value: 'production' }
|
|
320
|
+
],
|
|
321
|
+
conditionLogic: 'all',
|
|
322
|
+
actions: [
|
|
323
|
+
{ type: 'require_approval', message: 'Production configuration file changes require approval' }
|
|
324
|
+
],
|
|
325
|
+
riskWeight: 35,
|
|
326
|
+
tags: ['storage', 'filesystem', 'configuration', 'production']
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: 'storage-fs-003',
|
|
330
|
+
name: 'Prevent Path Traversal',
|
|
331
|
+
description: 'File paths must not contain path traversal sequences',
|
|
332
|
+
type: 'security',
|
|
333
|
+
enabled: true,
|
|
334
|
+
priority: 1000,
|
|
335
|
+
conditions: [
|
|
336
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
337
|
+
{ field: 'filePath', operator: 'matches_regex', value: '(\\.\\./|\\.\\.\\\\|%2e%2e)' }
|
|
338
|
+
],
|
|
339
|
+
conditionLogic: 'all',
|
|
340
|
+
actions: [
|
|
341
|
+
{ type: 'deny', message: 'Path traversal attack detected - operation blocked' },
|
|
342
|
+
{ type: 'notify', message: 'Security alert: Path traversal attempt detected' }
|
|
343
|
+
],
|
|
344
|
+
riskWeight: 80,
|
|
345
|
+
tags: ['storage', 'filesystem', 'security', 'path-traversal']
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
id: 'storage-fs-004',
|
|
349
|
+
name: 'File Size Limit Enforcement',
|
|
350
|
+
description: 'File operations must respect size limits',
|
|
351
|
+
type: 'operational',
|
|
352
|
+
enabled: true,
|
|
353
|
+
priority: 850,
|
|
354
|
+
conditions: [
|
|
355
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
356
|
+
{ field: 'operation', operator: 'in', value: ['write', 'upload'] },
|
|
357
|
+
{ field: 'fileSize', operator: 'greater_than', value: 104857600 } // 100MB
|
|
358
|
+
],
|
|
359
|
+
conditionLogic: 'all',
|
|
360
|
+
actions: [
|
|
361
|
+
{ type: 'require_approval', message: 'File upload >100MB requires approval' }
|
|
362
|
+
],
|
|
363
|
+
riskWeight: 25,
|
|
364
|
+
tags: ['storage', 'filesystem', 'upload', 'size-limit']
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: 'storage-fs-005',
|
|
368
|
+
name: 'Temp File Cleanup Required',
|
|
369
|
+
description: 'Temporary files must be cleaned up after use',
|
|
370
|
+
type: 'operational',
|
|
371
|
+
enabled: true,
|
|
372
|
+
priority: 750,
|
|
373
|
+
conditions: [
|
|
374
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
375
|
+
{ field: 'filePath', operator: 'matches_regex', value: '(/tmp/|/temp/|\\\\temp\\\\|\\\\tmp\\\\|\\.tmp$)' },
|
|
376
|
+
{ field: 'hasCleanupStrategy', operator: 'not_equals', value: true }
|
|
377
|
+
],
|
|
378
|
+
conditionLogic: 'all',
|
|
379
|
+
actions: [
|
|
380
|
+
{ type: 'warn', message: 'Temporary files should have cleanup strategy (TTL or explicit deletion)' }
|
|
381
|
+
],
|
|
382
|
+
riskWeight: 15,
|
|
383
|
+
tags: ['storage', 'filesystem', 'temp', 'cleanup']
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
id: 'storage-fs-006',
|
|
387
|
+
name: 'Executable Upload Prevention',
|
|
388
|
+
description: 'Prevent upload of executable files',
|
|
389
|
+
type: 'security',
|
|
390
|
+
enabled: true,
|
|
391
|
+
priority: 970,
|
|
392
|
+
conditions: [
|
|
393
|
+
{ field: 'storageType', operator: 'equals', value: 'filesystem' },
|
|
394
|
+
{ field: 'operation', operator: 'equals', value: 'upload' },
|
|
395
|
+
{ field: 'filePath', operator: 'matches_regex', value: '\\.(exe|dll|sh|bash|ps1|bat|cmd|msi|jar|py|rb|php|pl)$' }
|
|
396
|
+
],
|
|
397
|
+
conditionLogic: 'all',
|
|
398
|
+
actions: [
|
|
399
|
+
{ type: 'deny', message: 'Executable file uploads are prohibited for security' }
|
|
400
|
+
],
|
|
401
|
+
riskWeight: 60,
|
|
402
|
+
tags: ['storage', 'filesystem', 'security', 'executable', 'upload']
|
|
403
|
+
}
|
|
404
|
+
];
|
|
405
|
+
// ============================================================================
|
|
406
|
+
// CACHE RULES
|
|
407
|
+
// ============================================================================
|
|
408
|
+
const cacheStorageRules = [
|
|
409
|
+
{
|
|
410
|
+
id: 'storage-cache-001',
|
|
411
|
+
name: 'Cache TTL Required',
|
|
412
|
+
description: 'Cached data must have explicit TTL to prevent stale data',
|
|
413
|
+
type: 'architecture',
|
|
414
|
+
enabled: true,
|
|
415
|
+
priority: 850,
|
|
416
|
+
conditions: [
|
|
417
|
+
{ field: 'storageType', operator: 'in', value: ['redis', 'memcached', 'cache'] },
|
|
418
|
+
{ field: 'operation', operator: 'equals', value: 'set' },
|
|
419
|
+
{ field: 'ttlSet', operator: 'not_equals', value: true }
|
|
420
|
+
],
|
|
421
|
+
conditionLogic: 'all',
|
|
422
|
+
actions: [
|
|
423
|
+
{ type: 'warn', message: 'Cache entries should have explicit TTL to prevent stale data' }
|
|
424
|
+
],
|
|
425
|
+
riskWeight: 20,
|
|
426
|
+
tags: ['storage', 'cache', 'ttl', 'staleness']
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
id: 'storage-cache-002',
|
|
430
|
+
name: 'No Sensitive Data in Cache',
|
|
431
|
+
description: 'Sensitive data must not be cached without encryption',
|
|
432
|
+
type: 'security',
|
|
433
|
+
enabled: true,
|
|
434
|
+
priority: 930,
|
|
435
|
+
conditions: [
|
|
436
|
+
{ field: 'storageType', operator: 'in', value: ['redis', 'memcached', 'cache'] },
|
|
437
|
+
{ field: 'dataClassification', operator: 'in', value: ['confidential', 'restricted'] },
|
|
438
|
+
{ field: 'encryptionEnabled', operator: 'not_equals', value: true }
|
|
439
|
+
],
|
|
440
|
+
conditionLogic: 'all',
|
|
441
|
+
actions: [
|
|
442
|
+
{ type: 'deny', message: 'Sensitive data must be encrypted before caching' }
|
|
443
|
+
],
|
|
444
|
+
riskWeight: 50,
|
|
445
|
+
tags: ['storage', 'cache', 'security', 'encryption']
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: 'storage-cache-003',
|
|
449
|
+
name: 'Cache Key Namespacing',
|
|
450
|
+
description: 'Cache keys should use namespacing to prevent collisions',
|
|
451
|
+
type: 'architecture',
|
|
452
|
+
enabled: true,
|
|
453
|
+
priority: 750,
|
|
454
|
+
conditions: [
|
|
455
|
+
{ field: 'storageType', operator: 'in', value: ['redis', 'memcached', 'cache'] },
|
|
456
|
+
{ field: 'cacheKeyNamespaced', operator: 'not_equals', value: true },
|
|
457
|
+
{ field: 'environment', operator: 'equals', value: 'production' }
|
|
458
|
+
],
|
|
459
|
+
conditionLogic: 'all',
|
|
460
|
+
actions: [
|
|
461
|
+
{ type: 'warn', message: 'Cache keys should use namespace prefix (e.g., app:env:key) to prevent collisions' }
|
|
462
|
+
],
|
|
463
|
+
riskWeight: 15,
|
|
464
|
+
tags: ['storage', 'cache', 'namespacing', 'best-practice']
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: 'storage-cache-004',
|
|
468
|
+
name: 'Cache Eviction Strategy Required',
|
|
469
|
+
description: 'Cache should have defined eviction strategy',
|
|
470
|
+
type: 'architecture',
|
|
471
|
+
enabled: true,
|
|
472
|
+
priority: 800,
|
|
473
|
+
conditions: [
|
|
474
|
+
{ field: 'storageType', operator: 'in', value: ['redis', 'memcached', 'cache'] },
|
|
475
|
+
{ field: 'evictionPolicy', operator: 'not_exists', value: null },
|
|
476
|
+
{ field: 'environment', operator: 'equals', value: 'production' }
|
|
477
|
+
],
|
|
478
|
+
conditionLogic: 'all',
|
|
479
|
+
actions: [
|
|
480
|
+
{ type: 'warn', message: 'Production cache should define eviction policy (LRU, LFU, etc.)' }
|
|
481
|
+
],
|
|
482
|
+
riskWeight: 20,
|
|
483
|
+
tags: ['storage', 'cache', 'eviction', 'memory']
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
id: 'storage-cache-005',
|
|
487
|
+
name: 'Cache Stampede Prevention',
|
|
488
|
+
description: 'High-traffic cache entries should use stampede protection',
|
|
489
|
+
type: 'architecture',
|
|
490
|
+
enabled: true,
|
|
491
|
+
priority: 820,
|
|
492
|
+
conditions: [
|
|
493
|
+
{ field: 'storageType', operator: 'in', value: ['redis', 'memcached', 'cache'] },
|
|
494
|
+
{ field: 'accessFrequency', operator: 'equals', value: 'high' },
|
|
495
|
+
{ field: 'stampedeProtection', operator: 'not_equals', value: true }
|
|
496
|
+
],
|
|
497
|
+
conditionLogic: 'all',
|
|
498
|
+
actions: [
|
|
499
|
+
{ type: 'warn', message: 'High-frequency cache keys should use stampede protection (locking or probabilistic early expiry)' }
|
|
500
|
+
],
|
|
501
|
+
riskWeight: 25,
|
|
502
|
+
tags: ['storage', 'cache', 'stampede', 'performance']
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
id: 'storage-cache-006',
|
|
506
|
+
name: 'CDN Cache Headers Required',
|
|
507
|
+
description: 'CDN-cached resources must have proper cache control headers',
|
|
508
|
+
type: 'architecture',
|
|
509
|
+
enabled: true,
|
|
510
|
+
priority: 780,
|
|
511
|
+
conditions: [
|
|
512
|
+
{ field: 'storageType', operator: 'equals', value: 'cdn' },
|
|
513
|
+
{ field: 'cacheControlSet', operator: 'not_equals', value: true }
|
|
514
|
+
],
|
|
515
|
+
conditionLogic: 'all',
|
|
516
|
+
actions: [
|
|
517
|
+
{ type: 'warn', message: 'CDN resources should have Cache-Control headers for proper edge caching' }
|
|
518
|
+
],
|
|
519
|
+
riskWeight: 15,
|
|
520
|
+
tags: ['storage', 'cache', 'cdn', 'headers']
|
|
521
|
+
}
|
|
522
|
+
];
|
|
523
|
+
// ============================================================================
|
|
524
|
+
// BLOB/OBJECT STORAGE RULES
|
|
525
|
+
// ============================================================================
|
|
526
|
+
const blobStorageRules = [
|
|
527
|
+
{
|
|
528
|
+
id: 'storage-blob-001',
|
|
529
|
+
name: 'Private Bucket by Default',
|
|
530
|
+
description: 'Object storage buckets must be private unless explicitly required',
|
|
531
|
+
type: 'security',
|
|
532
|
+
enabled: true,
|
|
533
|
+
priority: 960,
|
|
534
|
+
conditions: [
|
|
535
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
536
|
+
{ field: 'operation', operator: 'equals', value: 'create_bucket' },
|
|
537
|
+
{ field: 'publicAccess', operator: 'equals', value: true }
|
|
538
|
+
],
|
|
539
|
+
conditionLogic: 'all',
|
|
540
|
+
actions: [
|
|
541
|
+
{ type: 'require_approval', message: 'Public bucket creation requires security review' }
|
|
542
|
+
],
|
|
543
|
+
riskWeight: 55,
|
|
544
|
+
tags: ['storage', 'blob', 'security', 'public-access']
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
id: 'storage-blob-002',
|
|
548
|
+
name: 'Server-Side Encryption Required',
|
|
549
|
+
description: 'Object storage must use server-side encryption',
|
|
550
|
+
type: 'security',
|
|
551
|
+
enabled: true,
|
|
552
|
+
priority: 940,
|
|
553
|
+
conditions: [
|
|
554
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
555
|
+
{ field: 'environment', operator: 'equals', value: 'production' },
|
|
556
|
+
{ field: 'sseEnabled', operator: 'not_equals', value: true }
|
|
557
|
+
],
|
|
558
|
+
conditionLogic: 'all',
|
|
559
|
+
actions: [
|
|
560
|
+
{ type: 'deny', message: 'Production object storage must use server-side encryption (SSE)' }
|
|
561
|
+
],
|
|
562
|
+
riskWeight: 50,
|
|
563
|
+
tags: ['storage', 'blob', 'security', 'encryption', 'sse']
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
id: 'storage-blob-003',
|
|
567
|
+
name: 'Lifecycle Policy Required',
|
|
568
|
+
description: 'Object storage buckets should have lifecycle policies',
|
|
569
|
+
type: 'operational',
|
|
570
|
+
enabled: true,
|
|
571
|
+
priority: 800,
|
|
572
|
+
conditions: [
|
|
573
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
574
|
+
{ field: 'operation', operator: 'equals', value: 'create_bucket' },
|
|
575
|
+
{ field: 'lifecyclePolicySet', operator: 'not_equals', value: true }
|
|
576
|
+
],
|
|
577
|
+
conditionLogic: 'all',
|
|
578
|
+
actions: [
|
|
579
|
+
{ type: 'warn', message: 'Object storage buckets should have lifecycle policies for cost optimization' }
|
|
580
|
+
],
|
|
581
|
+
riskWeight: 20,
|
|
582
|
+
tags: ['storage', 'blob', 'lifecycle', 'cost']
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
id: 'storage-blob-004',
|
|
586
|
+
name: 'Versioning for Critical Data',
|
|
587
|
+
description: 'Critical data buckets should enable versioning',
|
|
588
|
+
type: 'operational',
|
|
589
|
+
enabled: true,
|
|
590
|
+
priority: 850,
|
|
591
|
+
conditions: [
|
|
592
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
593
|
+
{ field: 'dataClassification', operator: 'in', value: ['confidential', 'critical'] },
|
|
594
|
+
{ field: 'versioningEnabled', operator: 'not_equals', value: true }
|
|
595
|
+
],
|
|
596
|
+
conditionLogic: 'all',
|
|
597
|
+
actions: [
|
|
598
|
+
{ type: 'warn', message: 'Critical data buckets should enable versioning for recovery' }
|
|
599
|
+
],
|
|
600
|
+
riskWeight: 25,
|
|
601
|
+
tags: ['storage', 'blob', 'versioning', 'recovery']
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
id: 'storage-blob-005',
|
|
605
|
+
name: 'CORS Configuration Required',
|
|
606
|
+
description: 'Web-accessible blob storage must have explicit CORS configuration',
|
|
607
|
+
type: 'security',
|
|
608
|
+
enabled: true,
|
|
609
|
+
priority: 880,
|
|
610
|
+
conditions: [
|
|
611
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
612
|
+
{ field: 'webAccessible', operator: 'equals', value: true },
|
|
613
|
+
{ field: 'corsConfigured', operator: 'not_equals', value: true }
|
|
614
|
+
],
|
|
615
|
+
conditionLogic: 'all',
|
|
616
|
+
actions: [
|
|
617
|
+
{ type: 'warn', message: 'Web-accessible blob storage should have explicit CORS configuration' }
|
|
618
|
+
],
|
|
619
|
+
riskWeight: 30,
|
|
620
|
+
tags: ['storage', 'blob', 'security', 'cors']
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
id: 'storage-blob-006',
|
|
624
|
+
name: 'Presigned URL Expiry Limit',
|
|
625
|
+
description: 'Presigned URLs must have short expiry times',
|
|
626
|
+
type: 'security',
|
|
627
|
+
enabled: true,
|
|
628
|
+
priority: 900,
|
|
629
|
+
conditions: [
|
|
630
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
631
|
+
{ field: 'operation', operator: 'equals', value: 'generate_presigned_url' },
|
|
632
|
+
{ field: 'urlExpirySeconds', operator: 'greater_than', value: 3600 } // 1 hour
|
|
633
|
+
],
|
|
634
|
+
conditionLogic: 'all',
|
|
635
|
+
actions: [
|
|
636
|
+
{ type: 'warn', message: 'Presigned URLs should expire within 1 hour for security' }
|
|
637
|
+
],
|
|
638
|
+
riskWeight: 35,
|
|
639
|
+
tags: ['storage', 'blob', 'security', 'presigned-url']
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
id: 'storage-blob-007',
|
|
643
|
+
name: 'Cross-Region Replication for DR',
|
|
644
|
+
description: 'Critical buckets should have cross-region replication for disaster recovery',
|
|
645
|
+
type: 'operational',
|
|
646
|
+
enabled: true,
|
|
647
|
+
priority: 750,
|
|
648
|
+
conditions: [
|
|
649
|
+
{ field: 'storageType', operator: 'in', value: ['s3', 'azure-blob', 'gcs', 'blob'] },
|
|
650
|
+
{ field: 'dataClassification', operator: 'equals', value: 'critical' },
|
|
651
|
+
{ field: 'crossRegionReplication', operator: 'not_equals', value: true },
|
|
652
|
+
{ field: 'environment', operator: 'equals', value: 'production' }
|
|
653
|
+
],
|
|
654
|
+
conditionLogic: 'all',
|
|
655
|
+
actions: [
|
|
656
|
+
{ type: 'warn', message: 'Critical production data should have cross-region replication for DR' }
|
|
657
|
+
],
|
|
658
|
+
riskWeight: 30,
|
|
659
|
+
tags: ['storage', 'blob', 'replication', 'disaster-recovery']
|
|
660
|
+
}
|
|
661
|
+
];
|
|
662
|
+
// ============================================================================
|
|
663
|
+
// COMBINED EXPORT
|
|
664
|
+
// ============================================================================
|
|
665
|
+
export const storageRules = [
|
|
666
|
+
...browserStorageRules,
|
|
667
|
+
...databaseStorageRules,
|
|
668
|
+
...fileSystemStorageRules,
|
|
669
|
+
...cacheStorageRules,
|
|
670
|
+
...blobStorageRules
|
|
671
|
+
];
|
|
672
|
+
//# sourceMappingURL=storage.js.map
|