Encryption Policy

CategoryConfidentiality
Version1.0
StatusApproved
Approved2026-03-25 by Mishkin Berteig
Next Review2027-03-25
IDPOL-1
Document versionpolicies/encryption.md at commit 9c72db400a23 (SHA-256 605ed3b8d06f)

Linked Controls

Encryption Policy

Purpose

This policy establishes encryption requirements for data at rest and in transit across the MaxGood.work platform, ensuring confidentiality of customer and company data.

Scope

All data stored, processed, or transmitted by MaxGood.work systems, including databases, file storage, caches, backups, and network communications.

Data in Transit Encryption

All data transmitted between systems must be encrypted using TLS 1.2 or higher.

Requirements

Prohibited

TLS Certificates and Endpoints

Endpoint configuration

Evaluation of endpoints

Data Store Encryption

All data stores use encryption at rest:

System Encryption Method
RDS PostgreSQL AWS KMS-managed encryption (AES-256)
ElastiCache Redis At-rest encryption enabled
S3 buckets Server-side encryption (SSE-S3 or SSE-KMS)
EBS volumes AWS KMS-managed encryption

File Store Encryption

File Systems Encryption

Key Management

Developer Guidance

When developing for the MaxGood.work platform:

Cryptographic Methods in Use

Choose from these methods before introducing another. Use well-maintained library primitives and never write cryptographic code; generate secrets, codes and tokens with the Python secrets module, never random; compare secrets with a constant-time function (hmac.compare_digest, bcrypt.checkpw, timingSafeEqual).

Purpose Method and parameters Code
Account passwords bcrypt with a per-password random salt (bcrypt.gensalt(), cost factor 12) MaxGoodAI/app/refactored_routes/auth/routes.py
API and messaging credentials 32 random bytes (secrets.token_urlsafe(32)), stored only as a bcrypt hash, shown once MaxGoodAI/app/refactored_routes/org_api_credentials/routes.py
One-time codes (OTC) 6 digits from secrets.randbelow, 15-minute lifetime, five wrong guesses destroy the code MaxGoodAI/app/refactored_routes/auth/routes.py, attempt_budget.py
Session tokens JWT signed HS256 with the server secret; decoding names the algorithm (algorithms=["HS256"]); lifetimes set by JWT_ACCESS_TOKEN_TTL_MINUTES and JWT_REFRESH_TOKEN_TTL_MINUTES MaxGoodAI/app/refactored_routes/auth/routes.py
Service-to-service requests HMAC-SHA256 over timestamp, method, request target and the SHA-256 of the body; a separate secret per service; 300-second timestamp tolerance; replay protection in Redis MaxGoodAI/app/refactored_routes/util/service_auth.py
OAuth state and PKCE state from secrets.token_urlsafe(32) stored as SHA-256; PKCE verifier from token_urlsafe(64) with an S256 challenge; Discord state signed HMAC-SHA256 MaxGoodAI/app/refactored_routes/mural_import/services.py, MGDiscordApp/src/services/discord-oauth.ts
Inbound webhooks Slack requests verified with the slack_sdk signature verifier MGSlackApp/app.py
Stored integration secrets Fernet (AES-128-CBC with HMAC-SHA256); the trust portal uses MultiFernet with keys from its environment, which allows rotation ai-agent-first-trust-portal/app/services/collector_encryption.py
Database connections PostgreSQL TLS: production forces sslmode=require and keeps verify-ca or verify-full when set MaxGoodAI/maxgood_db/session.py
Object storage SSE-S3 (AES256) on the trust portal's buckets, with SHA-256 upload checksums ai-agent-first-trust-portal/deploy/aws/trust-portal.yaml
Content digests SHA-256 ban_flags, user_documents and newsjacking columns

← Back to Policy Library