惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
K
Kaspersky official blog
G
Google Developers Blog
T
Threat Research - Cisco Blogs
T
The Blog of Author Tim Ferriss
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Recorded Future
Recorded Future
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
S
Schneier on Security
P
Palo Alto Networks Blog
H
Hacker News: Front Page
N
News and Events Feed by Topic
N
Netflix TechBlog - Medium
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
SecWiki News
SecWiki News
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Hacker News
The Hacker News
C
Check Point Blog
L
LangChain Blog
腾讯CDC
小众软件
小众软件
T
Tenable Blog
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
About on SuperTechFans
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
Recent Announcements
Recent Announcements
Hacker News: Ask HN
Hacker News: Ask HN
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
雷峰网
雷峰网
美团技术团队
D
DataBreaches.Net
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Cloudflare R2 EU jurisdiction storage for UK GDPR: what we learned
Sandra Versl · 2026-05-20 · via DEV Community

Most UK SaaS founders default to S3 in eu-west-2 and call it GDPR compliance done. It is not.

S3 in London is operated by AWS Inc, a US entity. The data sits in London. The processor sits in Seattle. Under UK GDPR Chapter V and the post-Schrems II ICO position, that is a transfer to a non-adequate third country unless your DPA includes the latest SCCs and a documented Transfer Impact Assessment. Plenty of UK SMBs get away with it. Plenty also fail compliance audits because of it.

We built Beamprobe (a UK virtual data room) on Cloudflare R2 with the EU jurisdiction flag instead. After six months in production, here is what worked, what tripped us up, and what I would do differently.

Why R2 EU jurisdiction is different from "R2 in Europe"

R2 has a jurisdiction setting at the bucket level. You can set it to EU. When you do, three things change:

  1. The bucket is pinned to EU member-state data centres. No transparent replication to North America.
  2. The bucket lives under Cloudflare's Frankfurt-based entity for billing and processor purposes.
  3. Cross-border transfer events (egress to non-EU regions) are logged and surfaced in the audit feed.

For UK GDPR purposes, the second one is the load-bearing detail. The processor entity matters more than the rack location. Cloudflare's EU jurisdiction puts you on a DPA signed against a Frankfurt entity, with Chapter V transfers handled through their EU subprocessor list rather than a US parent.

The setting is buried. You pick it when you create the bucket in the Cloudflare dashboard, or you pass jurisdiction: 'eu' in the S3-compatible API.

# Wrangler example
wrangler r2 bucket create beamprobe-prod --jurisdiction eu

Enter fullscreen mode Exit fullscreen mode

There is no way to migrate an existing bucket to a different jurisdiction. You create a new one, copy, swap. We learned that the hard way after launching with a default-jurisdiction bucket and realising during a customer audit.

The Phoenix / ExAws setup

We use ExAws against the R2 S3-compatible endpoint. Configuration sits in runtime.exs so the same release binary runs in dev with local-disk storage and in prod with R2.

# config/runtime.exs

if storage_adapter == :s3 do
  r2_account = System.get_env("R2_ACCOUNT_ID") || raise "R2_ACCOUNT_ID missing"
  r2_key = System.get_env("R2_ACCESS_KEY_ID") || raise "R2_ACCESS_KEY_ID missing"
  r2_secret = System.get_env("R2_SECRET_ACCESS_KEY") || raise "R2_SECRET_ACCESS_KEY missing"

  config :ex_aws,
    access_key_id: r2_key,
    secret_access_key: r2_secret,
    region: "auto"

  config :ex_aws, :s3,
    scheme: "https://",
    host: "#{r2_account}.eu.r2.cloudflarestorage.com",
    region: "auto"
end

Enter fullscreen mode Exit fullscreen mode

Two non-obvious bits:

  • region: "auto". R2 ignores region but ExAws insists on having one. "auto" is the canonical value.
  • The host has .eu. baked in for EU-jurisdiction buckets. Default-jurisdiction is <account>.r2.cloudflarestorage.com. Wrong host on either side returns a confusing 404.

R2 access keys are scoped per bucket, not per account. Create one set of credentials per environment. Rotate quarterly.

Encryption at rest: what R2 gives you and what it does not

R2 encrypts at rest using AES-256 with Cloudflare-managed keys. That satisfies Article 32 on its own for most categories of data. For investor-grade documents with NDAs, we add envelope encryption on top:

  1. Generate a 256-bit data encryption key (DEK) per file.
  2. AES-256-CBC encrypt the file body with the DEK.
  3. S/MIME-encrypt the DEK under a per-user key, store separately.
  4. Upload the ciphertext to R2.

The result: even a leaked R2 access key does not give the attacker plaintext. They need our user-key store too. That is two distinct breach paths needed for one disclosure, which is the bar UK GDPR Article 32 "appropriate technical measures" actually expects for special-category data.

Cloudflare also offers SSE-C (server-side encryption with customer keys). We do not use it because the key never leaves our Phoenix backend in our model; envelope encryption gives us the same guarantee with one less moving part.

Presigned URLs without leaking the bucket

R2 presigned URLs work the same as S3 presigned URLs. Time-bound, signed with HMAC-SHA256, single-resource.

defmodule Beamprobe.Storage do
  def presigned_url(key, expires_in \\ 3600) do
    full = prefixed(key)
    ExAws.S3.presigned_url(:get, bucket(), full, expires_in: expires_in)
  end
end

Enter fullscreen mode Exit fullscreen mode

Three things to lock down:

  • Short TTL. We use 600 seconds for viewer page rasters, 60 seconds for downloads. Long TTLs end up in browser history and crash dumps.
  • Per-object prefix. We path-prefix every object as documents/<user_id>/<room_id>/<random>.pdf. The random suffix is 16 bytes of crypto, base64. Guessing one URL gets you one document, not the bucket.
  • CORS off by default. R2 buckets default to no CORS. Do not enable it unless a browser actually needs to fetch the object directly. We serve every public asset through a viewer endpoint that signs URLs server-side.

Lifecycle policies and the egress trap

R2's headline feature is zero egress fees. There is a footnote.

The "no egress" applies to clients of Cloudflare's network: workers, pages, your own zone. Egress to third-party origins via S3 API call is billed. Cross-region replication is billed. Lifecycle transitions to Glacier-equivalent classes (R2 calls them "Infrequent Access") are billed at the transition.

If you write a worker or a server that pulls objects out of R2 to a non-Cloudflare endpoint, you pay normal egress. The zero-egress model assumes your serving plane lives inside Cloudflare.

Our setup: Phoenix on Hetzner Germany. We DO pay egress when Phoenix fetches a document body to decrypt and serve. That is what we are willing to pay for control.

The lesson: model your egress before you bet your unit economics on "R2 = free egress." For most B2B SaaS workloads this is fine. For media streaming or large-file delivery it is not.

Cost comparison vs S3 eu-west-2

Real numbers from a single Beamprobe production month (May 2026):

Line item R2 EU S3 eu-west-2 equivalent
Storage 540 GB $8.10 $12.42
Class A operations (writes) 380K $1.71 $1.90
Class B operations (reads) 4.2M $1.51 $1.68
Egress to Hetzner 180 GB (paid same as S3) $16.20
Monthly total ~$11 ~$32

For our workload R2 is roughly a third the cost. The math flips if you are serving public CDN-style traffic where R2's free egress to Cloudflare zones wins big.

Mistakes we made

  1. Created bucket without EU jurisdiction. Lost a week migrating to an EU-jurisdiction bucket.
  2. Did not pin region in the access key. Access keys are scoped per bucket, not account. We over-permissioned an early key.
  3. Stored presigned URLs in logs. A 1-hour presigned URL is a 1-hour credential. We now redact ?X-Amz-Signature from log lines server-side.
  4. Used default CORS off but did not test. Browsers fail silently. Wrap every CORS-bound flow in a Playwright test that hits the actual bucket.
  5. Forgot to set lifecycle rules for failed multipart uploads. R2 charged us for orphaned parts for two months before we noticed. Set the lifecycle rule on day one:
wrangler r2 bucket lifecycle put beamprobe-prod \
  --abort-multipart-uploads-after-days=1

Enter fullscreen mode Exit fullscreen mode

What I would do differently

  • Pick EU jurisdiction at bucket creation, no exceptions.
  • Document the processor relationship in the DPA from day one. Cloudflare publishes a UK GDPR-aware DPA at cloudflare.com/legal/data-processing-agreement. Sign it.
  • Bake the envelope-encryption pattern into the storage abstraction, not into individual upload handlers. Less risk of forgetting a code path.
  • Use Cloudflare Workers as a thin signing layer for presigned URLs if your serving plane is also on Cloudflare. We did not because Phoenix-on-Hetzner is our model. If you are on Workers anyway, do it.
  • Run a quarterly access-key rotation drill. Cloudflare makes rotation easy; the human process of updating env vars across dev/staging/prod is the slow bit.

When R2 is not the right call

  • You need single-region S3 endpoint matching for a customer who requires eu-west-2 in their DPA. R2 cannot give you AWS-region semantics.
  • You depend on AWS IAM features (resource policies, KMS integration, CloudTrail audit). R2's IAM is simpler. Some compliance auditors prefer the AWS depth.
  • You need cross-region replication for disaster recovery. R2 does not yet ship that for EU-jurisdiction buckets at the time of writing.

For everything else, R2 EU is faster to set up, cheaper for our workload, and easier to defend in a UK GDPR audit because the processor entity is in Frankfurt rather than Seattle.

Sources

  • ICO Data Sharing Code of Practice (2024 update)
  • UK GDPR Chapter V (international transfers)
  • Cloudflare R2 jurisdiction documentation
  • Schrems II judgement, CJEU C-311/18

I write about UK data residency, document security and Elixir/Phoenix at beamprobe.com. Beamprobe is a UK virtual data room for fundraising teams and M&A advisors. Bootstrapped, built in the UK, used worldwide.