Skip to main content

Security & Privacy Architecture

How Transport Stack approaches security, privacy, and secrets management — its governing principles, what's enforced today, and where the model is headed.

Status

This is a v1.0 statement of direction. Where a control is described as planned, it has an intake item in the custodianship roadmap; see the Technology Stack page for the underlying tools.


Governing Principles

#PrincipleWhat it means for Transport Stack
1Non-personal data firstAll GTFS/GTFS-RT feeds, schedules, and ridership aggregates are public-domain, non-personal data. No personally identifiable information is collected by default.
2Least privilegeAPI clients receive scoped API keys; deployments limit S3 and database access per service.
3Security by contractSecurity claims live in the API contract (OpenAPI/Swagger), not in informal README text.
4Defense in depthPerimeter authentication (API keys) + application authorization (RBAC) + operational controls (secrets, monitoring).
5No secrets in codeCredentials live in environment variables / .env files only; never committed to repositories.
6Disclosure-readyA public [SECURITY.md](https://github.com/transport-stack/.github) policy describes how to report vulnerabilities.

1. Authentication

API Key-Based Authentication (Standard)

Every module that exposes public data APIs expects an X-API-KEY header. This is the same pattern used uniformly across the platform's Django and Flask services.

ModuleHeaderEnforcementStatus
Open Transit Data APIsX-API-KEYMiddleware on protected endpoints; Swagger UI openly readableProduction
Journey Planner.env-based middleware (env_middlewares)Per-routeProduction
ETA CalculatorX-API-KEY (Flask)Configured per deploymentProduction
Web Portal BackendSpring Security filterApplication-levelProduction

Key issuance policy:

  • Keys are issued by the custodian to named integrators (PTOs, app developers). Each key is attributable to an organization.
  • Keys are rotated on a schedule and on suspected compromise.
  • Keys transmitted only in the request header, never in URLs (avoids leaking keys into logs).

2. Authorization (RBAC)

Role-based access is enforced in the application tier, not exposed in data APIs:

LayerRolesWhere
Web Portaladmin, operator, viewerDjango models + session auth
OTD / S3 dataRead-scoped bucket policies per city feedAWS IAM
Wiki & docsPublic read, restricted writeGitHub org roles
DatabaseService-account users with narrow grantsPostgreSQL

3. Rate Limiting

PolicyWhereStatus
Default request throttling on public APIsDjango REST Framework settingsProduction (standardized on Open Transit Data APIs)
Per-key rate caps for integratorsRoadmap — Phase 2B🔲 Planned
Public docs/wikiServed by Docusaurus (static) behind CDNProduction

4. Cryptography

LayerMechanism
In transitTLS 1.2+ enforced at the load balancer / Amplify level for all web traffic. API payloads travel over HTTPS only.
At restAWS S3 server-side encryption (AES-256) for static data files; PostgreSQL volumes encrypted via AWS EBS/KMS.
Secrets.env per service, never committed. Deployment environments (EKS, Docker Compose) inject credentials via managed secrets.

5. Key & Secrets Management

Current maturity is Level 1: Manual rotation via environment variables. The roadmap elevates this:

flowchart LR Now["<b>Now (Level 1)</b><br/>.env-based keys<br/>Manual rotation"] Then["<b>Phase 2B (Level 2)</b><br/>Central secret store<br/>Scheduled rotation"] Later["<b>Phase 3 (Level 3)</b><br/>Vault + audit log<br/>Per-consumer keys"] Now --> Then --> Later

All public repositories must never contain keys. The org-level security policy (SECURITY.md) defines the disclosure path if one is accidentally committed.

6. Privacy Posture

QuestionAnswer
Does the platform collect personal data?No — all data published (GTFS, schedules, trip counts) is non-personal.
What if PII accidentally lands in a feed?Curation policy: strip on ingress, with notification to the source PTO.
How is user feedback handled?Roundtable/contact forms are processed only by named custodians, not logged in platform databases.

7. Audit & Observability

  • All API requests carry a request ID; keys are logged (hashed) with timestamps for abuse analysis.
  • Custodianship run reports (quarterly) include a security review section covering key issuance, incidents, and disclosures.

See Also


Maturity statement applies to Transport Stack v1.0 · Updated Aug 2026