Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can an application store secrets in Google Cloud Datastore securely?

I am building an application that will run on Google App Engine (GAE). It will need access to data stored by the user in other systems (e.g. the user's Nest thermostat, Yahoo mail). The application running on GAE will allow the user to provide credentials for the other system. The application will store these credentials in Google Cloud (Datastore) for later use by an application running on Google Compute Engine on the users behalf. The application will also allow OAuth to allow the user to allow the application access the external system in the user's behalf. The application will need to store user credentials (username and passwords) or OAuth access tokens in the Google Cloud.

The application will need to encrypt the secrets before they are stored and be able to unencrypt the data to send it to the external systems. That is, the system will need to use symmetric encryption and therefor need to securely manage keys.

How can the application store these secrets in the Google Cloud Datastore (Datastore) securely? I think I am looking for something like the AWS CloudHSM for Google. That is, I would like to store each secret with a seed and key id and use the key id to get the key from a key management system. This implementation would also allow for key rotation and other standard security practices.

I think I am looking for a Google Cloud service or Google API that provides secrets management and only allows an app with the proper Google app identifier to access the secrets.

Is there a service within Google Cloud or Google APIs that will manage secrets? Is there another architecture that I should be considering?

By the way, the application uses Google Identity Toolkit (GitKit) to authenticate and authorize users to use the GAE hosted application. The application allows users to create accounts using either federate identities or username and passwords via GitKit.

Thanks, chris

like image 846
Chris Maloney Avatar asked Feb 23 '15 17:02

Chris Maloney


People also ask

How secure is Google secret Manager?

Encrypted by default Data is encrypted in transit with TLS and at rest with AES-256-bit encryption keys.

How is data encrypted in the Google Cloud Platform?

GCP uses AES-256 encryption by default when data is at-rest in Google Cloud Storage, and data-in-transit is encrypted with TLS by default. When encrypting data on the Cloud, GCP utilizes DEKs and KEKs, which are used and stored with Google's Key Management Service (KMS) API.

Is a cloud service for storing application secrets?

Azure Key Vault is the native secrets management service offered by Azure to centrally manage secrets, keys, and certificates used by cloud applications. The standard tier of the service offers encryption via a software key, while the premium tier supports keys protected by hardware security modules (HSM).

What is a centralized cloud service for storing your application secrets?

Azure Key Vault is a cloud service for securely storing and accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, or cryptographic keys. Key Vault service supports two types of containers: vaults and managed hardware security module(HSM) pools.


2 Answers

In the meantime, Google also added a Key Management Service: https://cloud.google.com/kms/

You could e.g. use it to encrypt your data before storing it in a database. Or, use KMS to encrypt an AES key to encrypt your data, and possibly keep a backup of your AES key somewhere in case you lose access to KMS.

like image 76
Remko Avatar answered Oct 01 '22 18:10

Remko


App Identity Service might be what you are looking for https://cloud.google.com/appengine/docs/java/appidentity/#Java_Asserting_identity_to_other_systems

It lets you sign content with an application-specific private key, and provides rotating certificates to validate signed content.

like image 38
Gabriel Avatar answered Oct 01 '22 19:10

Gabriel