@vollcrypt/db-guard 0.1.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.
@@ -0,0 +1,562 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Vollcrypt Compliance Scorecard</title>
7
+ <meta name="description" content="Official cryptographic compliance validation report for GDPR, KVKK, and PCI-DSS.">
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <style>
12
+ :root {
13
+ --bg-primary: #0B0F19;
14
+ --bg-secondary: #161F30;
15
+ --accent: #2563EB;
16
+ --accent-glow: rgba(37, 99, 235, 0.15);
17
+ --text-main: #F3F4F6;
18
+ --text-muted: #9CA3AF;
19
+ --success: #10B981;
20
+ --warning: #F59E0B;
21
+ --failed: #EF4444;
22
+ --border: rgba(255, 255, 255, 0.08);
23
+ --glass: rgba(22, 31, 48, 0.7);
24
+ }
25
+
26
+ * {
27
+ box-sizing: border-box;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ body {
33
+ background-color: var(--bg-primary);
34
+ color: var(--text-main);
35
+ font-family: 'Inter', sans-serif;
36
+ line-height: 1.6;
37
+ padding: 40px 20px;
38
+ }
39
+
40
+ .container {
41
+ max-width: 900px;
42
+ margin: 0 auto;
43
+ }
44
+
45
+ header {
46
+ background: linear-gradient(135deg, #1E293B, #0F172A);
47
+ border: 1px solid var(--border);
48
+ border-radius: 16px;
49
+ padding: 40px;
50
+ margin-bottom: 30px;
51
+ position: relative;
52
+ overflow: hidden;
53
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
54
+ }
55
+
56
+ header::before {
57
+ content: '';
58
+ position: absolute;
59
+ top: -50%;
60
+ right: -20%;
61
+ width: 300px;
62
+ height: 300px;
63
+ background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
64
+ pointer-events: none;
65
+ }
66
+
67
+ .header-top {
68
+ display: flex;
69
+ justify-content: space-between;
70
+ align-items: flex-start;
71
+ margin-bottom: 20px;
72
+ }
73
+
74
+ .logo-container h1 {
75
+ font-family: 'Outfit', sans-serif;
76
+ font-size: 2.2rem;
77
+ font-weight: 700;
78
+ background: linear-gradient(to right, #60A5FA, #2563EB);
79
+ -webkit-background-clip: text;
80
+ -webkit-text-fill-color: transparent;
81
+ letter-spacing: -0.02em;
82
+ }
83
+
84
+ .logo-container p {
85
+ color: var(--text-muted);
86
+ font-size: 0.95rem;
87
+ font-weight: 500;
88
+ margin-top: 4px;
89
+ }
90
+
91
+ .metadata-box {
92
+ text-align: right;
93
+ font-size: 0.85rem;
94
+ color: var(--text-muted);
95
+ }
96
+
97
+ .metadata-box strong {
98
+ color: var(--text-main);
99
+ }
100
+
101
+ .summary-section {
102
+ background-color: rgba(255, 255, 255, 0.03);
103
+ border-left: 4px solid var(--accent);
104
+ padding: 20px;
105
+ border-radius: 0 8px 8px 0;
106
+ margin-top: 20px;
107
+ }
108
+
109
+ .summary-section p {
110
+ font-size: 0.95rem;
111
+ color: #D1D5DB;
112
+ }
113
+
114
+ .score-grid {
115
+ display: grid;
116
+ grid-template-columns: repeat(3, 1fr);
117
+ gap: 20px;
118
+ margin-bottom: 40px;
119
+ }
120
+
121
+ .score-card {
122
+ background-color: var(--bg-secondary);
123
+ border: 1px solid var(--border);
124
+ border-radius: 16px;
125
+ padding: 30px 20px;
126
+ text-align: center;
127
+ transition: transform 0.2s, box-shadow 0.2s;
128
+ }
129
+
130
+ .score-card:hover {
131
+ transform: translateY(-4px);
132
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
133
+ }
134
+
135
+ .score-card h2 {
136
+ font-family: 'Outfit', sans-serif;
137
+ font-size: 1.1rem;
138
+ color: var(--text-muted);
139
+ font-weight: 600;
140
+ margin-bottom: 15px;
141
+ }
142
+
143
+ .score-ring {
144
+ position: relative;
145
+ width: 120px;
146
+ height: 120px;
147
+ margin: 0 auto 15px auto;
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
+ }
152
+
153
+ .score-number {
154
+ font-family: 'Outfit', sans-serif;
155
+ font-size: 2.2rem;
156
+ font-weight: 700;
157
+ color: var(--text-main);
158
+ }
159
+
160
+ .score-percent {
161
+ font-size: 1rem;
162
+ color: var(--text-muted);
163
+ font-weight: 500;
164
+ }
165
+
166
+ .score-ring svg {
167
+ position: absolute;
168
+ top: 0;
169
+ left: 0;
170
+ width: 100%;
171
+ height: 100%;
172
+ transform: rotate(-90deg);
173
+ }
174
+
175
+ .score-ring circle {
176
+ fill: none;
177
+ stroke-width: 8;
178
+ }
179
+
180
+ .score-ring .bg {
181
+ stroke: rgba(255, 255, 255, 0.05);
182
+ }
183
+
184
+ .score-ring .bar {
185
+ stroke: var(--accent);
186
+ stroke-linecap: round;
187
+ transition: stroke-dashoffset 1s ease-out;
188
+ }
189
+
190
+ .section-title {
191
+ font-family: 'Outfit', sans-serif;
192
+ font-size: 1.5rem;
193
+ font-weight: 600;
194
+ margin-bottom: 20px;
195
+ padding-bottom: 8px;
196
+ border-bottom: 1px solid var(--border);
197
+ display: flex;
198
+ justify-content: space-between;
199
+ align-items: center;
200
+ }
201
+
202
+ .checks-list {
203
+ display: flex;
204
+ flex-direction: column;
205
+ gap: 15px;
206
+ margin-bottom: 40px;
207
+ }
208
+
209
+ .check-card {
210
+ background-color: var(--bg-secondary);
211
+ border: 1px solid var(--border);
212
+ border-radius: 12px;
213
+ padding: 20px;
214
+ display: flex;
215
+ gap: 20px;
216
+ align-items: flex-start;
217
+ }
218
+
219
+ .check-card.passed {
220
+ border-left: 4px solid var(--success);
221
+ }
222
+
223
+ .check-card.failed {
224
+ border-left: 4px solid var(--warning);
225
+ }
226
+
227
+ .status-badge-container {
228
+ flex-shrink: 0;
229
+ }
230
+
231
+ .badge {
232
+ font-size: 0.75rem;
233
+ font-weight: 700;
234
+ padding: 4px 10px;
235
+ border-radius: 9999px;
236
+ letter-spacing: 0.05em;
237
+ }
238
+
239
+ .passed-badge {
240
+ background-color: rgba(16, 185, 129, 0.1);
241
+ color: var(--success);
242
+ border: 1px solid rgba(16, 185, 129, 0.2);
243
+ }
244
+
245
+ .failed-badge {
246
+ background-color: rgba(245, 158, 11, 0.1);
247
+ color: var(--warning);
248
+ border: 1px solid rgba(245, 158, 11, 0.2);
249
+ }
250
+
251
+ .check-content h3 {
252
+ font-family: 'Outfit', sans-serif;
253
+ font-size: 1.05rem;
254
+ font-weight: 600;
255
+ color: var(--text-main);
256
+ margin-bottom: 6px;
257
+ }
258
+
259
+ .check-content p {
260
+ font-size: 0.9rem;
261
+ color: var(--text-muted);
262
+ }
263
+
264
+ .btn-container {
265
+ text-align: center;
266
+ margin-top: 40px;
267
+ margin-bottom: 60px;
268
+ }
269
+
270
+ .print-btn {
271
+ background: linear-gradient(135deg, #3B82F6, #2563EB);
272
+ color: white;
273
+ border: none;
274
+ border-radius: 8px;
275
+ padding: 14px 28px;
276
+ font-family: 'Outfit', sans-serif;
277
+ font-size: 1rem;
278
+ font-weight: 600;
279
+ cursor: pointer;
280
+ box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
281
+ transition: transform 0.2s, box-shadow 0.2s;
282
+ }
283
+
284
+ .print-btn:hover {
285
+ transform: translateY(-2px);
286
+ box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
287
+ }
288
+
289
+ .footer-seal {
290
+ text-align: center;
291
+ border-top: 1px dashed var(--border);
292
+ padding-top: 30px;
293
+ font-size: 0.8rem;
294
+ color: var(--text-muted);
295
+ }
296
+
297
+ .footer-seal p {
298
+ margin-bottom: 4px;
299
+ }
300
+
301
+ .seal-hash {
302
+ font-family: monospace;
303
+ font-size: 0.9rem;
304
+ color: var(--accent);
305
+ letter-spacing: 0.05em;
306
+ }
307
+
308
+ /* Print Styles */
309
+ @media print {
310
+ body {
311
+ background-color: white;
312
+ color: black;
313
+ padding: 0;
314
+ }
315
+ :root {
316
+ --bg-primary: #ffffff;
317
+ --bg-secondary: #ffffff;
318
+ --text-main: #000000;
319
+ --text-muted: #4b5563;
320
+ --border: #d1d5db;
321
+ --accent: #1d4ed8;
322
+ }
323
+ header {
324
+ background: none;
325
+ border: 1px solid #9ca3af;
326
+ box-shadow: none;
327
+ color: black;
328
+ }
329
+ .logo-container h1 {
330
+ background: none;
331
+ -webkit-text-fill-color: black;
332
+ color: black;
333
+ }
334
+ .score-card {
335
+ border: 1px solid #9ca3af;
336
+ background-color: white;
337
+ box-shadow: none;
338
+ }
339
+ .score-number {
340
+ color: black;
341
+ }
342
+ .check-card {
343
+ border: 1px solid #9ca3af;
344
+ background-color: white;
345
+ page-break-inside: avoid;
346
+ }
347
+ .check-card.passed {
348
+ border-left: 6px solid #059669;
349
+ }
350
+ .check-card.failed {
351
+ border-left: 6px solid #d97706;
352
+ }
353
+ .btn-container {
354
+ display: none;
355
+ }
356
+ .passed-badge {
357
+ color: #059669;
358
+ border: 1px solid #059669;
359
+ }
360
+ .failed-badge {
361
+ color: #d97706;
362
+ border: 1px solid #d97706;
363
+ }
364
+ }
365
+ </style>
366
+ </head>
367
+ <body>
368
+ <div class="container">
369
+ <header>
370
+ <div class="header-top">
371
+ <div class="logo-container">
372
+ <h1>VOLLCRYPT</h1>
373
+ <p>Database Cryptographic Security Scorecard</p>
374
+ </div>
375
+ <div class="metadata-box">
376
+ <p>Scan Timestamp: <strong>2026-06-11 12:15:53 UTC</strong></p>
377
+ <p>Verification Standard: <strong>CMVP FIPS 140-3</strong></p>
378
+ <p>Product Version: <strong>0.1.0</strong></p>
379
+ </div>
380
+ </div>
381
+ <div class="summary-section">
382
+ <p>This system is configured using AES-256-GCM for field-level encryption, dynamic key routing with automatic RAM zeroization, and secure HKDF-SHA256 blind indexing. Cryptographic validation certifies compliance of the data protection boundaries with GDPR Article 32, KVKK Article 12, and PCI-DSS v4.0 Requirement 3.</p>
383
+ </div>
384
+ </header>
385
+
386
+ <main>
387
+ <section class="score-grid">
388
+ <!-- GDPR Score Card -->
389
+ <div class="score-card">
390
+ <h2>GDPR Compliance</h2>
391
+ <div class="score-ring">
392
+ <svg>
393
+ <circle class="bg" cx="60" cy="60" r="50"></circle>
394
+ <circle class="bar" cx="60" cy="60" r="50" style="stroke-dasharray: 314; stroke-dashoffset: 0; stroke: #10B981;"></circle>
395
+ </svg>
396
+ <div class="score-number">100<span class="score-percent">%</span></div>
397
+ </div>
398
+ <p style="font-size: 0.85rem; color: var(--text-muted);">Article 32 Security requirements</p>
399
+ </div>
400
+
401
+ <!-- KVKK Score Card -->
402
+ <div class="score-card">
403
+ <h2>KVKK Compliance</h2>
404
+ <div class="score-ring">
405
+ <svg>
406
+ <circle class="bg" cx="60" cy="60" r="50"></circle>
407
+ <circle class="bar" cx="60" cy="60" r="50" style="stroke-dasharray: 314; stroke-dashoffset: 0; stroke: #F59E0B;"></circle>
408
+ </svg>
409
+ <div class="score-number">100<span class="score-percent">%</span></div>
410
+ </div>
411
+ <p style="font-size: 0.85rem; color: var(--text-muted);">Article 12 Security requirements</p>
412
+ </div>
413
+
414
+ <!-- PCI-DSS Score Card -->
415
+ <div class="score-card">
416
+ <h2>PCI-DSS v4.0</h2>
417
+ <div class="score-ring">
418
+ <svg>
419
+ <circle class="bg" cx="60" cy="60" r="50"></circle>
420
+ <circle class="bar" cx="60" cy="60" r="50" style="stroke-dasharray: 314; stroke-dashoffset: 0; stroke: #3B82F6;"></circle>
421
+ </svg>
422
+ <div class="score-number">100<span class="score-percent">%</span></div>
423
+ </div>
424
+ <p style="font-size: 0.85rem; color: var(--text-muted);">Requirement 3 Card protection</p>
425
+ </div>
426
+ </section>
427
+
428
+ <section>
429
+ <div class="section-title">
430
+ <span>Cryptographic Status Checkpoints</span>
431
+ <span style="font-size: 0.85rem; font-weight: 500; color: var(--text-muted);">11 Passed / 0 Recommendations</span>
432
+ </div>
433
+
434
+ <div class="checks-list">
435
+
436
+ <div class="check-card passed">
437
+ <div class="status-badge-container">
438
+ <span class="badge passed-badge">PASSED</span>
439
+ </div>
440
+ <div class="check-content">
441
+ <h3>KMS INTEGRATION</h3>
442
+ <p>Cryptographic keys are securely delegated to a Cloud KMS Provider (AWS, GCP, or HashiCorp Vault).</p>
443
+ </div>
444
+ </div>
445
+
446
+ <div class="check-card passed">
447
+ <div class="status-badge-container">
448
+ <span class="badge passed-badge">PASSED</span>
449
+ </div>
450
+ <div class="check-content">
451
+ <h3>ENVELOPE ENCRYPTION</h3>
452
+ <p>Keys are protected using double-envelope encryption with AES-256-KW.</p>
453
+ </div>
454
+ </div>
455
+
456
+ <div class="check-card passed">
457
+ <div class="status-badge-container">
458
+ <span class="badge passed-badge">PASSED</span>
459
+ </div>
460
+ <div class="check-content">
461
+ <h3>RAM ZEROIZATION</h3>
462
+ <p>All active keys and intermediate buffers are zeroized in RAM immediately after use (Anti-Core Dump protection).</p>
463
+ </div>
464
+ </div>
465
+
466
+ <div class="check-card passed">
467
+ <div class="status-badge-container">
468
+ <span class="badge passed-badge">PASSED</span>
469
+ </div>
470
+ <div class="check-content">
471
+ <h3>BLIND INDEXING</h3>
472
+ <p>Database query translations target secure HKDF-SHA256 blind indexes, preventing raw column decryption leakage.</p>
473
+ </div>
474
+ </div>
475
+
476
+ <div class="check-card passed">
477
+ <div class="status-badge-container">
478
+ <span class="badge passed-badge">PASSED</span>
479
+ </div>
480
+ <div class="check-content">
481
+ <h3>CRYPTO RBAC</h3>
482
+ <p>Application roles are cryptographically mapped to decryption permissions. Unauthorized users are blocked.</p>
483
+ </div>
484
+ </div>
485
+
486
+ <div class="check-card passed">
487
+ <div class="status-badge-container">
488
+ <span class="badge passed-badge">PASSED</span>
489
+ </div>
490
+ <div class="check-content">
491
+ <h3>DYNAMIC DATA MASKING</h3>
492
+ <p>Masking filters (credit cards, emails, TC numbers) are applied automatically to unauthorized query results.</p>
493
+ </div>
494
+ </div>
495
+
496
+ <div class="check-card passed">
497
+ <div class="status-badge-container">
498
+ <span class="badge passed-badge">PASSED</span>
499
+ </div>
500
+ <div class="check-content">
501
+ <h3>CRYPTO AUDIT LOG</h3>
502
+ <p>Immutable cryptographic SHA-256 hash chains log every decryption event, preventing auditing tampering.</p>
503
+ </div>
504
+ </div>
505
+
506
+ <div class="check-card passed">
507
+ <div class="status-badge-container">
508
+ <span class="badge passed-badge">PASSED</span>
509
+ </div>
510
+ <div class="check-content">
511
+ <h3>FAIL CLOSED RATE LIMITER</h3>
512
+ <p>Rate limiter is configured to fail-closed, purging all active keys from memory upon scraping detection.</p>
513
+ </div>
514
+ </div>
515
+
516
+ <div class="check-card passed">
517
+ <div class="status-badge-container">
518
+ <span class="badge passed-badge">PASSED</span>
519
+ </div>
520
+ <div class="check-content">
521
+ <h3>PAGE SIZE LIMIT</h3>
522
+ <p>Page size checking is active to block massive batch select queries from executing decryptions.</p>
523
+ </div>
524
+ </div>
525
+
526
+ <div class="check-card passed">
527
+ <div class="status-badge-container">
528
+ <span class="badge passed-badge">PASSED</span>
529
+ </div>
530
+ <div class="check-content">
531
+ <h3>BREAK GLASS PROTOCOL</h3>
532
+ <p>M-of-N Ed25519 signature threshold configuration is active for KMS outage emergency recovery.</p>
533
+ </div>
534
+ </div>
535
+
536
+ <div class="check-card passed">
537
+ <div class="status-badge-container">
538
+ <span class="badge passed-badge">PASSED</span>
539
+ </div>
540
+ <div class="check-content">
541
+ <h3>POST QUANTUM KEM</h3>
542
+ <p>NIST FIPS 203 (ML-KEM) lattice-based algorithms are registered for hybrid key exchange.</p>
543
+ </div>
544
+ </div>
545
+
546
+
547
+ </div>
548
+ </section>
549
+
550
+ <div class="btn-container">
551
+ <button class="print-btn" onclick="window.print()">Print Compliance PDF Report</button>
552
+ </div>
553
+ </main>
554
+
555
+ <footer class="footer-seal">
556
+ <p>This document constitutes an automated cryptographic verification seal of the database security layer configuration.</p>
557
+ <p>Verification Signature Hash:</p>
558
+ <p class="seal-hash">VOLLSEAL:EF8009C03CBA4CD205DFD4B8E2B0D706</p>
559
+ </footer>
560
+ </div>
561
+ </body>
562
+ </html>
@@ -0,0 +1,40 @@
1
+ export interface ComplianceAuditInput {
2
+ key?: any;
3
+ kms?: {
4
+ provider: any;
5
+ wrappedKey: any;
6
+ wrappedKek?: any;
7
+ activeKeyVersion?: string;
8
+ };
9
+ models?: Record<string, string[]>;
10
+ blindIndexes?: {
11
+ rootSalt: any;
12
+ models: Record<string, string[]>;
13
+ };
14
+ cryptoRbac?: {
15
+ roles: Record<string, {
16
+ decrypt: string[];
17
+ mask?: Record<string, any>;
18
+ }>;
19
+ };
20
+ rateLimiter?: {
21
+ maxDecryptionsPerSecond?: number;
22
+ mode?: 'fail_closed' | 'warn' | 'disabled';
23
+ maxPageSize?: number;
24
+ onPageSizeExceeded?: 'warn' | 'error' | 'bypass';
25
+ };
26
+ auditTrailPath?: string;
27
+ breakGlassThreshold?: number;
28
+ breakGlassPublicKeys?: string[];
29
+ postQuantumEnabled?: boolean;
30
+ }
31
+ export interface ComplianceScorecard {
32
+ gdprScore: number;
33
+ kvkkScore: number;
34
+ pciScore: number;
35
+ passedChecks: string[];
36
+ failedChecks: string[];
37
+ summaryText: string;
38
+ }
39
+ export declare function auditConfiguration(config: ComplianceAuditInput): ComplianceScorecard;
40
+ export declare function generateComplianceHtmlReport(config: ComplianceAuditInput): string;