I have been trying out using a bulk import operation using the customerSet mutation to import customers from an external system into Shopify.
Firstly you use stagedUploadsCreate to generate a URL, then upload the file to that URL before providing it to bulkOperationRunMutation to import.
The file you upload is publicly available. This is not acceptable for sensitive data like customer data.
There are two main security problems (at least):
- URLs aren’t considered safe for storing secrets
- Anyone with access to the files can read them
URLs aren’t considered safe for storing secrets
I understand the URL isn’t guessable. From my examples it takes the form something like:
https://shopify-staged-uploads.storage.googleapis.com/tmp/[id]/bulk/[UUID]/[file name].jsonl You can also make the file name a UUID or similar to make it even harder to guess.
However, URLs aren’t considered safe for storing secrets. After SSL termination (at Google in this case), the URLs are often logged so this would expose access to these files.
The files also expire, which makes a leak less likely, but anyone who accesses the file would of course be able to download it.
Anyone with access to the files can read them
The file isn’t encrypted, so anyone with access to the files bucket can read this file.
Have I missed a way to secure this data? All I have found so far is using the `customerSet` mutation individually for each customer, but that is obviously a lot slower than using the bulk import.
A similar question was asked here: Private uploading in GraphQL Bulk operation ? One of the answers suggests encrypting the file before uploading, but how would Shopify decrypt this data when importing?