> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Compliance Readiness

tsdevstack implements a security-first architecture across all three cloud providers. The framework enforces encryption, network isolation, zero-credential runtimes, and environment separation as non-optional defaults — not configurable afterthoughts.

This page maps the framework's built-in security controls against major compliance frameworks to help teams understand what's covered out of the box and what remains their responsibility.

**Bottom line:** tsdevstack provides all the technical infrastructure controls required by SOC 2, GDPR, and ISO 27001. Every technical requirement — encryption, network isolation, access control, audit logging, secrets management — is handled by the framework across all three providers. What remains is purely organizational: writing policies, conducting audits, and establishing review processes. The infrastructure is ready; the paperwork is yours.

## Security Controls

### Encryption

| Control                        | GCP                   | AWS                            | Azure                              |
| ------------------------------ | --------------------- | ------------------------------ | ---------------------------------- |
| TLS at edge                    | Cloud CDN managed SSL | CloudFront + ACM auto-renew    | Front Door managed TLS             |
| TLS between edge and compute   | HTTPS to Cloud Run    | HTTPS to ALB                   | HTTPS to Container Apps            |
| Database encryption at rest    | Cloud SQL default     | RDS `storage_encrypted = true` | PostgreSQL Flexible Server default |
| Database encryption in transit | Cloud SQL SSL         | SSL enabled (VPC-internal)     | PostgreSQL `sslmode=require`       |
| Redis encryption at rest       | Memorystore default   | ElastiCache enabled            | Azure Redis default                |
| Redis encryption in transit    | Memorystore TLS       | ElastiCache TLS                | TLS-only on port 6380              |
| Object storage encryption      | GCS AES-256           | S3 SSE AES256                  | Blob Storage default               |
| Secrets at rest                | Secret Manager        | Secrets Manager                | Key Vault                          |

All encryption is enforced by default. There are no flags to disable it.

### Network Isolation

| Control               | GCP                                           | AWS                                                          | Azure                                                          |
| --------------------- | --------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
| Virtual network       | VPC                                           | VPC                                                          | VNet                                                           |
| Subnet segmentation   | Private subnets                               | Three-tier (public, private, database)                       | Three subnets (apps, database, container env)                  |
| Database access       | Private IP only                               | Database subnet + security group                             | Private DNS zone + VNet integration                            |
| Redis access          | Private IP only                               | Private subnet + security group                              | Private Endpoint                                               |
| WAF                   | Cloud Armor (managed rulesets)                | AWS WAF (managed + custom rules)                             | Front Door WAF (custom rules or DRS 2.1 on Premium)            |
| WAF rate limiting     | 1000 req/60s per IP (configurable)            | 5000 req/5min per IP (configurable)                          | 1000 req/min per IP (configurable)                             |
| Access logging        | LB backend service logs + Cloud Armor verbose | ALB logs (S3) + CloudFront logs (S3) + WAF logs (CloudWatch) | Front Door diagnostic settings (Access, HealthProbe, WAF logs) |
| Origin verification   | Cloud Armor rules                             | X-Origin-Verify header                                       | X-Azure-FDID header                                            |
| Environment isolation | Separate GCP Project                          | Separate AWS Account                                         | Separate Azure Subscription                                    |
| VPC Flow Logs         | Enabled                                       | Enabled (KMS-encrypted)                                      | Planned                                                        |

Services never run in public subnets. Databases and caches have no public endpoints. Environment isolation is enforced by the framework — you cannot reuse credentials across environments.

### Identity & Access Management

| Control                    | GCP                               | AWS                                 | Azure                                                                                    |
| -------------------------- | --------------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- |
| Runtime auth               | Service Account binding           | IAM Task Role                       | Managed Identity + RBAC (User-Assigned MI for Container Apps, System MI for App Service) |
| CI/CD auth                 | Workload Identity Federation      | OIDC to IAM Role                    | Federated Identity Credentials                                                           |
| API auth                   | Kong JWT validation               | Kong JWT validation                 | Kong JWT validation                                                                      |
| Per-service DB credentials | Unique `DATABASE_URL` per service | Unique `DATABASE_URL` per service   | Unique `DATABASE_URL` per service                                                        |
| Secret scope separation    | Service-scoped + shared fallback  | Service-scoped + shared fallback    | Service-scoped + shared fallback                                                         |
| Least privilege (runtime)  | Read-only secret access           | Task role scoped to service secrets | Key Vault Secrets User (read-only)                                                       |

Zero credentials are stored in containers. Runtime authentication uses cloud-native identity (Service Accounts, IAM Roles, Managed Identities). CI/CD uses OIDC federation — no long-lived secrets in GitHub.

### Container Security

| Control              | Status                                                       |
| -------------------- | ------------------------------------------------------------ |
| Non-root execution   | `USER node` in all Dockerfiles                               |
| File ownership       | `--chown=node:node` for all copied files                     |
| Image scanning       | ECR scan on push (AWS), Artifact Registry (GCP), ACR (Azure) |
| Multi-stage builds   | Builder and production stages separated                      |
| No secrets in images | Runtime injection via cloud secret managers                  |

### Secrets Management

| Control                     | Status                                                   |
| --------------------------- | -------------------------------------------------------- |
| Cloud-native storage        | GCP Secret Manager, AWS Secrets Manager, Azure Key Vault |
| Runtime caching             | 5-minute TTL with automatic refresh                      |
| Metadata tagging            | `managed-by`, `scope`, `secret-type`, `project-name`     |
| Soft-delete recovery        | GCP: versioned, AWS: 7-day, Azure: 90-day                |
| Naming isolation            | `{project}-{scope}-{KEY}` convention                     |
| Credential files gitignored | Framework enforces `.gitignore` rules                    |

## OWASP Compliance

The optional auth service template aligns with OWASP security guidelines across authentication, session management, and cryptographic storage:

### OWASP Top 10 Coverage

| OWASP Top 10                        | Mitigation                                                                                 | Component                      |
| ----------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------ |
| **A01 Broken Access Control**       | Global AuthGuard, Kong JWT validation, `@Public()` opt-in                                  | Auth template + nest-common    |
| **A02 Cryptographic Failures**      | RS256 JWT signing, bcrypt password hashing, SHA-256 token storage, CSPRNG token generation | Auth template                  |
| **A03 Injection**                   | WAF with OWASP Core Rule Set (SQLi, XSS, LFI, RFI, RCE)                                    | Infrastructure (all providers) |
| **A04 Insecure Design**             | BFF pattern (tokens never in browser JS), defense-in-depth (Kong + AuthGuard)              | Auth template + frontend       |
| **A05 Security Misconfiguration**   | Encryption enforced by default, no flags to disable, environment isolation                 | Infrastructure                 |
| **A07 Auth Failures**               | Timing-safe comparison, configurable bcrypt rounds, refresh token rotation                 | Auth template + nest-common    |
| **A08 Data Integrity Failures**     | Asymmetric JWT signing (RS256), JWKS key discovery, CI/CD via OIDC                         | Auth template + infrastructure |
| **A09 Logging & Monitoring**        | VPC Flow Logs, WAF verbose logging, structured audit logs                                  | Infrastructure (all providers) |
| **A10 Server-Side Request Forgery** | Private subnets for databases/caches, no public endpoints, WAF request filtering           | Infrastructure (all providers) |

### OWASP Cheat Sheet Alignment

| Cheat Sheet                                                                                                    | Implementation                                                                                   |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [Authentication](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)               | bcrypt password hashing (configurable rounds), timing-safe comparison, account confirmation flow |
| [Session Management](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)       | HTTP-only cookies, Secure flag, SameSite=lax, short-lived access tokens, refresh token rotation  |
| [JWT Security](https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html)        | RS256 (asymmetric), configurable TTL, audience/issuer validation, JWKS key discovery             |
| [Password Storage](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html)           | bcrypt with 12 rounds default, configurable via secret                                           |
| [Cryptographic Storage](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html) | Refresh tokens hashed (SHA-256) before storage, CSPRNG for all token generation                  |
| [Key Management](https://cheatsheetseries.owasp.org/cheatsheets/Key_Management_Cheat_Sheet.html)               | RSA 2048-bit keys, key rotation with `kid` headers, cloud-native secret storage                  |
| [Secrets Management](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html)       | Cloud secret managers (GCP/AWS/Azure), zero-credential runtimes, no secrets in images            |

> **Note:** The auth service is an optional template. Projects that use it get these controls out of the box. The infrastructure-level controls (WAF, encryption, network isolation) apply to all tsdevstack projects regardless of the auth template.

## Compliance Framework Mapping

### SOC 2 Type II

| Trust Service Criteria                   | Framework Status                                                                                 |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **CC6.1** Logical access controls        | RBAC, Managed Identity, JWT, per-service isolation                                               |
| **CC6.2** Credentials and authentication | Zero-credential runtime, OIDC CI/CD                                                              |
| **CC6.3** Access authorization           | IAM roles scoped per service, environment isolation                                              |
| **CC6.6** Security boundaries            | VPC/VNet, WAF, private subnets, origin verification                                              |
| **CC6.7** Restrict data movement         | Private subnets for DB/Redis, no public endpoints                                                |
| **CC6.8** Unauthorized software          | Non-root containers, image scanning, multi-stage builds                                          |
| **CC7.1** Detect anomalies               | VPC Flow Logs, WAF verbose logging, access logs (LB/CDN/WAF per provider), structured audit logs |
| **CC8.1** Change management              | Git-based IaC, CI/CD with OIDC, Terraform plan/apply                                             |

Every SOC 2 technical control listed above is enforced by default. The remaining requirements — formal change approval workflows, access review cadence, incident response playbooks — are organizational processes that vary by company and don't require infrastructure changes.

### GDPR (Articles 25 & 32)

| GDPR Article                      | Framework Status                                       |
| --------------------------------- | ------------------------------------------------------ |
| **Art. 25** Privacy by design     | Encryption, isolation, least privilege as defaults     |
| **Art. 32(1)(a)** Encryption      | Encryption at rest and in transit across all providers |
| **Art. 32(1)(b)** Confidentiality | VPC isolation, WAF, per-service secrets, RBAC          |
| **Art. 32(1)(c)** Availability    | Auto-scaling, health checks, multi-AZ support          |
| **Art. 32(1)(d)** Testing         | Terraform plan, CI/CD pipeline, image scanning         |

GDPR technical measures (Articles 25 and 32) are fully covered. Data subject rights (erasure, portability, consent) are application-level concerns that the framework leaves to the developer.

### ISO 27001 (Annex A)

| Annex A Control                    | Framework Status                                                               |
| ---------------------------------- | ------------------------------------------------------------------------------ |
| **A.8.5** Secure authentication    | JWT, OIDC, Managed Identity, zero-credential runtime                           |
| **A.8.9** Configuration management | Terraform IaC, git-based, reproducible                                         |
| **A.8.15** Logging                 | VPC Flow Logs, access logs (LB/CDN/WAF per provider), CloudWatch/Log Analytics |
| **A.8.20** Network security        | VPC/VNet, subnets, WAF, private endpoints                                      |
| **A.8.21** Web service security    | TLS, WAF OWASP rules, rate limiting, CORS                                      |
| **A.8.24** Cryptography            | Encryption at rest + transit, KMS key rotation                                 |
| **A.8.25** Secure development      | CI/CD, image scanning, non-root containers                                     |

Every Annex A technical control listed above is enforced by default. ISO 27001 certification additionally requires the Information Security Management System (ISMS) — risk assessments, internal audits, management reviews — which is organizational, not technical. The infrastructure is already compliant.

## What's Covered vs Your Responsibility

### What tsdevstack provides

- Encryption at rest, and in transit from the visitor to your services, to the databases and to the caches, enforced by default across all three providers
- Zero-credential container runtimes (Managed Identity, IAM roles, Service Account binding)
- OIDC-based CI/CD with no long-lived secrets
- Network isolation with WAF, private subnets, and origin verification
- Environment isolation enforced at the account/subscription/project level
- Per-service secret and database credential isolation
- Non-root containers with vulnerability scanning
- Infrastructure as Code with full audit trail

### Account-level services (your choice)

Threat detection, a findings dashboard, secret rotation and DNSSEC work on your cloud account as a whole and cost money per account, so the framework doesn't turn them on. [Account Hardening](/docs/infrastructure/account-hardening.md) says what each one does, what it costs, and how to turn it on.

### What remains (organizational, not technical)

None of the items below require infrastructure changes — the framework has already handled the technical side. These are business processes your team defines:

- **SOC 2:** Organizational policies, access review processes, incident response plan, vendor management
- **GDPR:** Data processing agreements, privacy policy, consent management, data subject rights implementation (application-level)
- **ISO 27001:** ISMS documentation, risk assessments, internal audits, management reviews

## Cross-Provider Comparison

All three providers achieve equivalent security outcomes through provider-native services:

| Feature               | GCP                          | AWS               | Azure                          |
| --------------------- | ---------------------------- | ----------------- | ------------------------------ |
| Runtime auth          | Service Account              | IAM Task Role     | Managed Identity + RBAC        |
| CI/CD auth            | Workload Identity Federation | OIDC to IAM Role  | Federated Identity Credentials |
| Secret store          | Secret Manager               | Secrets Manager   | Key Vault (RBAC)               |
| WAF                   | Cloud Armor                  | AWS WAF           | Front Door WAF                 |
| Edge + CDN            | Cloud CDN + LB               | CloudFront + ALB  | Front Door (unified)           |
| Container scanning    | Artifact Registry            | ECR scan on push  | ACR scanning                   |
| Environment isolation | Separate Projects            | Separate Accounts | Separate Subscriptions         |
