Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Example: SkyLink Security Architecture

Data Flow Diagrams and Security Controls for the SkyLink Connected Aircraft Platform

Document Information

AttributeValue
Document OwnerSkyLink Platform Team
ClassificationInternal
Document Version1.0
Last Review DateDecember 2025
Next Review DateJune 2026
Related Documentstbd

Overview

Purpose

This document describes the security architecture of the SkyLink platform using Data Flow Diagrams (DFD) to illustrate:

Scope

This architecture covers:

Audience


System Context (Level 0)

Context Diagram

┌─────────────────────────────────────────────────────────────────────────┐
│                           EXTERNAL ACTORS                                │
│                                                                          │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐ │
│  │   Aircraft   │  │  WeatherAPI  │  │    Google    │  │    Admin     │ │
│  │   Systems    │  │   (Vendor)   │  │  People API  │  │  Operators   │ │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘ │
│         │                 │                 │                 │          │
└─────────┼─────────────────┼─────────────────┼─────────────────┼──────────┘
          │                 │                 │                 │
          │ mTLS + JWT      │ HTTPS           │ OAuth 2.0       │ TBD
          │ (TLS 1.2+)      │ (API Key)       │ (HTTPS)         │
          │                 │                 │                 │
          ▼                 ▼                 ▼                 ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                                                                          │
│  ══════════════════════ TRUST BOUNDARY 1 ══════════════════════════════ │
│                                                                          │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │                      API GATEWAY (:8000)                           │  │
│  │                                                                    │  │
│  │  ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────────┐  │  │
│  │  │   mTLS     │ │  JWT RS256 │ │    Rate    │ │    Security    │  │  │
│  │  │ Validation │ │    Auth    │ │  Limiting  │ │    Headers     │  │  │
│  │  └────────────┘ └────────────┘ └────────────┘ └────────────────┘  │  │
│  │  ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────────┐  │  │
│  │  │  Payload   │ │  Request   │ │ Prometheus │ │   Structured   │  │  │
│  │  │   Limit    │ │  Routing   │ │  Metrics   │ │    Logging     │  │  │
│  │  └────────────┘ └────────────┘ └────────────┘ └────────────────┘  │  │
│  └───────────────────────────────────────────────────────────────────┘  │
│                                    │                                     │
│  ══════════════════════ TRUST BOUNDARY 2 ══════════════════════════════ │
│                                    │                                     │
│         ┌──────────────────────────┼──────────────────────────┐         │
│         │                          │                          │         │
│         ▼                          ▼                          ▼         │
│  ┌─────────────┐           ┌─────────────┐           ┌─────────────┐   │
│  │  TELEMETRY  │           │   WEATHER   │           │  CONTACTS   │   │
│  │    :8001    │           │    :8002    │           │    :8003    │   │
│  ├─────────────┤           ├─────────────┤           ├─────────────┤   │
│  │ • Idempotency│          │ • Demo mode │           │ • OAuth 2.0 │   │
│  │ • GPS round  │          │ • Fixtures  │           │ • Encryption│   │
│  │ • Validation │          │ • Cache     │           │ • CRUD ops  │   │
│  └─────────────┘           └──────┬──────┘           └──────┬──────┘   │
│                                   │                          │          │
│  ═══════════════════ TRUST BOUNDARY 3 ═══════════════════════│══════   │
│                                   │                          │          │
│                                   ▼                          │          │
│                          ┌─────────────┐                     │          │
│                          │ WeatherAPI  │                     │          │
│                          │  (External) │                     │          │
│                          └─────────────┘                     │          │
│                                                              │          │
│  ═══════════════════ TRUST BOUNDARY 4 ═══════════════════════│══════   │
│                                                              │          │
│                                                              ▼          │
│                                                     ┌─────────────┐    │
│                                                     │ PostgreSQL  │    │
│                                                     │    :5432    │    │
│                                                     ├─────────────┤    │
│                                                     │ • OAuth tok │    │
│                                                     │ • Encrypted │    │
│                                                     └─────────────┘    │
│                                                                          │
│                           SKYLINK PLATFORM                               │
└─────────────────────────────────────────────────────────────────────────┘

External Actors

ActorDescriptionAuthenticationData Exchanged
Aircraft SystemsOnboard avionics and telemetry systemsmTLS + JWT RS256Telemetry data, weather requests
WeatherAPIThird-party weather data providerAPI Key (outbound)Weather conditions, air quality
Google People APIGoogle contact synchronizationOAuth 2.0 (outbound)Contact names, emails
Admin OperatorsPlatform administratorsTBD (future)Configuration, monitoring

Trust Boundaries

Boundary Definitions

IDBoundaryFromToRisk Level
TB1Internet → GatewayUntrusted (Internet)DMZ (Gateway)CRITICAL
TB2Gateway → ServicesDMZInternal ServicesMEDIUM
TB3Services → External APIsInternalExternal (Vendors)HIGH
TB4Services → DatabaseInternalData LayerHIGH

Security Controls per Boundary

TB1: Internet → Gateway (CRITICAL)

┌─────────────────────────────────────────────────────────────┐
│                    TRUST BOUNDARY 1                          │
│               Internet → API Gateway                         │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  THREATS                    CONTROLS                         │
│  ─────────                  ────────                         │
│  • Spoofing          ──►   mTLS (X.509 client certs)        │
│  • Man-in-Middle     ──►   TLS 1.2+ with strong ciphers     │
│  • Replay attacks    ──►   JWT expiry (15 min)              │
│  • DDoS/Flooding     ──►   Rate limiting (60 req/min)       │
│  • Injection         ──►   Pydantic validation (extra=forbid)│
│  • Info disclosure   ──►   Security headers (OWASP)         │
│  • Large payloads    ──►   64KB request limit               │
│                                                              │
│  AUTHENTICATION FLOW:                                        │
│  1. TLS handshake (mutual authentication)                   │
│  2. Client certificate validation (CA-signed)               │
│  3. CN extraction from certificate                          │
│  4. JWT token issuance (sub = CN)                          │
│  5. Cross-validation on subsequent requests (CN == sub)     │
│                                                              │
└─────────────────────────────────────────────────────────────┘

TB2: Gateway → Services (MEDIUM)

┌─────────────────────────────────────────────────────────────┐
│                    TRUST BOUNDARY 2                          │
│               Gateway → Internal Services                    │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ASSUMPTION: Gateway has validated all requests              │
│                                                              │
│  CONTROLS:                                                   │
│  • Docker bridge network isolation                          │
│  • Services not exposed to Internet                         │
│  • Internal DNS resolution only                             │
│  • Request forwarding via httpx (async)                     │
│                                                              │
│  DATA FLOW:                                                  │
│  Gateway ──[HTTP/JSON]──► Telemetry/Weather/Contacts        │
│                                                              │
│  NOTE: No authentication between internal services          │
│  (trusted internal network model)                           │
│                                                              │
└─────────────────────────────────────────────────────────────┘

TB3: Services → External APIs (HIGH)

┌─────────────────────────────────────────────────────────────┐
│                    TRUST BOUNDARY 3                          │
│               Internal → External APIs                       │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  OUTBOUND CONNECTIONS:                                       │
│                                                              │
│  Weather Service ──[HTTPS]──► WeatherAPI                    │
│  • API key in request header                                │
│  • Geohash/coordinates (no raw GPS)                         │
│  • Demo mode fallback (fixtures)                            │
│                                                              │
│  Contacts Service ──[HTTPS]──► Google People API            │
│  • OAuth 2.0 bearer token                                   │
│  • Minimal scope (contacts.readonly)                        │
│  • Token refresh handling                                   │
│                                                              │
│  CONTROLS:                                                   │
│  • HTTPS enforced (TLS 1.2+)                               │
│  • API keys not logged                                      │
│  • Response validation                                       │
│  • Timeout configuration                                     │
│                                                              │
└─────────────────────────────────────────────────────────────┘

TB4: Services → Database (HIGH)

┌─────────────────────────────────────────────────────────────┐
│                    TRUST BOUNDARY 4                          │
│               Services → PostgreSQL                          │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  CONNECTION:                                                 │
│  Contacts Service ──[TCP:5432]──► PostgreSQL                │
│                                                              │
│  CONTROLS:                                                   │
│  • Network isolation (Docker bridge)                        │
│  • Credential-based authentication                          │
│  • Connection pooling (SQLAlchemy)                          │
│  • Parameterized queries (no SQL injection)                 │
│                                                              │
│  DATA STORED:                                                │
│  • OAuth tokens (AES-256-GCM encrypted)                     │
│  • User identifiers                                          │
│  • Token expiration metadata                                 │
│                                                              │
│  DATA PROTECTION:                                            │
│  • Encryption at rest (application-level)                   │
│  • No plaintext secrets in database                         │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Data Flow Diagrams (Level 1)

Flow 1: Aircraft Authentication

┌──────────────┐                              ┌──────────────┐
│   AIRCRAFT   │                              │   GATEWAY    │
│   SYSTEM     │                              │   :8000      │
└──────┬───────┘                              └──────┬───────┘
       │                                             │
       │ ══[1] TLS ClientHello ════════════════════►│
       │                                             │
       │ ◄═══════════════════════ [2] ServerHello ══│
       │                          + Server Cert     │
       │                          + CertRequest     │
       │                                             │
       │ ══[3] Client Certificate ═════════════════►│
       │       (X.509, CA-signed)                   │
       │                                             │──┐
       │                                             │  │ [4] Validate cert
       │                                             │  │     - CA signature
       │                                             │  │     - Not expired
       │                                             │◄─┘     - Not revoked
       │                                             │
       │                                             │──┐
       │                                             │  │ [5] Extract CN
       │                                             │◄─┘     (aircraft_id)
       │                                             │
       │ ══[6] POST /auth/token ═══════════════════►│
       │       {"aircraft_id": "AC-12345"}          │
       │                                             │──┐
       │                                             │  │ [7] Validate:
       │                                             │  │     - CN == aircraft_id
       │                                             │  │     - Generate JWT
       │                                             │  │       (sub=aircraft_id)
       │                                             │◄─┘     (exp=15min)
       │                                             │
       │ ◄══════════════════════════════ [8] 200 ═══│
       │       {"access_token": "eyJ...",           │
       │        "token_type": "Bearer",             │
       │        "expires_in": 900}                  │
       │                                             │
       ▼                                             ▼

Security Controls Applied:

Flow 2: Telemetry Ingestion

┌──────────────┐              ┌──────────────┐              ┌──────────────┐
│   AIRCRAFT   │              │   GATEWAY    │              │  TELEMETRY   │
│   SYSTEM     │              │   :8000      │              │   :8001      │
└──────┬───────┘              └──────┬───────┘              └──────┬───────┘
       │                             │                             │
       │ ═[1] POST /telemetry/ingest═►                            │
       │     + mTLS (client cert)    │                             │
       │     + Authorization: Bearer │                             │
       │     + X-Trace-Id: abc123    │                             │
       │     {                       │                             │
       │       "aircraft_id": "...", │                             │
       │       "event_id": "...",    │                             │
       │       "ts": "...",          │                             │
       │       "metrics": {...}      │                             │
       │     }                       │                             │
       │                             │──┐                          │
       │                             │  │ [2] Validate JWT         │
       │                             │  │     - Signature (RS256)  │
       │                             │  │     - Expiry             │
       │                             │  │     - Audience           │
       │                             │◄─┘                          │
       │                             │──┐                          │
       │                             │  │ [3] Cross-validate       │
       │                             │  │     CN == JWT.sub        │
       │                             │◄─┘                          │
       │                             │──┐                          │
       │                             │  │ [4] Rate limit check     │
       │                             │  │     (60 req/min/identity)│
       │                             │◄─┘                          │
       │                             │                             │
       │                             │ ════[5] Proxy request══════►│
       │                             │     (internal network)      │
       │                             │                             │──┐
       │                             │                             │  │ [6] Validate payload
       │                             │                             │  │     - Pydantic model
       │                             │                             │  │     - extra="forbid"
       │                             │                             │◄─┘
       │                             │                             │──┐
       │                             │                             │  │ [7] Idempotency check
       │                             │                             │  │     - (aircraft_id, event_id)
       │                             │                             │  │     - UNIQUE constraint
       │                             │                             │◄─┘
       │                             │                             │──┐
       │                             │                             │  │ [8] PII minimization
       │                             │                             │  │     - Round GPS (4 dec)
       │                             │                             │◄─┘
       │                             │                             │──┐
       │                             │                             │  │ [9] Store telemetry
       │                             │                             │◄─┘
       │                             │                             │
       │                             │ ◄════════[10] Response══════│
       │                             │     201 Created / 200 OK /  │
       │                             │     409 Conflict            │
       │                             │                             │
       │ ◄════════════[11] Response══│                             │
       │     + X-Trace-Id: abc123    │                             │
       │     + Security headers      │                             │
       │                             │                             │
       ▼                             ▼                             ▼

HTTP Response Codes:

CodeMeaningScenario
201CreatedNew event stored
200OKDuplicate event (idempotent)
409ConflictSame event_id, different payload
400Bad RequestValidation error
401UnauthorizedInvalid/expired JWT
403ForbiddenCN ≠ JWT.sub
429Too Many RequestsRate limit exceeded

Flow 3: Weather Query

┌──────────────┐      ┌──────────────┐      ┌──────────────┐      ┌──────────────┐
│   AIRCRAFT   │      │   GATEWAY    │      │   WEATHER    │      │  WeatherAPI  │
│   SYSTEM     │      │   :8000      │      │   :8002      │      │  (External)  │
└──────┬───────┘      └──────┬───────┘      └──────┬───────┘      └──────┬───────┘
       │                     │                     │                     │
       │ ═[1] GET /weather══►│                     │                     │
       │     ?lat=48.85      │                     │                     │
       │     &lon=2.35       │                     │                     │
       │     + Bearer JWT    │                     │                     │
       │                     │──┐                  │                     │
       │                     │  │ [2] Validate JWT │                     │
       │                     │◄─┘                  │                     │
       │                     │──┐                  │                     │
       │                     │  │ [3] Rate limit   │                     │
       │                     │◄─┘                  │                     │
       │                     │                     │                     │
       │                     │ ══[4] Proxy════════►│                     │
       │                     │                     │                     │
       │                     │                     │──┐                  │
       │                     │                     │  │ [5] Check mode   │
       │                     │                     │  │     (demo/live)  │
       │                     │                     │◄─┘                  │
       │                     │                     │                     │
       │                     │                     │    ┌─── IF LIVE ───┐│
       │                     │                     │ ══►│[6] Build req  ││
       │                     │                     │    │  + API key    ││
       │                     │                     │    │  + coords     │├──►
       │                     │                     │    └───────────────┘│
       │                     │                     │                     │
       │                     │                     │ ◄═══[7] Response════│
       │                     │                     │     (weather data)  │
       │                     │                     │                     │
       │                     │                     │    ┌─ IF DEMO ─────┐│
       │                     │                     │    │ Return Paris  ││
       │                     │                     │    │ fixtures      ││
       │                     │                     │    └───────────────┘│
       │                     │                     │                     │
       │                     │ ◄══[8] Response═════│                     │
       │                     │                     │                     │
       │ ◄══[9] Weather data═│                     │                     │
       │     {"location":... │                     │                     │
       │      "current":...} │                     │                     │
       │                     │                     │                     │
       ▼                     ▼                     ▼                     ▼

Data Protection:

Flow 4: Contacts OAuth

┌──────────────┐   ┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│     USER     │   │   GATEWAY    │   │   CONTACTS   │   │    GOOGLE    │
│   BROWSER    │   │   :8000      │   │   :8003      │   │  People API  │
└──────┬───────┘   └──────┬───────┘   └──────┬───────┘   └──────┬───────┘
       │                  │                  │                  │
       │ ═[1] GET /oauth/init═►              │                  │
       │                  │ ══[2] Proxy═════►│                  │
       │                  │                  │──┐               │
       │                  │                  │  │ [3] Build auth URL
       │                  │                  │  │  + client_id
       │                  │                  │  │  + redirect_uri
       │                  │                  │  │  + scope (minimal)
       │                  │                  │◄─┘               │
       │                  │ ◄═[4] Redirect══│                  │
       │ ◄═[5] 302 Redirect═│                  │                  │
       │                  │                  │                  │
       │ ════════════════════[6] User consent════════════════════►
       │                  │                  │                  │
       │ ◄═══════════════════[7] Callback + code═════════════════│
       │                  │                  │                  │
       │ ═[8] GET /oauth/callback?code=...═►│                  │
       │                  │ ══[9] Proxy═════►│                  │
       │                  │                  │ ═[10] POST token═►│
       │                  │                  │     (code exchange)│
       │                  │                  │ ◄═[11] Tokens═════│
       │                  │                  │     (access+refresh)
       │                  │                  │──┐               │
       │                  │                  │  │ [12] Encrypt tokens
       │                  │                  │  │      AES-256-GCM
       │                  │                  │◄─┘               │
       │                  │                  │──┐               │
       │                  │                  │  │ [13] Store in DB
       │                  │                  │◄─┘               │
       │                  │ ◄═[14] Success══│                  │
       │ ◄═[15] Success═══│                  │                  │
       │                  │                  │                  │
       ▼                  ▼                  ▼                  ▼

OAuth Security:


Security Controls by Layer

Control Matrix

LayerControlImplementationFileStatus
TransportTLS 1.2+mTLS with strong ciphersskylink/mtls.py:white_check_mark:
TransportCertificate validationX.509, CA-signedscripts/generate_*.sh:white_check_mark:
NetworkService isolationDocker bridge networkdocker-compose.yml:white_check_mark:
ApplicationAuthenticationJWT RS256skylink/auth.py:white_check_mark:
ApplicationAuthorizationRBAC (5 roles, 7 permissions)skylink/rbac.py:white_check_mark:
ApplicationCross-validationCN == JWT subskylink/mtls.py:white_check_mark:
ApplicationRate limiting60 req/min per identityskylink/rate_limit.py:white_check_mark:
ApplicationInput validationPydantic extra=forbidskylink/models/:white_check_mark:
ApplicationIdempotencyUnique constrainttelemetry/:white_check_mark:
ApplicationSecurity headersOWASP setskylink/middlewares.py:white_check_mark:
DataPII minimizationGPS rounding (4 dec)skylink/models/:white_check_mark:
DataToken encryptionAES-256-GCMcontacts/encryption.py:white_check_mark:
DataNo PII in logsStructured loggingskylink/middlewares.py:white_check_mark:
ContainerNon-root userUID 1000Dockerfile.*:white_check_mark:
Supply ChainDependency scanningpip-audit, Trivy.github/workflows/ci.yml:white_check_mark:
Supply ChainImage signingCosign (keyless).github/workflows/ci.yml:white_check_mark:
Supply ChainSBOMCycloneDX.github/workflows/ci.yml:white_check_mark:
Supply ChainSecret detectionGitleaks.github/workflows/ci.yml:white_check_mark:

Defense in Depth Visualization

┌─────────────────────────────────────────────────────────────────────────┐
│                                                                          │
│   Layer 1: NETWORK                                                       │
│   ├── Docker bridge isolation                                           │
│   ├── Internal services not exposed                                     │
│   └── Single entry point (Gateway:8000)                                 │
│                                                                          │
│   ┌───────────────────────────────────────────────────────────────────┐ │
│   │                                                                    │ │
│   │   Layer 2: TRANSPORT                                               │ │
│   │   ├── mTLS (mutual TLS)                                           │ │
│   │   ├── TLS 1.2+ with strong ciphers                               │ │
│   │   └── Certificate validation                                       │ │
│   │                                                                    │ │
│   │   ┌───────────────────────────────────────────────────────────┐   │ │
│   │   │                                                            │   │ │
│   │   │   Layer 3: APPLICATION                                     │   │ │
│   │   │   ├── JWT RS256 authentication                             │   │ │
│   │   │   ├── RBAC (5 roles, 7 permissions)                       │   │ │
│   │   │   ├── CN ↔ JWT cross-validation                           │   │ │
│   │   │   ├── Rate limiting (60 req/min)                          │   │ │
│   │   │   ├── Input validation (Pydantic)                         │   │ │
│   │   │   ├── Security headers (OWASP)                            │   │ │
│   │   │   └── Payload limit (64KB)                                │   │ │
│   │   │                                                            │   │ │
│   │   │   ┌───────────────────────────────────────────────────┐   │   │ │
│   │   │   │                                                    │   │   │ │
│   │   │   │   Layer 4: DATA                                    │   │   │ │
│   │   │   │   ├── AES-256-GCM encryption                      │   │   │ │
│   │   │   │   ├── GPS rounding (PII minimization)             │   │   │ │
│   │   │   │   ├── No PII in logs                              │   │   │ │
│   │   │   │   └── Idempotency controls                        │   │   │ │
│   │   │   │                                                    │   │   │ │
│   │   │   └───────────────────────────────────────────────────┘   │   │ │
│   │   │                                                            │   │ │
│   │   └───────────────────────────────────────────────────────────┘   │ │
│   │                                                                    │ │
│   └───────────────────────────────────────────────────────────────────┘ │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Data Classification

Classification Matrix

Data TypeClassificationAt RestIn TransitIn LogsRetention
Aircraft UUIDInternalPlaintextTLSAllowedUnlimited
Telemetry (speed, alt)ConfidentialPlaintextTLStrace_id only90 days
GPS PositionPIIRounded (4 dec)TLSNever90 days
Google ContactsPIINot storedTLSNeverSession only
OAuth TokensRestrictedAES-256-GCMTLSNeverUntil revoked
JWT TokensRestrictedN/A (memory)TLSNever15 min
mTLS CertificatesRestrictedFile (0600)TLSNever1 year
API KeysRestrictedEnv varTLSNeverUntil rotated

Data Handling Rules

┌─────────────────────────────────────────────────────────────────────────┐
│                        DATA HANDLING RULES                               │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│  INTERNAL DATA (Aircraft UUID, trace_id)                                │
│  ✓ Can be logged                                                        │
│  ✓ Can be stored plaintext                                             │
│  ✓ Can be transmitted                                                   │
│                                                                          │
│  CONFIDENTIAL DATA (Telemetry)                                          │
│  ✓ Can be stored                                                        │
│  ✗ Cannot be logged (only trace_id)                                    │
│  ✓ Must be encrypted in transit (TLS)                                  │
│                                                                          │
│  PII DATA (GPS, Contacts)                                               │
│  ⚠ GPS must be rounded (4 decimals = ~11m accuracy)                    │
│  ⚠ Contacts are read-only, not persisted                               │
│  ✗ Never logged                                                         │
│  ✓ Must be encrypted in transit (TLS)                                  │
│                                                                          │
│  RESTRICTED DATA (Tokens, Keys, Certs)                                  │
│  ✓ Must be encrypted at rest (AES-256-GCM)                             │
│  ✓ Must be encrypted in transit (TLS)                                  │
│  ✗ Never logged                                                         │
│  ✗ Never in source code                                                │
│  ✓ Environment variables or secrets manager                            │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Attack Surface Analysis

Attack Surface Map

SurfaceExposureRisk LevelAttack VectorsMitigations
API Gateway :8000InternetCRITICALDDoS, injection, auth bypassmTLS, JWT, rate limit, validation
Internal ServicesDocker networkMEDIUMLateral movementNetwork isolation, no auth needed
PostgreSQL :5432Docker networkHIGHSQL injection, data theftCredentials, parameterized queries
Container RegistryInternetHIGHImage tamperingCosign signing, Trivy scanning
CI/CD PipelineGitHub/GitLabHIGHSecret theft, code injectionGitleaks, protected branches
External APIsOutboundMEDIUMData leakageHTTPS, minimal data sharing

Exposed Endpoints

EndpointAuthenticationRate LimitedInput ValidationRisk
GET /healthNoneNoN/ALOW
GET /metricsNoneNoN/ALOW
POST /auth/tokenmTLSYesPydanticMEDIUM
POST /telemetry/ingestmTLS + JWTYesPydantic strictHIGH
GET /weather/currentJWTYesQuery paramsMEDIUM
GET /contacts/JWTYesQuery paramsMEDIUM

Cryptographic Inventory

Algorithms and Key Sizes

PurposeAlgorithmKey SizeRotation PeriodStorage
JWT SigningRS256 (RSA-SHA256)2048-bit90 daysEnv var (PRIVATE_KEY_PEM)
JWT VerificationRS2562048-bit90 daysEnv var (PUBLIC_KEY_PEM)
Token EncryptionAES-256-GCM256-bit90 daysEnv var (ENCRYPTION_KEY)
mTLS CARSA/X.5092048-bit1 yearFile (certs/ca/ca.crt)
mTLS ServerRSA/X.5092048-bit1 yearFile (certs/server/)
mTLS ClientRSA/X.5092048-bit1 yearFile (certs/clients/)
Image SigningECDSA (Sigstore)P-256Keyless (per-build)GitHub OIDC

Key Management

┌─────────────────────────────────────────────────────────────────────────┐
│                        KEY MANAGEMENT                                    │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│  DEVELOPMENT ENVIRONMENT                                                │
│  ├── .env file (git-ignored)                                           │
│  ├── Generated keys in /tmp                                            │
│  └── Test certificates in certs/                                        │
│                                                                          │
│  CI/CD ENVIRONMENT                                                       │
│  ├── GitHub Secrets / GitLab CI Variables                              │
│  ├── Protected variables (protected branches only)                      │
│  └── Masked in logs                                                     │
│                                                                          │
│  PRODUCTION (RECOMMENDED)                                                │
│  ├── HashiCorp Vault                                                    │
│  ├── AWS KMS / GCP KMS                                                  │
│  └── HSM for aircraft keys                                              │
│                                                                          │
│  ROTATION SCRIPTS                                                        │
│  ├── scripts/rotate_jwt_keys.sh (planned)                              │
│  ├── scripts/rotate_encryption_key.sh (planned)                        │
│  └── scripts/renew_certificates.sh (planned)                           │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Network Security

Network Topology

┌─────────────────────────────────────────────────────────────────────────┐
│                           INTERNET                                       │
│                              │                                           │
│                              │ TCP:8000 (mTLS)                          │
│                              ▼                                           │
│  ┌───────────────────────────────────────────────────────────────────┐  │
│  │                      DOCKER HOST                                   │  │
│  │                                                                    │  │
│  │  ┌─────────────────────────────────────────────────────────────┐  │  │
│  │  │                  skylink-net (bridge)                        │  │  │
│  │  │                                                              │  │  │
│  │  │  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐        │  │  │
│  │  │  │ gateway │  │telemetry│  │ weather │  │contacts │        │  │  │
│  │  │  │  :8000  │  │  :8001  │  │  :8002  │  │  :8003  │        │  │  │
│  │  │  └────┬────┘  └────┬────┘  └────┬────┘  └────┬────┘        │  │  │
│  │  │       │            │            │            │              │  │  │
│  │  │       └────────────┴────────────┴────────────┘              │  │  │
│  │  │                         │                                    │  │  │
│  │  │                    ┌────▼────┐                              │  │  │
│  │  │                    │   db    │                              │  │  │
│  │  │                    │  :5432  │                              │  │  │
│  │  │                    └─────────┘                              │  │  │
│  │  │                                                              │  │  │
│  │  └─────────────────────────────────────────────────────────────┘  │  │
│  │                                                                    │  │
│  │  EXPOSED PORTS:                                                   │  │
│  │  • 8000 (gateway) → mapped to host                               │  │
│  │                                                                    │  │
│  │  INTERNAL ONLY:                                                   │  │
│  │  • 8001, 8002, 8003, 5432 → not exposed                         │  │
│  │                                                                    │  │
│  └───────────────────────────────────────────────────────────────────┘  │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Network Policies

ServiceAllowed InboundAllowed Outbound
gatewayInternet:8000telemetry, weather, contacts
telemetrygatewayNone
weathergatewayWeatherAPI (HTTPS)
contactsgatewayGoogle APIs (HTTPS), db:5432
dbcontactsNone

Kubernetes Network Policies

For production Kubernetes deployments, network policies enforce zero-trust networking:

# Default: deny all traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: skylink-default-deny
spec:
  podSelector: {}
  policyTypes:
    - Ingress
    - Egress

Kubernetes Network Policy Matrix:

PolicyFromToPortsPurpose
gateway-ingressingress-nginxgateway8000External access
gateway-egressgatewayinternal services8001-8003Service routing
internal-ingressgatewaytelemetry/weather/contacts8001-8003Internal traffic
internal-egressinternal servicesexternal APIs443API calls
prometheus-scrapemonitoring namespaceall pods8000-8003Metrics collection

See KUBERNETES.md for full network policy configuration.


Security Headers

X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Referrer-Policy: no-referrer
Permissions-Policy: geolocation=(), microphone=(), camera=()

JWT Claims

{
  "sub": "aircraft_id (from mTLS CN)",
  "aud": "skylink",
  "iat": 1734600000,
  "exp": 1734600900,
  "role": "aircraft_standard"
}

RBAC Roles

RoleDescriptionKey Permissions
aircraft_standardDefault aircraftweather:read, telemetry:write
aircraft_premiumPremium aircraft+ contacts:read
ground_controlGround controlweather:read, contacts:read, telemetry:read
maintenanceMaintenancetelemetry:read/write, config:read
adminAdministratorAll permissions

Rate Limits

ScopeLimitWindow
Per aircraft_id60 requests1 minute
Global10 requests1 second