@@ -4,62 +4,62 @@ import { z } from 'zod';
44 * Compliance protocol for GDPR, CCPA, HIPAA, SOX, PCI-DSS
55 */
66export const GDPRConfigSchema = z . object ( {
7- enabled : z . boolean ( ) ,
7+ enabled : z . boolean ( ) . describe ( 'Enable GDPR compliance controls' ) ,
88 dataSubjectRights : z . object ( {
9- rightToAccess : z . boolean ( ) . default ( true ) ,
10- rightToRectification : z . boolean ( ) . default ( true ) ,
11- rightToErasure : z . boolean ( ) . default ( true ) ,
12- rightToRestriction : z . boolean ( ) . default ( true ) ,
13- rightToPortability : z . boolean ( ) . default ( true ) ,
14- rightToObjection : z . boolean ( ) . default ( true ) ,
15- } ) ,
9+ rightToAccess : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to access their data' ) ,
10+ rightToRectification : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to correct their data' ) ,
11+ rightToErasure : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to request deletion' ) ,
12+ rightToRestriction : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to restrict processing' ) ,
13+ rightToPortability : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to export their data' ) ,
14+ rightToObjection : z . boolean ( ) . default ( true ) . describe ( 'Allow data subjects to object to processing' ) ,
15+ } ) . describe ( 'Data subject rights configuration per GDPR Articles 15-21' ) ,
1616 legalBasis : z . enum ( [
1717 'consent' ,
1818 'contract' ,
1919 'legal-obligation' ,
2020 'vital-interests' ,
2121 'public-task' ,
2222 'legitimate-interests' ,
23- ] ) ,
24- consentTracking : z . boolean ( ) . default ( true ) ,
25- dataRetentionDays : z . number ( ) . optional ( ) ,
26- dataProcessingAgreement : z . string ( ) . optional ( ) ,
27- } ) ;
23+ ] ) . describe ( 'Legal basis for data processing under GDPR Article 6' ) ,
24+ consentTracking : z . boolean ( ) . default ( true ) . describe ( 'Track and record user consent' ) ,
25+ dataRetentionDays : z . number ( ) . optional ( ) . describe ( 'Maximum data retention period in days' ) ,
26+ dataProcessingAgreement : z . string ( ) . optional ( ) . describe ( 'URL or reference to the data processing agreement' ) ,
27+ } ) . describe ( 'GDPR (General Data Protection Regulation) compliance configuration' ) ;
2828
2929export type GDPRConfig = z . infer < typeof GDPRConfigSchema > ;
3030export type GDPRConfigInput = z . input < typeof GDPRConfigSchema > ;
3131
3232export const HIPAAConfigSchema = z . object ( {
33- enabled : z . boolean ( ) ,
33+ enabled : z . boolean ( ) . describe ( 'Enable HIPAA compliance controls' ) ,
3434 phi : z . object ( {
35- encryption : z . boolean ( ) . default ( true ) ,
36- accessControl : z . boolean ( ) . default ( true ) ,
37- auditTrail : z . boolean ( ) . default ( true ) ,
38- backupAndRecovery : z . boolean ( ) . default ( true ) ,
39- } ) ,
40- businessAssociateAgreement : z . boolean ( ) . default ( false ) ,
41- } ) ;
35+ encryption : z . boolean ( ) . default ( true ) . describe ( 'Encrypt Protected Health Information at rest' ) ,
36+ accessControl : z . boolean ( ) . default ( true ) . describe ( 'Enforce role-based access to PHI' ) ,
37+ auditTrail : z . boolean ( ) . default ( true ) . describe ( 'Log all PHI access events' ) ,
38+ backupAndRecovery : z . boolean ( ) . default ( true ) . describe ( 'Enable PHI backup and disaster recovery' ) ,
39+ } ) . describe ( 'Protected Health Information safeguards' ) ,
40+ businessAssociateAgreement : z . boolean ( ) . default ( false ) . describe ( 'BAA is in place with third-party processors' ) ,
41+ } ) . describe ( 'HIPAA (Health Insurance Portability and Accountability Act) compliance configuration' ) ;
4242
4343export type HIPAAConfig = z . infer < typeof HIPAAConfigSchema > ;
4444export type HIPAAConfigInput = z . input < typeof HIPAAConfigSchema > ;
4545
4646export const PCIDSSConfigSchema = z . object ( {
47- enabled : z . boolean ( ) ,
48- level : z . enum ( [ '1' , '2' , '3' , '4' ] ) ,
49- cardDataFields : z . array ( z . string ( ) ) ,
50- tokenization : z . boolean ( ) . default ( true ) ,
51- encryptionInTransit : z . boolean ( ) . default ( true ) ,
52- encryptionAtRest : z . boolean ( ) . default ( true ) ,
53- } ) ;
47+ enabled : z . boolean ( ) . describe ( 'Enable PCI-DSS compliance controls' ) ,
48+ level : z . enum ( [ '1' , '2' , '3' , '4' ] ) . describe ( 'PCI-DSS compliance level (1 = highest)' ) ,
49+ cardDataFields : z . array ( z . string ( ) ) . describe ( 'Field names containing cardholder data' ) ,
50+ tokenization : z . boolean ( ) . default ( true ) . describe ( 'Replace card data with secure tokens' ) ,
51+ encryptionInTransit : z . boolean ( ) . default ( true ) . describe ( 'Encrypt cardholder data during transmission' ) ,
52+ encryptionAtRest : z . boolean ( ) . default ( true ) . describe ( 'Encrypt stored cardholder data' ) ,
53+ } ) . describe ( 'PCI-DSS (Payment Card Industry Data Security Standard) compliance configuration' ) ;
5454
5555export type PCIDSSConfig = z . infer < typeof PCIDSSConfigSchema > ;
5656export type PCIDSSConfigInput = z . input < typeof PCIDSSConfigSchema > ;
5757
5858export const AuditLogConfigSchema = z . object ( {
59- enabled : z . boolean ( ) . default ( true ) ,
60- retentionDays : z . number ( ) . default ( 365 ) ,
61- immutable : z . boolean ( ) . default ( true ) ,
62- signLogs : z . boolean ( ) . default ( false ) ,
59+ enabled : z . boolean ( ) . default ( true ) . describe ( 'Enable audit logging' ) ,
60+ retentionDays : z . number ( ) . default ( 365 ) . describe ( 'Number of days to retain audit logs' ) ,
61+ immutable : z . boolean ( ) . default ( true ) . describe ( 'Prevent modification or deletion of audit logs' ) ,
62+ signLogs : z . boolean ( ) . default ( false ) . describe ( 'Cryptographically sign log entries for tamper detection' ) ,
6363 events : z . array ( z . enum ( [
6464 'create' ,
6565 'read' ,
@@ -70,18 +70,18 @@ export const AuditLogConfigSchema = z.object({
7070 'login' ,
7171 'logout' ,
7272 'failed-login' ,
73- ] ) ) ,
74- } ) ;
73+ ] ) ) . describe ( 'Event types to capture in the audit log' ) ,
74+ } ) . describe ( 'Audit log configuration for compliance and security monitoring' ) ;
7575
7676export type AuditLogConfig = z . infer < typeof AuditLogConfigSchema > ;
7777export type AuditLogConfigInput = z . input < typeof AuditLogConfigSchema > ;
7878
7979export const ComplianceConfigSchema = z . object ( {
80- gdpr : GDPRConfigSchema . optional ( ) ,
81- hipaa : HIPAAConfigSchema . optional ( ) ,
82- pciDss : PCIDSSConfigSchema . optional ( ) ,
83- auditLog : AuditLogConfigSchema ,
84- } ) ;
80+ gdpr : GDPRConfigSchema . optional ( ) . describe ( 'GDPR compliance settings' ) ,
81+ hipaa : HIPAAConfigSchema . optional ( ) . describe ( 'HIPAA compliance settings' ) ,
82+ pciDss : PCIDSSConfigSchema . optional ( ) . describe ( 'PCI-DSS compliance settings' ) ,
83+ auditLog : AuditLogConfigSchema . describe ( 'Audit log configuration' ) ,
84+ } ) . describe ( 'Unified compliance configuration spanning GDPR, HIPAA, and PCI-DSS' ) ;
8585
8686export type ComplianceConfig = z . infer < typeof ComplianceConfigSchema > ;
8787export type ComplianceConfigInput = z . input < typeof ComplianceConfigSchema > ;
0 commit comments