🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/googlecloudplatform/storage-client-side-encryption-proxy

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

github.com/googlecloudplatform/storage-client-side-encryption-proxy

v1.0.0
96

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Repository has been archived by the owner.
Version published
Created
Issues
1

storage-client-side-encryption-proxy

This tool uses Tink to perform client side encryption operations backed against Google Cloud KMS. It is both a client side encryption/decryption tool as well as a decrypting proxy for Google Cloud Storage.

This is not an officially supported Google product

Pre-Setup

  • You have golang 1.14 or newer installed

Setup

  • Create a service account that can encrypt and decrypt
  • Use application credential: https://cloud.google.com/docs/authentication/production
  • Setup a bucket to store your encrypted files.
  • Setup KMS and create a key in the same region as your bucket
  • acquire certificate and corresponding key for TLS. Place in the tools directory, and name them as follows. Note: you can change the names and location by altering the scriptes/variables.sh file
  • edit scripts/variables.sh with your GCP information (i.e bucket name and key name)

Building

  • go build -o tinkproxy

Running

This example uses the binary built named tinkproxy as described in the previous step. The tool uses Tink backed by Google Cloud KMS to encrypt a data encryption key (DEK) per directory, which is then uploaded to your GCS bucket. After the encrypted files are uploaded, a single file is then downlaod through the decrypting proxy, which decrypts using the appropriate KMS key.

  • ./tinkproxy --help
  • source scripts/variables.sh # be sure to edit the configuration to match your environment
  • ./scripts/uploadDirectory.sh samples
  • ./scripts/getObject.sh
  • ./scripts/cleanup.sh

Also, you can encrypt and decrypt individual files

  • ./tinkproxy vanish samples/gettysburg.pdf -o demo.cipher
  • ./tinkproxy reveal demo.cipher -o cleartext.pdf

Production Considerations

Consider the following items when using for production.

  • build and version the binary
  • deploy the proxy on trusted compute such as shielded VMs, use tmpfs, and private network access along with other controls to mitigate data exfiltration (e.g VPC-SC)
  • use certificates and AAD that meet your security governance requirements
  • use appropriate logging levels and client timeouts

FAQs

Package last updated on 05 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts