@greenarmor/ges-doc-generator 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 greenarmor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ import type { ProjectType, ProjectConfig } from "@greenarmor/ges-core";
2
+ export interface GeneratedFile {
3
+ filePath: string;
4
+ content: string;
5
+ }
6
+ export declare function generateComplianceDocs(projectName: string, projectType: ProjectType): GeneratedFile[];
7
+ export declare function generateSecurityDocs(projectName: string, projectType: ProjectType): GeneratedFile[];
8
+ export declare function generateConfigYaml(config: ProjectConfig): GeneratedFile;
9
+ export declare function generateMetadataJson(config: ProjectConfig): GeneratedFile;
10
+ export declare function generateConfigJson(config: ProjectConfig): GeneratedFile;
11
+ export declare function generateFrameworkVersionJson(): GeneratedFile;
12
+ export declare function generateScoreJson(): GeneratedFile;
package/dist/index.js ADDED
@@ -0,0 +1,675 @@
1
+ import { GESF_VERSION, GES_DIR, COMPLIANCE_DIR, SECURITY_DIR } from "@greenarmor/ges-core";
2
+ import * as path from "node:path";
3
+ export function generateComplianceDocs(projectName, projectType) {
4
+ return [
5
+ {
6
+ filePath: path.join(COMPLIANCE_DIR, "gdpr.md"),
7
+ content: generateGDPRDoc(projectName, projectType),
8
+ },
9
+ {
10
+ filePath: path.join(COMPLIANCE_DIR, "data-inventory.md"),
11
+ content: generateDataInventoryDoc(projectName),
12
+ },
13
+ {
14
+ filePath: path.join(COMPLIANCE_DIR, "retention-policy.md"),
15
+ content: generateRetentionPolicyDoc(projectName),
16
+ },
17
+ {
18
+ filePath: path.join(COMPLIANCE_DIR, "processing-records.md"),
19
+ content: generateProcessingRecordsDoc(projectName),
20
+ },
21
+ {
22
+ filePath: path.join(COMPLIANCE_DIR, "risk-register.md"),
23
+ content: generateRiskRegisterDoc(projectName),
24
+ },
25
+ {
26
+ filePath: path.join(COMPLIANCE_DIR, "access-control-matrix.md"),
27
+ content: generateAccessControlMatrixDoc(projectName),
28
+ },
29
+ {
30
+ filePath: path.join(COMPLIANCE_DIR, "privacy-impact-assessment.md"),
31
+ content: generatePIADoc(projectName, projectType),
32
+ },
33
+ ];
34
+ }
35
+ export function generateSecurityDocs(projectName, projectType) {
36
+ return [
37
+ {
38
+ filePath: path.join(SECURITY_DIR, "threat-model.md"),
39
+ content: generateThreatModelDoc(projectName, projectType),
40
+ },
41
+ {
42
+ filePath: path.join(SECURITY_DIR, "key-management.md"),
43
+ content: generateKeyManagementDoc(projectName),
44
+ },
45
+ {
46
+ filePath: path.join(SECURITY_DIR, "logging-policy.md"),
47
+ content: generateLoggingPolicyDoc(projectName),
48
+ },
49
+ {
50
+ filePath: path.join(SECURITY_DIR, "backup-policy.md"),
51
+ content: generateBackupPolicyDoc(projectName),
52
+ },
53
+ {
54
+ filePath: path.join(SECURITY_DIR, "incident-response.md"),
55
+ content: generateIncidentResponseDoc(projectName),
56
+ },
57
+ {
58
+ filePath: path.join(SECURITY_DIR, "disaster-recovery.md"),
59
+ content: generateDisasterRecoveryDoc(projectName),
60
+ },
61
+ {
62
+ filePath: path.join(SECURITY_DIR, "encryption-standard.md"),
63
+ content: generateEncryptionStandardDoc(projectName),
64
+ },
65
+ ];
66
+ }
67
+ export function generateConfigYaml(config) {
68
+ return {
69
+ filePath: path.join(GES_DIR, "config.yaml"),
70
+ content: [
71
+ `project_name: ${config.project_name}`,
72
+ `project_type: ${config.project_type}`,
73
+ `version: ${config.version}`,
74
+ `created_at: ${config.created_at}`,
75
+ ``,
76
+ `frameworks:`,
77
+ ...config.frameworks.map(f => ` - ${f}`),
78
+ ``,
79
+ `requirements:`,
80
+ ...Object.entries(config.requirements).map(([key, val]) => [
81
+ ` ${key}:`,
82
+ ` required: ${val.required}`,
83
+ val.level ? ` level: ${val.level}` : null,
84
+ ].filter(Boolean).join("\n")),
85
+ ].join("\n"),
86
+ };
87
+ }
88
+ export function generateMetadataJson(config) {
89
+ return {
90
+ filePath: path.join(GES_DIR, "metadata.json"),
91
+ content: JSON.stringify({
92
+ project_name: config.project_name,
93
+ project_type: config.project_type,
94
+ initialized_at: config.created_at,
95
+ gesf_version: GESF_VERSION,
96
+ }, null, 2),
97
+ };
98
+ }
99
+ export function generateConfigJson(config) {
100
+ return {
101
+ filePath: path.join(GES_DIR, "config.json"),
102
+ content: JSON.stringify(config, null, 2),
103
+ };
104
+ }
105
+ export function generateFrameworkVersionJson() {
106
+ return {
107
+ filePath: path.join(GES_DIR, "framework-version.json"),
108
+ content: JSON.stringify({
109
+ gesf_version: GESF_VERSION,
110
+ packs: {
111
+ gdpr: "1.0.0",
112
+ owasp: "1.0.0",
113
+ ai: "1.0.0",
114
+ blockchain: "1.0.0",
115
+ government: "1.0.0",
116
+ cis: "1.0.0",
117
+ nist: "1.0.0",
118
+ },
119
+ }, null, 2),
120
+ };
121
+ }
122
+ export function generateScoreJson() {
123
+ return {
124
+ filePath: path.join(GES_DIR, "score.json"),
125
+ content: JSON.stringify({
126
+ overall: 0,
127
+ frameworks: {},
128
+ evaluated_at: new Date().toISOString(),
129
+ }, null, 2),
130
+ };
131
+ }
132
+ function generateGDPRDoc(name, type) {
133
+ return `# GDPR Compliance - ${name}
134
+
135
+ ## Overview
136
+
137
+ This document tracks GDPR compliance for the **${name}** project (type: ${type}).
138
+
139
+ ## Applicable Articles
140
+
141
+ - Article 5: Principles relating to processing of personal data
142
+ - Article 25: Data protection by design and by default
143
+ - Article 30: Records of processing activities
144
+ - Article 32: Security of processing
145
+ - Article 33: Notification of a personal data breach to the supervisory authority
146
+ - Article 34: Communication of a personal data breach to the data subject
147
+
148
+ ## Status
149
+
150
+ > Run \`ges audit\` to evaluate current compliance status.
151
+
152
+ ## Legal Basis
153
+
154
+ Document the legal basis for each processing activity:
155
+ - [ ] Consent
156
+ - [ ] Contract
157
+ - [ ] Legal obligation
158
+ - [ ] Vital interests
159
+ - [ ] Public task
160
+ - [ ] Legitimate interests
161
+
162
+ ## Data Subject Rights
163
+
164
+ Ensure mechanisms exist for:
165
+ - [ ] Right of access (Article 15)
166
+ - [ ] Right to rectification (Article 16)
167
+ - [ ] Right to erasure (Article 17)
168
+ - [ ] Right to restriction (Article 18)
169
+ - [ ] Right to data portability (Article 20)
170
+ - [ ] Right to object (Article 21)
171
+ `;
172
+ }
173
+ function generateDataInventoryDoc(name) {
174
+ return `# Data Inventory - ${name}
175
+
176
+ ## Data Categories
177
+
178
+ | Category | Type | Classification | Retention | Legal Basis |
179
+ |----------|------|---------------|-----------|-------------|
180
+ | User profiles | Personal | Restricted | Account lifetime + 30 days | Contract |
181
+ | Email addresses | Personal | Confidential | Account lifetime + 30 days | Contract |
182
+ | Authentication data | Personal | Restricted | Session duration | Contract |
183
+ | Audit logs | Operational | Internal | 1 year | Legal obligation |
184
+
185
+ ## Data Flows
186
+
187
+ Document all data flows including:
188
+ - Data collection points
189
+ - Processing activities
190
+ - Data storage locations
191
+ - Third-party data sharing
192
+ - Cross-border transfers
193
+
194
+ ## Third-Party Processors
195
+
196
+ | Processor | Purpose | Data Shared | DPA Signed | Location |
197
+ |-----------|---------|-------------|------------|----------|
198
+ | | | | | |
199
+ `;
200
+ }
201
+ function generateRetentionPolicyDoc(name) {
202
+ return `# Data Retention Policy - ${name}
203
+
204
+ ## Retention Periods
205
+
206
+ | Data Category | Retention Period | Justification | Deletion Method |
207
+ |---------------|-----------------|---------------|-----------------|
208
+ | User accounts | Account lifetime + 30 days | Contract fulfillment | Automated deletion |
209
+ | Authentication logs | 90 days | Security monitoring | Automated rotation |
210
+ | Audit logs | 1 year | Legal obligation | Automated archival |
211
+ | Session data | Session duration | Operational | Automatic expiry |
212
+ | Backup data | 90 days | Disaster recovery | Automated rotation |
213
+
214
+ ## Deletion Procedures
215
+
216
+ 1. Automated deletion via scheduled jobs
217
+ 2. Soft delete with scheduled hard delete
218
+ 3. Anonymisation where deletion is not feasible
219
+ 4. Backup exclusion for deleted records
220
+
221
+ ## Review Schedule
222
+
223
+ - Monthly: Review deletion jobs
224
+ - Quarterly: Review retention periods
225
+ - Annually: Full retention policy review
226
+ `;
227
+ }
228
+ function generateProcessingRecordsDoc(name) {
229
+ return `# Records of Processing Activities - ${name}
230
+
231
+ ## Article 30 Requirements
232
+
233
+ ### Controller Information
234
+
235
+ - **Organization**: [To be completed]
236
+ - **Contact**: [To be completed]
237
+ - **DPO**: [To be completed]
238
+
239
+ ### Processing Activities
240
+
241
+ | Activity | Purpose | Data Categories | Recipients | Retention | Transfers | Security Measures |
242
+ |----------|---------|----------------|------------|-----------|-----------|-------------------|
243
+ | | | | | | | |
244
+
245
+ ## Documentation
246
+
247
+ Each processing activity must document:
248
+ 1. Purpose of processing
249
+ 2. Legal basis
250
+ 3. Categories of data subjects
251
+ 4. Categories of personal data
252
+ 5. Categories of recipients
253
+ 6. International transfers
254
+ 7. Retention periods
255
+ 8. Technical and organisational security measures
256
+ `;
257
+ }
258
+ function generateRiskRegisterDoc(name) {
259
+ return `# Risk Register - ${name}
260
+
261
+ ## Risk Assessment
262
+
263
+ | ID | Risk | Likelihood | Impact | Severity | Mitigation | Status |
264
+ |----|------|-----------|--------|----------|------------|--------|
265
+ | R001 | Data breach - unauthorized access | Medium | High | Critical | Encryption, access controls, MFA | Open |
266
+ | R002 | Data breach - external attack | Medium | High | Critical | WAF, vulnerability scanning, patching | Open |
267
+ | R003 | Insider threat | Low | High | High | RBAC, audit logging, least privilege | Open |
268
+ | R004 | Data loss | Low | Critical | Critical | Backups, disaster recovery plan | Open |
269
+ | R005 | Non-compliance | Medium | High | High | Regular audits, compliance scanning | Open |
270
+
271
+ ## Review Schedule
272
+
273
+ - Monthly: Update risk register
274
+ - Quarterly: Risk assessment review
275
+ - Annually: Full risk assessment
276
+ `;
277
+ }
278
+ function generateAccessControlMatrixDoc(name) {
279
+ return `# Access Control Matrix - ${name}
280
+
281
+ ## Roles
282
+
283
+ | Role | Description |
284
+ |------|-------------|
285
+ | Admin | Full system access with audit trail |
286
+ | User | Standard user access |
287
+ | Auditor | Read-only access to audit data |
288
+ | System | Service account for automated processes |
289
+
290
+ ## Permissions Matrix
291
+
292
+ | Resource | Admin | User | Auditor | System |
293
+ |----------|-------|------|---------|--------|
294
+ | User Management | CRUD | R (own) | R | R |
295
+ | Data Access | CRUD | CR (own) | R | CR |
296
+ | Audit Logs | R | - | R | W |
297
+ | Configuration | CRUD | - | R | R |
298
+ | Reports | CRUD | R (own) | R | CR |
299
+
300
+ ## Principles
301
+
302
+ - **Least Privilege**: Users have minimum required access
303
+ - **Deny by Default**: Access denied unless explicitly granted
304
+ - **Separation of Duties**: Critical operations require multiple roles
305
+ `;
306
+ }
307
+ function generatePIADoc(name, type) {
308
+ return `# Privacy Impact Assessment - ${name}
309
+
310
+ ## Project Details
311
+
312
+ - **Project**: ${name}
313
+ - **Type**: ${type}
314
+ - **Assessment Date**: ${new Date().toISOString().split("T")[0]}
315
+ - **Assessor**: [To be completed]
316
+
317
+ ## Data Processing Description
318
+
319
+ ### What data is being processed?
320
+ [To be completed]
321
+
322
+ ### Why is the data being processed?
323
+ [To be completed]
324
+
325
+ ### How is the data being processed?
326
+ [To be completed]
327
+
328
+ ### Where is the data stored?
329
+ [To be completed]
330
+
331
+ ### Who has access?
332
+ [To be completed]
333
+
334
+ ### How long is data retained?
335
+ [To be completed]
336
+
337
+ ## Necessity and Proportionality
338
+
339
+ - [ ] Data processing is necessary for the stated purpose
340
+ - [ ] Data minimisation principles are applied
341
+ - [ ] No less intrusive alternative exists
342
+
343
+ ## Risk Assessment
344
+
345
+ | Risk | Severity | Mitigation |
346
+ |------|----------|------------|
347
+ | Unauthorized access to personal data | High | Encryption, MFA, RBAC |
348
+ | Data breach | High | Security controls, incident response plan |
349
+ | Excessive data collection | Medium | Data minimisation review |
350
+ | Non-compliant data transfer | Medium | Transfer mechanisms in place |
351
+
352
+ ## Compliance Measures
353
+
354
+ - [ ] Legal basis documented
355
+ - [ ] Privacy notice provided
356
+ - [ ] Consent mechanism implemented
357
+ - [ ] Data subject rights supported
358
+ - [ ] Retention policy defined
359
+ - [ ] Security measures implemented
360
+ - [ ] DPIA completed (if required)
361
+
362
+ ## Approval
363
+
364
+ - **DPO Review**: [Pending]
365
+ - **Sign-off**: [Pending]
366
+ `;
367
+ }
368
+ function generateThreatModelDoc(name, type) {
369
+ return `# Threat Model - ${name}
370
+
371
+ ## System Overview
372
+
373
+ - **Project**: ${name}
374
+ - **Type**: ${type}
375
+
376
+ ## Assets
377
+
378
+ - User personal data
379
+ - Authentication credentials
380
+ - Session tokens
381
+ - API keys and secrets
382
+ - Application source code
383
+ - Infrastructure configuration
384
+
385
+ ## Threat Categories (STRIDE)
386
+
387
+ ### Spoofing
388
+ - Unauthorized access via stolen credentials
389
+ - Session hijacking
390
+
391
+ ### Tampering
392
+ - Data modification by unauthorized users
393
+ - SQL injection / NoSQL injection
394
+ - Parameter tampering
395
+
396
+ ### Repudiation
397
+ - Actions performed without audit trail
398
+ - Denial of data access
399
+
400
+ ### Information Disclosure
401
+ - Data breach via API vulnerability
402
+ - Logging of sensitive data
403
+ - Error messages leaking information
404
+
405
+ ### Denial of Service
406
+ - Rate limiting bypass
407
+ - Resource exhaustion
408
+
409
+ ### Elevation of Privilege
410
+ - Role escalation via API
411
+ - IDOR vulnerabilities
412
+ - JWT manipulation
413
+
414
+ ## Mitigations
415
+
416
+ | Threat | Mitigation | Status |
417
+ |--------|------------|--------|
418
+ | Stolen credentials | MFA, Argon2id hashing | [ ] |
419
+ | SQL injection | Parameterized queries, input validation | [ ] |
420
+ | XSS | Output encoding, CSP headers | [ ] |
421
+ | CSRF | CSRF tokens, SameSite cookies | [ ] |
422
+ | Data breach | Encryption at rest and in transit | [ ] |
423
+ | Insider threat | RBAC, audit logging, least privilege | [ ] |
424
+ `;
425
+ }
426
+ function generateKeyManagementDoc(name) {
427
+ return `# Key Management Policy - ${name}
428
+
429
+ ## Approved Algorithms
430
+
431
+ - **Symmetric Encryption**: AES-256-GCM, ChaCha20-Poly1305
432
+ - **Asymmetric Encryption**: RSA-4096, Ed25519
433
+ - **Hashing**: SHA-256, SHA-384, SHA-512
434
+ - **Password Hashing**: Argon2id (recommended), bcrypt
435
+
436
+ ## Key Lifecycle
437
+
438
+ 1. **Generation**: Use cryptographically secure random generators
439
+ 2. **Distribution**: Via secure key management system
440
+ 3. **Storage**: Encrypted at rest, access controlled
441
+ 4. **Rotation**: Regular rotation schedule (90 days minimum)
442
+ 5. **Revocation**: Immediate revocation capability
443
+ 6. **Destruction**: Secure deletion with verification
444
+
445
+ ## Key Storage
446
+
447
+ - [ ] HashiCorp Vault
448
+ - [ ] AWS KMS
449
+ - [ ] Azure Key Vault
450
+ - [ ] GCP Secret Manager
451
+
452
+ ## Rotation Schedule
453
+
454
+ | Key Type | Rotation Period |
455
+ |----------|----------------|
456
+ | Encryption keys | 90 days |
457
+ | API keys | 180 days |
458
+ | TLS certificates | 90 days (auto-renew) |
459
+ | Database credentials | 90 days |
460
+ `;
461
+ }
462
+ function generateLoggingPolicyDoc(name) {
463
+ return `# Logging Policy - ${name}
464
+
465
+ ## Must Log
466
+
467
+ - Authentication events (success and failure)
468
+ - Authorization decisions (access granted/denied)
469
+ - Data export operations
470
+ - Role and permission changes
471
+ - Administrative actions
472
+ - API access (method, path, status code)
473
+
474
+ ## Must NOT Log
475
+
476
+ - Passwords (even hashed)
477
+ - Authentication tokens
478
+ - Private keys
479
+ - Sensitive personal data (SSN, health data, etc.)
480
+ - Full credit card numbers
481
+ - Session cookies
482
+
483
+ ## Audit Trail Fields
484
+
485
+ Every audit log entry must include:
486
+ - \`userId\`: Who performed the action
487
+ - \`action\`: What action was performed
488
+ - \`resource\`: What resource was affected
489
+ - \`timestamp\`: When the action occurred (ISO 8601)
490
+ - \`ipAddress\`: Source IP address
491
+
492
+ ## Log Retention
493
+
494
+ | Log Type | Retention Period |
495
+ |----------|-----------------|
496
+ | Audit logs | 1 year |
497
+ | Security logs | 90 days |
498
+ | Access logs | 30 days |
499
+ | Error logs | 30 days |
500
+
501
+ ## Immutability
502
+
503
+ All audit logs must be append-only. No modification or deletion is permitted.
504
+ `;
505
+ }
506
+ function generateBackupPolicyDoc(name) {
507
+ return `# Backup Policy - ${name}
508
+
509
+ ## Backup Schedule
510
+
511
+ - **Daily**: Full database backup at 02:00 UTC
512
+ - **Hourly**: Incremental backup of critical data
513
+ - **Weekly**: Full system backup including configuration
514
+
515
+ ## Backup Requirements
516
+
517
+ - [ ] All backups are encrypted (AES-256-GCM)
518
+ - [ ] Backups stored in separate geographic region
519
+ - [ ] Backup access restricted to authorized personnel
520
+ - [ ] Backup integrity verified after creation
521
+
522
+ ## Restore Testing
523
+
524
+ - **Weekly**: Restore test to staging environment
525
+ - **Monthly**: Full recovery test with data verification
526
+
527
+ ## Recovery Objectives
528
+
529
+ - **RPO (Recovery Point Objective)**: 1 hour
530
+ - **RTO (Recovery Time Objective)**: 4 hours
531
+
532
+ ## Backup Inventory
533
+
534
+ | System | Schedule | Encryption | Last Restore Test |
535
+ |--------|----------|------------|-------------------|
536
+ | Database | Daily | AES-256-GCM | [Pending] |
537
+ | File Storage | Daily | AES-256-GCM | [Pending] |
538
+ | Configuration | Weekly | AES-256-GCM | [Pending] |
539
+ `;
540
+ }
541
+ function generateIncidentResponseDoc(name) {
542
+ return `# Incident Response Plan - ${name}
543
+
544
+ ## Severity Levels
545
+
546
+ | Level | Description | Response Time |
547
+ |-------|-------------|---------------|
548
+ | P1 - Critical | Active data breach, system compromise | 15 minutes |
549
+ | P2 - High | Vulnerability being exploited, data at risk | 1 hour |
550
+ | P3 - Medium | Vulnerability identified, no active exploit | 4 hours |
551
+ | P4 - Low | Security improvement needed | 24 hours |
552
+
553
+ ## Response Process
554
+
555
+ ### 1. Detection and Reporting
556
+ - Automated monitoring alerts
557
+ - Team member reports
558
+ - External vulnerability reports
559
+
560
+ ### 2. Assessment
561
+ - Determine severity level
562
+ - Identify affected systems and data
563
+ - Assess impact on personal data
564
+
565
+ ### 3. Containment
566
+ - Isolate affected systems
567
+ - Preserve evidence
568
+ - Prevent further data loss
569
+
570
+ ### 4. Eradication
571
+ - Remove threat
572
+ - Patch vulnerabilities
573
+ - Rotate compromised credentials
574
+
575
+ ### 5. Recovery
576
+ - Restore from clean backups
577
+ - Verify system integrity
578
+ - Resume normal operations
579
+
580
+ ### 6. Post-Incident
581
+ - Document lessons learned
582
+ - Update security controls
583
+ - Review and update incident response plan
584
+
585
+ ## GDPR Breach Notification
586
+
587
+ - **72 hours**: Notify supervisory authority (Article 33)
588
+ - **Without undue delay**: Notify affected data subjects if high risk (Article 34)
589
+
590
+ ## Contacts
591
+
592
+ | Role | Contact |
593
+ |------|---------|
594
+ | Incident Lead | [To be completed] |
595
+ | DPO | [To be completed] |
596
+ | Legal | [To be completed] |
597
+ | Supervisory Authority | [To be completed] |
598
+ `;
599
+ }
600
+ function generateDisasterRecoveryDoc(name) {
601
+ return `# Disaster Recovery Plan - ${name}
602
+
603
+ ## Objectives
604
+
605
+ - **RPO (Recovery Point Objective)**: 1 hour
606
+ - **RTO (Recovery Time Objective)**: 4 hours
607
+
608
+ ## Disaster Scenarios
609
+
610
+ | Scenario | Impact | Recovery Strategy |
611
+ |----------|--------|-------------------|
612
+ | Database failure | Critical | Failover to replica, restore from backup |
613
+ | Application server failure | High | Auto-scaling, deploy to new instances |
614
+ | Storage failure | High | Replicated storage, backup restore |
615
+ | Network failure | High | Multi-AZ deployment, CDN failover |
616
+ | Complete region failure | Critical | DR region activation |
617
+ | Ransomware | Critical | Isolated backups, clean restore |
618
+
619
+ ## Recovery Procedures
620
+
621
+ ### Database Recovery
622
+ 1. Assess extent of failure
623
+ 2. Activate replica if available
624
+ 3. Restore from most recent backup
625
+ 4. Verify data integrity
626
+ 5. Resume application connectivity
627
+
628
+ ### Application Recovery
629
+ 1. Deploy to new infrastructure
630
+ 2. Restore configuration from IaC
631
+ 3. Verify all services operational
632
+ 4. Run smoke tests
633
+ 5. Open to traffic
634
+
635
+ ## Testing Schedule
636
+
637
+ - **Monthly**: Component recovery tests
638
+ - **Quarterly**: Full DR scenario test
639
+ - **Annually**: Complete DR exercise with stakeholders
640
+ `;
641
+ }
642
+ function generateEncryptionStandardDoc(name) {
643
+ return `# Encryption Standard - ${name}
644
+
645
+ ## Approved Algorithms
646
+
647
+ ### Data at Rest
648
+ - **Primary**: AES-256-GCM
649
+ - **Alternative**: ChaCha20-Poly1305
650
+
651
+ ### Data in Transit
652
+ - **Preferred**: TLS 1.3
653
+ - **Minimum**: TLS 1.2
654
+ - **Prohibited**: TLS 1.0, TLS 1.1, SSL
655
+
656
+ ### Password Hashing
657
+ - **Required**: Argon2id
658
+ - **Parameters**: memory=65536, iterations=3, parallelism=4
659
+ - **Prohibited**: MD5, SHA1, plain text
660
+
661
+ ### Key Hashing
662
+ - SHA-256 minimum
663
+ - HMAC for message authentication
664
+
665
+ ## Implementation Requirements
666
+
667
+ - [ ] All databases encrypted at rest
668
+ - [ ] All file storage encrypted
669
+ - [ ] All API communications over TLS 1.2+
670
+ - [ ] All backups encrypted
671
+ - [ ] HSTS headers configured
672
+ - [ ] Certificate pinning for mobile clients
673
+ `;
674
+ }
675
+ //# sourceMappingURL=index.js.map