-
Notifications
You must be signed in to change notification settings - Fork 45
Jurisdiction support for GDPR & FedRAMP #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Keep in mind that |
Well, this explains so much. Thanks @daliborgogic! |
Maybe I spoke a little too quickly before consuming coffee. After taking another look at the code, am I not already trying to apply the jurisdiction to the Durable Object? Unless I'm missing a bigger piece here. Thoughts @daliborgogic? |
|
Need to check if if (env.JURISDICTION && request.cf.jurisdiction) {
// If jurisdiction is specified, it takes precedence over region
} else {
// Fall back to region-based routing if no jurisdiction is specified
}edit: regarding GDPR & FedRAMP imho is better to use Regional Services. Because Workers may still access Durable Objects constrained to a jurisdiction from anywhere in the world. |
Thanks for pointing that out @daliborgogic :) I don't disagree that Regional Services is the better approach for GDPR and FedRAMP compliance – however, there's no good way to enforce those rules via Wrangler. It would be wonderful if I could declare it in my Going back to your previous suggestion... When I do as suggested, I still don't see the |
|
"Durable Objects do not currently change locations after they are created."
My mistake, sorry. I'll try to do a minimal reproduction |
|
@Brayden not sure if this works with Durable Objects but I know it does with D1, but Smart Placement might help: https://developers.cloudflare.com/workers/configuration/smart-placement/
Do you mean the request originates from the Durable Object? Or it's a request passed to the DO? |
Purpose
This code allows users to deploy their durable objects in a manner that adheres to GDPR protocol. Values you can choose for
JURISDICTIONin your wrangler file include:eufedrampIf no entry exists for
JURISDICTIONthen it will fallback to using theREGIONas a suggested deployment region, and if no region is specified then a normal deployment happens where the first request origin location to the DO is likely where the DO will exist.Tasks
colovalue adheres toeuandfedramplocations in the following cURLVerify
Currently it appears we are receiving errors when deploying the durable object and attempting to access it with the above cURL. Here is the stacktrace:
{ "truncated": false, "executionModel": "stateless", "outcome": "exception", "scriptVersion": { "id": "f2ce52cf-ff42-4a92-8f0b-a568577fd195" }, "scriptName": "starbasedb", "diagnosticsChannelEvents": [], "exceptions": [ { "stack": " at async Object.fetch (index.js:1247:12)", "name": "Error", "message": "Internal error while starting up Durable Object storage caused object to be reset.", "timestamp": 1730909659548 } ], "logs": [], "eventTimestamp": 1730909659249, "event": { "request": { "url": "https://starbasedb.YOUR-IDENTIFIER.dev/status/trace", "method": "GET", "headers": { "accept": "*/*", "accept-encoding": "gzip, br", "authorization": "REDACTED", "cache-control": "no-cache", "cf-connecting-ip": "24.112.251.244", "cf-ipcountry": "US", "cf-ray": "8de6603a4ec4dda6", "cf-visitor": "{\"scheme\":\"https\"}", "connection": "Keep-Alive", "content-type": "application/json", "host": "starbasedb.YOUR-IDENTIFIER.workers.dev", "postman-token": "REDACTED", "user-agent": "PostmanRuntime/7.39.1", "x-forwarded-proto": "https", "x-outerbase-source-token": "REDACTED", "x-real-ip": "24.112.251.244", "x-starbase-source": "external" }, "cf": { "clientTcpRtt": 36, "longitude": "-80.13670", "httpProtocol": "HTTP/1.1", "tlsCipher": "AEAD-AES128-GCM-SHA256", "continent": "NA", "asn": 27364, "clientAcceptEncoding": "gzip, deflate, br", "country": "US", "verifiedBotCategory": "", "tlsClientAuth": { "certIssuerDNLegacy": "", "certIssuerSKI": "", "certSubjectDNRFC2253": "", "certSubjectDNLegacy": "", "certFingerprintSHA256": "", "certNotBefore": "", "certSKI": "", "certSerial": "", "certIssuerDN": "", "certVerified": "NONE", "certNotAfter": "", "certSubjectDN": "", "certPresented": "0", "certRevoked": "0", "certIssuerSerial": "", "certIssuerDNRFC2253": "", "certFingerprintSHA1": "" }, "tlsExportedAuthenticator": { "clientFinished": "924b6c6998b8b57fd1222e23d3f0722a08648d4b56b79f5057962a19282bdd14", "clientHandshake": "1209b74b97c80d47aac6eddc5f30d23257d83c9c206548b4189c4e0f20c40769", "serverHandshake": "97f7bf3ed27d78a04ca5aed0b288c3bcbc14617b4aece30ddeb9b820ca4811e2", "serverFinished": "a5542f301964c95bca55df64a955ddb6d72d322b1f52bd4e55270eeddaa083d5" }, "tlsVersion": "TLSv1.3", "colo": "IAD", "tlsClientHelloLength": "508", "edgeRequestKeepAliveStatus": 1, "requestPriority": "", "tlsClientExtensionsSha1": "/KdboeBKvsYpmQ6za4zdVuBsiNI=", "tlsClientRandom": "49SOmhKB4z6XYh6xv0ohhV7snfpqZ9rLtRpV1lT5M8U=" } }, "response": { "status": 500 } }, "id": 0 }Before
After