Origin Protection
Cloudflare Authenticated Origin Pulls (mTLS)
Section titled “Cloudflare Authenticated Origin Pulls (mTLS)”Runway uses Cloudflare Authenticated Origin Pulls (AOP) with mutual TLS (mTLS) to ensure all traffic to your Kubernetes applications flows through Cloudflare’s security controls. This prevents direct origin access attacks and ensures that WAF rules, rate limiting, and other security features cannot be bypassed.
How It Works
Section titled “How It Works”When a user requests your application, the request flows through multiple validation layers:
- User → Cloudflare: The request reaches Cloudflare’s edge network
- Cloudflare → Your Origin: Cloudflare presents a client certificate signed by Runway’s certificate authority
- Load Balancer Validation: Your cloud load balancer validates the certificate against the trusted CA
- Application Access: Only requests with valid certificates reach your application pods
┌─────────────┐│ Internet ││ Users │└──────┬──────┘ │ HTTPS ▼┌──────────────────┐│ Cloudflare ││ Edge Network │└──────┬───────────┘ │ HTTPS + mTLS │ (client cert) ▼┌──────────────────────────┐│ Cloud Load Balancer ││ (validates cert) │└──────┬───────────────────┘ │ (only if valid) ▼┌──────────────────────────┐│ Your Application Pods │└──────────────────────────┘Certificate Management
Section titled “Certificate Management”Runway automatically manages the complete certificate lifecycle using HashiCorp Vault:
Certificate Hierarchy
Section titled “Certificate Hierarchy”Root CA (20 years) └─ Intermediate CA (10 years) └─ Client Certificates (90 days, auto-rotated)- Root CA: Stored securely in Vault, signs the intermediate CA
- Intermediate CA: Stored in Vault, issues client certificates for Cloudflare
- Client Certificates: Short-lived (90 days), automatically rotated before expiration
Automatic Rotation
Section titled “Automatic Rotation”Client certificates are automatically rotated every 90 days with zero downtime. Runway detects expiring certificates, issues new ones from Vault, uploads them to Cloudflare, and your load balancers continue validating against the same intermediate CA without requiring any manual intervention.
Security Benefits
Section titled “Security Benefits”| Aspect | Protection |
|---|---|
| Direct Origin Access | ❌ Blocked - only Cloudflare can connect |
| WAF Bypass | ❌ Prevented - all traffic validated |
| Rate Limiting Bypass | ❌ Prevented - all traffic validated |
| DDoS Attacks | ✅ Mitigated at Cloudflare edge |
| Certificate Compromise | ✅ Limited exposure (90-day rotation) |
Enabling Cloudflare AOP
Section titled “Enabling Cloudflare AOP”AOP is enabled by default for all external facing workloads. To explicitly configure it, add the following to your workload in the inventory file located at config/runtimes/[eks|gke]/workloads.yml:
- runway_service_id: my-service project_id: 12345 cloudflare: enabled: trueTo disable AOP, set enabled: false for your workload. Then add the following to your service configuration in .runway/${RUNWAY_SERVICE_ID}/default-values.yaml located in your service repository:
spec: load_balancing: cloudflare: falseGKE Considerations
Section titled “GKE Considerations”For GKE services, contact the Runway team in #g_runway when enabling AOP. The GCP Gateway API currently lacks native mTLS support, so Runway performs additional configuration steps to ensure certificate validation. GCP has indicated native mTLS support will be available in H2 2026. See issue #713 for details.
Implementation Details
Section titled “Implementation Details”Runway implements mTLS validation differently depending on your cloud provider, but both use the same certificate hierarchy and validation logic.
AWS EKS
Section titled “AWS EKS”- Trust Store: Stores the Intermediate CA certificate
- Ingress Annotations: Configure mTLS validation on ingress resources
- Validation: AWS Application Load Balancer (ALB) validates all incoming client certificates
GCP GKE
Section titled “GCP GKE”- Trust Config: Stores the Intermediate CA certificate
- Server TLS Policy: Configures mTLS validation on Cloud Load Balancer Target HTTPS Proxy
- Validation: GCP Cloud Load Balancer validates all incoming client certificates
Monitoring
Section titled “Monitoring”Runway provides observability for mTLS validation:
- Certificate Expiration Tracking: Monitor and alert when certificates are approaching rotation
- Validation Metrics: Track and alerts based on HTTP 525(TLS Handshake) error rates
Contact the Runway team in #g_runway if you notice any certificate-related issues or validation failures.
Support
Section titled “Support”For questions about mTLS, certificate rotation, or security configuration, reach out to the Runway team in #g_runway.
IP Filtering for Origins that use Cloudflare
Section titled “IP Filtering for Origins that use Cloudflare”In addition to mTLS validation, Runway provides IP filtering capabilities to restrict inbound traffic to your Kubernetes workloads exclusively from Cloudflare’s IP ranges. This adds an extra layer of security by preventing direct access to your origin.
How IP Filtering Works
Section titled “How IP Filtering Works”When IP filtering is enabled, Runway will:
- Allow traffic only from Cloudflare IP ranges: Ingress traffic is restricted to Cloudflare’s published IP address ranges
- Block all other traffic: Any requests from non-Cloudflare sources are blocked
The filtering is implemented at the edge layer (loadbalancer) using Cloud Armor policies in GKE and Security Groups in EKS.
Enabling IP Filtering
Section titled “Enabling IP Filtering”IP filtering is enabled by default for workloads with external loadbalancer setting. To disable it, add the following to your .runway/${RUNWAY_SERVICE_ID}/default-values.yaml file located in your service repository (the same way you can disable AOP):
spec: load_balancing: cloudflare: falseCombining mTLS and IP Filtering
Section titled “Combining mTLS and IP Filtering”For maximum security, Runway recommends enabling both mTLS and IP filtering (both are enabled by default).
This creates a defense-in-depth strategy:
- Network Layer: IP filtering blocks non-Cloudflare traffic at the loadbalancer layer
- TLS Layer: mTLS validates that traffic comes from Cloudflare with a valid certificate and only from Runway’s account
- Application Layer: Your application receives only validated, authenticated requests