Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Compliance Requirements Checklist

Overview

This document provides a comprehensive checklist for security and compliance requirements across multiple frameworks (GDPR, SOC 2, ISO 27001, HIPAA, LGPD) using the actual components deployed in General Bots.

Component Stack

ComponentPurposeLicense
CaddyReverse proxy, TLS termination, web serverApache 2.0
PostgreSQLRelational databasePostgreSQL License
General Bots DirectoryIdentity and access management (Zitadel/Keycloak)Apache 2.0
DriveS3-compatible object storageAGPLv3
StalwartMail server (SMTP/IMAP)AGPLv3
QdrantVector databaseApache 2.0
Cache (Valkey)In-memory cache (Redis-compatible)BSD 3-Clause
LiveKitVideo conferencingApache 2.0
UbuntuOperating systemVarious

Compliance Requirements Matrix

Legend

  • ✅ = Implemented and configured
  • ⚠️ = Partially implemented, needs configuration
  • ⬜ = Not yet implemented
  • 🔄 = Automated process
  • 📝 = Manual process required

Network & Web Server (Caddy)

StatusRequirementComponentStandardImplementation
TLS 1.3 ConfigurationCaddyAllAutomatic TLS 1.3 with modern ciphers
Access LoggingCaddyAllJSON format logs to /var/log/caddy/access.log
Rate LimitingCaddyISO 27001Per-IP rate limiting in Caddyfile
⚠️WAF RulesCaddyHIPAAConsider Caddy security plugins or external WAF
Security HeadersCaddyAllHSTS, CSP, X-Frame-Options, X-Content-Type-Options
Reverse Proxy SecurityCaddyAllSecure forwarding with real IP preservation
Certificate ManagementCaddyAllAutomatic Let’s Encrypt with auto-renewal
🔄HTTPS RedirectCaddyAllAutomatic HTTP to HTTPS redirect

Configuration File: /etc/caddy/Caddyfile

app.example.com {
    tls {
        protocols tls1.3
        ciphers TLS_AES_256_GCM_SHA384
    }
    header {
        Strict-Transport-Security "max-age=31536000"
        X-Frame-Options "SAMEORIGIN"
        X-Content-Type-Options "nosniff"
        Content-Security-Policy "default-src 'self'"
    }
    rate_limit {
        zone static {
            key {remote_host}
            events 100
            window 1m
        }
    }
    reverse_proxy localhost:3000
}

Identity & Access Management (General Bots Directory)

StatusRequirementComponentStandardImplementation
MFA ImplementationDirectoryAllTOTP/SMS/Hardware token support
RBAC ConfigurationDirectoryAllRole-based access control with custom roles
Password PolicyDirectoryAllMin 12 chars, complexity requirements, history
OAuth2/OIDC SetupDirectoryISO 27001OAuth 2.0 and OpenID Connect flows
Audit LoggingDirectoryAllComprehensive user activity logs
Session ManagementDirectoryAllConfigurable timeouts and invalidation
SSO SupportDirectoryEnterpriseSAML and OIDC SSO integration
⚠️Password RotationDirectoryHIPAAConfigure 90-day rotation policy
📝Access ReviewsDirectoryAllQuarterly manual review of user permissions

Configuration: Directory Admin Console (http://localhost:8080)

Key Settings:

  • Password min length: 12 characters
  • MFA: Required for admins
  • Session timeout: 8 hours
  • Idle timeout: 30 minutes

Database (PostgreSQL)

StatusRequirementComponentStandardImplementation
Encryption at RestPostgreSQLAllFile-system level encryption (LUKS)
Encryption in TransitPostgreSQLAllTLS/SSL connections enforced
Access ControlPostgreSQLAllRole-based database permissions
Audit LoggingPostgreSQLAllpgAudit extension for detailed logging
Connection PoolingPostgreSQLAllBuilt-in connection management
⚠️Row-Level SecurityPostgreSQLHIPAAConfigure RLS policies for sensitive tables
⚠️Column EncryptionPostgreSQLGDPREncrypt PII columns with pgcrypto
🔄Automated BackupsPostgreSQLAllDaily backups via pg_dump/pg_basebackup
Point-in-Time RecoveryPostgreSQLHIPAAWAL archiving enabled

Configuration: Installed and configured automatically via installer.rs

-- Enable SSL
ssl = on
ssl_cert_file = '/path/to/server.crt'
ssl_key_file = '/path/to/server.key'
ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL'

-- Enable audit logging
shared_preload_libraries = 'pgaudit'
pgaudit.log = 'write, ddl'
pgaudit.log_catalog = off

-- Connection settings
max_connections = 100
password_encryption = scram-sha-256

-- Logging
log_connections = on
log_disconnections = on
log_duration = on
log_statement = 'all'

Object Storage (Drive)

StatusRequirementComponentStandardImplementation
Encryption at RestDriveAllServer-side encryption (SSE-S3)
Encryption in TransitDriveAllTLS for all connections
Bucket PoliciesDriveAllFine-grained access control policies
Object VersioningDriveHIPAAVersion control for data recovery
Access LoggingDriveAllDetailed audit logs for all operations
⚠️Lifecycle RulesDriveLGPDConfigure data retention and auto-deletion
Immutable ObjectsDriveComplianceWORM (Write-Once-Read-Many) support
🔄ReplicationDriveHIPAAMulti-site replication for DR
IAM IntegrationDriveAllIntegration with Directory Service via OIDC

Configuration: /conf/drive/config.env

Bucket Policy Example:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {"AWS": ["arn:aws:iam::*:user/app-user"]},
      "Action": ["s3:GetObject"],
      "Resource": ["arn:aws:s3:::bucket-name/*"]
    }
  ]
}

Email Server (Stalwart)

StatusRequirementComponentStandardImplementation
DKIM SigningStalwartAllDomain key authentication
SPF RecordsStalwartAllSender policy framework
DMARC PolicyStalwartAllDomain-based message authentication
Mail EncryptionStalwartAllTLS for SMTP/IMAP (STARTTLS + implicit)
Content FilteringStalwartAllSpam and malware filtering
⚠️Mail ArchivingStalwartHIPAAConfigure long-term email archiving
Sieve FilteringStalwartAllServer-side mail filtering
AuthenticationStalwartAllOIDC integration with Directory Service
📝Retention PolicyStalwartGDPR/LGPDDefine and implement email retention

Configuration: /conf/mail/config.toml

[server.listener."smtp"]
bind = ["0.0.0.0:25"]
protocol = "smtp"

[server.listener."smtp-submission"]
bind = ["0.0.0.0:587"]
protocol = "smtp"
tls.implicit = false

[server.listener."smtp-submissions"]
bind = ["0.0.0.0:465"]
protocol = "smtp"
tls.implicit = true

[authentication]
mechanisms = ["plain", "login"]
directory = "oidc"

[directory."oidc"]
type = "oidc"
issuer = "http://localhost:8080"

DNS Records:

; SPF Record
example.com. IN TXT "v=spf1 ip4:203.0.113.0/24 -all"

; DKIM Record
default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCS..."

; DMARC Record
_dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"

Cache (Valkey)

StatusRequirementComponentStandardImplementation
AuthenticationValkeyAllPassword-protected access
TLS SupportValkeyAllEncrypted connections
Access ControlValkeyAllACL-based permissions
⚠️PersistenceValkeyData RecoveryRDB/AOF for data persistence
Memory LimitsValkeyAllMaxmemory policies configured
📝Data ExpirationValkeyGDPRSet TTL for cached personal data

Configuration: /etc/valkey/valkey.conf

# Authentication
requirepass SecurePassword123!

# TLS
tls-port 6380
tls-cert-file /path/to/cert.pem
tls-key-file /path/to/key.pem
tls-protocols "TLSv1.3"

# ACL
aclfile /etc/valkey/users.acl

# Memory management
maxmemory 2gb
maxmemory-policy allkeys-lru

# Persistence
save 900 1
save 300 10

Vector Database (Qdrant)

StatusRequirementComponentStandardImplementation
API AuthenticationQdrantAllAPI key authentication
TLS SupportQdrantAllHTTPS enabled
Access ControlQdrantAllCollection-level permissions
⚠️Data EncryptionQdrantHIPAAFile-system level encryption
🔄Backup SupportQdrantAllSnapshot-based backups
📝Data RetentionQdrantGDPRImplement collection cleanup policies

Configuration: /etc/qdrant/config.yaml

service:
  host: 0.0.0.0
  http_port: 6333
  grpc_port: 6334

security:
  api_key: "your-secure-api-key"
  read_only_api_key: "read-only-key"

storage:
  storage_path: /var/lib/qdrant/storage
  snapshots_path: /var/lib/qdrant/snapshots

telemetry:
  enabled: false

Operating System (Ubuntu)

StatusRequirementComponentStandardImplementation
⚠️System HardeningUbuntuAllApply CIS Ubuntu Linux benchmarks
Automatic UpdatesUbuntuAllUnattended-upgrades for security patches
⚠️Audit DaemonUbuntuAllConfigure auditd for system events
Firewall RulesUbuntuAllUFW configured with restrictive rules
⚠️Disk EncryptionUbuntuAllLUKS full-disk encryption
⚠️AppArmorUbuntuAllEnable mandatory access control
📝User ManagementUbuntuAllDisable root login, use sudo
📝SSH HardeningUbuntuAllKey-based auth only, disable password auth

Firewall Configuration:

# UFW firewall rules
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp    # SSH
ufw allow 80/tcp    # HTTP
ufw allow 443/tcp   # HTTPS
ufw allow 25/tcp    # SMTP
ufw allow 587/tcp   # SMTP submission
ufw allow 993/tcp   # IMAPS
ufw enable

Automatic Updates:

# /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}-security";
};
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "03:00";

Audit Rules: /etc/audit/rules.d/audit.rules

# Monitor authentication
-w /var/log/auth.log -p wa -k auth_log
-w /etc/passwd -p wa -k user_modification
-w /etc/group -p wa -k group_modification

# Monitor network
-a always,exit -F arch=b64 -S connect -k network_connect

# Monitor file access
-w /etc/shadow -p wa -k shadow_modification

Cross-Component Requirements

Monitoring & Logging

StatusRequirementImplementationStandard
Centralized LoggingAll logs to /var/log/ with rotationAll
⚠️Log AggregationELK Stack or similar SIEMISO 27001
Health MonitoringPrometheus + GrafanaAll
📝Alert ConfigurationSet up alerts for security eventsAll
Metrics CollectionComponent-level metricsAll

Backup & Recovery

StatusRequirementImplementationStandard
🔄Automated BackupsDaily automated backupsAll
Backup EncryptionAES-256 encrypted backupsAll
Off-site StorageDrive replication to secondary siteHIPAA
📝Backup TestingQuarterly restore testsAll
Retention Policy90 days for full, 30 for incrementalAll

Backup Script: /usr/local/bin/backup-system.sh

#!/bin/bash
BACKUP_DATE=$(date +%Y%m%d_%H%M%S)

# PostgreSQL backup
pg_dump -h localhost -U postgres generalbots | \
  gzip | \
  openssl enc -aes-256-cbc -salt -out /backup/pg_${BACKUP_DATE}.sql.gz.enc

# Drive backup
mc mirror drive/generalbots /backup/drive_${BACKUP_DATE}/

# Qdrant snapshot
curl -X POST "http://localhost:6333/collections/botserver/snapshots"

Network Security

StatusRequirementImplementationStandard
Network SegmentationComponent isolation via firewallAll
Internal TLSTLS between all componentsISO 27001
⚠️VPN AccessWireGuard VPN for admin accessAll
Rate LimitingCaddy rate limitingAll
📝DDoS ProtectionCloudFlare or similarProduction

Compliance-Specific Requirements

GDPR

StatusRequirementImplementation
Data EncryptionAES-256 at rest, TLS 1.3 in transit
Right to AccessAPI endpoints for data export
Right to DeletionData deletion workflows implemented
Right to PortabilityJSON export functionality
Consent ManagementZitadel consent flows
📝Data Processing RecordsDocument all data processing activities
Breach NotificationIncident response plan includes 72h notification

SOC 2

StatusRequirementImplementation
Access ControlsRBAC via Zitadel
Audit LoggingComprehensive logging across all components
Change ManagementVersion control and deployment procedures
MonitoringReal-time monitoring with Prometheus
📝Risk AssessmentAnnual risk assessment required
EncryptionData encrypted at rest and in transit

ISO 27001

StatusRequirementImplementation
Asset InventoryDocumented component list
Access ControlZitadel RBAC
CryptographyModern encryption standards
📝Physical SecurityData center security documentation
Operations SecurityAutomated patching and monitoring
📝Incident ManagementDocumented incident response procedures
📝Business ContinuityDR plan and testing

HIPAA

StatusRequirementImplementation
EncryptionPHI encrypted at rest and in transit
Access ControlsRole-based access with MFA
Audit ControlsComprehensive audit logging
⚠️Integrity ControlsChecksums and versioning
Transmission SecurityTLS 1.3 for all communications
📝Business Associate AgreementsRequired for third-party vendors
⚠️Email ArchivingStalwart archiving configuration needed

LGPD (Brazilian GDPR)

StatusRequirementImplementation
Data EncryptionSame as GDPR
User RightsSame as GDPR
ConsentZitadel consent management
📝Data Protection OfficerDesignate DPO
⚠️Data RetentionConfigure lifecycle policies in Drive
Breach NotificationSame incident response as GDPR

Implementation Priority

High Priority (Critical for Production)

  1. ✅ TLS 1.3 everywhere (Caddy, PostgreSQL, Drive, Stalwart)
  2. ✅ MFA for all admin accounts (Zitadel)
  3. ✅ Firewall configuration (UFW)
  4. ✅ Automated security updates (unattended-upgrades)
  5. 🔄 Automated encrypted backups

Medium Priority (Required for Compliance)

  1. ⚠️ Disk encryption (LUKS)
  2. ⚠️ Audit daemon (auditd)
  3. ⚠️ WAF rules (Caddy plugins or external)
  4. 📝 Access reviews (quarterly)
  5. ⚠️ Email archiving (Stalwart)

Lower Priority (Enhanced Security)

  1. ⚠️ VPN access (WireGuard)
  2. ⚠️ Log aggregation (ELK Stack)
  3. ⚠️ AppArmor/SELinux
  4. 📝 CIS hardening
  5. 📝 Penetration testing

Verification Checklist

Weekly Tasks

  • Review security logs (Caddy, PostgreSQL, Zitadel)
  • Check backup completion status
  • Review failed authentication attempts
  • Update security patches

Monthly Tasks

  • Access review for privileged accounts
  • Review audit logs for anomalies
  • Test backup restoration
  • Update vulnerability database

Quarterly Tasks

  • Full access review for all users
  • Compliance check (run automated checks)
  • Security configuration audit
  • Disaster recovery drill

Annual Tasks

  • Penetration testing
  • Full compliance audit
  • Risk assessment update
  • Security policy review
  • Business continuity test

Quick Start Implementation

# 1. Enable firewall
sudo ufw enable
sudo ufw allow 22,80,443,25,587,993/tcp

# 2. Configure automatic updates
sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

# 3. Enable PostgreSQL SSL
sudo -u postgres psql -c "ALTER SYSTEM SET ssl = 'on';"
sudo systemctl restart postgresql

# 4. Set Drive encryption
mc admin config set drive/ server-side-encryption-s3 on

# 5. Configure Zitadel MFA
# Via web console: Settings > Security > MFA > Require for admins

# 6. Enable Caddy security headers
# Add to Caddyfile (see Network & Web Server section)

# 7. Set up daily backups
sudo crontab -e
# Add: 0 2 * * * /usr/local/bin/backup-system.sh

Support & Resources

  • Internal Security Team: security@pragmatismo.com.br
  • Compliance Officer: compliance@pragmatismo.com.br
  • Documentation: https://docs.pragmatismo.com.br
  • Component Documentation: See “Component Security Documentation” in security-features.md

Document Control

  • Version: 1.0
  • Last Updated: 2024-01-15
  • Next Review: 2024-07-15
  • Owner: Security Team
  • Approved By: CTO