Secure way of uploading data to Google Cloud Storage
Yes, your approach sounds okay to me. I am not sure how you &quot;ship&quot; machines but it is a good idea to use a service account per machine as you can delete the service account key if the machine ever becomes compromised.
You can, and should, fully automate the process of generating the credentials key files using the Google APIs or gcloud cli.
It is best practice to periodically rotate (re-issue) credentials key files. This is in case they are accidentally leaked in a way that you do not notice. If you always revoke the key and issue a new one every month then it limits the total damage somewhat.
If you do rotate keys then you have a key distribution problem. How do you securely distribute the new credentials key files onto machines you shipped in the past? You can use GnuPG to create a public-private key pair on every host. Each month you can run a script that generates a new credentials key file per machine, encrypt it with the machine's public GPG key, then delete the old service account keys.
The script that pushes images to a bucket must then periodically &quot;phone home&quot; to collect a fresh GPG encrypted credentials key file. It can then decrypt it with its own private key. One way to do this is to put the encrypted keys into a different bucket. Create a single service account that can only read that bucket. Create a single credentials key file for that service account that you install onto every machine. That key can then only be used to only collect encrypted keys that can only be decrypted on the correct host.