Giter Club home page Giter Club logo

certmagic-gcs's Introduction

Certmagic Storage Backend for Google Cloud Storage

This library allows you to use Google Cloud Storage as key/certificate storage backend for your Certmagic-enabled HTTPS server. To protect your keys from unwanted attention, client-side encryption is possible.

Usage

In this section, we create an caddy confi using our GCS storage.

Getting started

  1. Create a Caddyfile
{
	storage gcs {
    bucket some-bucket
  }
}
localhost
acme_server
respond "Hello Caddy Storage GCS!"
  1. Start GCS emulator
docker run -d \
  -p 9023:9023 \
  --name gcp-storage-emulator \
  oittaa/gcp-storage-emulator \
  start --default-bucket=some-bucket --port 9023 --in-memory


export STORAGE_EMULATOR_HOST=http://localhost:9023
  1. Start caddy
xcaddy run
  1. Check that it works
open https://localhost

Client Side Encryption

This module supports client side encryption using google Tink, thus providing a simple way to customize the encryption algorithm and handle key rotation. To get started:

  1. Install tinkey

  2. Create a key set

  tinkey create-keyset --key-template AES128_GCM_RAW --out keyset.json

Here is an example keyset.json

{
  "primaryKeyId": 1818673287,
  "key": [
    {
      "keyData": {
        "typeUrl": "type.googleapis.com/google.crypto.tink.AesGcmKey",
        "value": "GhDEQ/4v72esAv3rbwZyS+ls",
        "keyMaterialType": "SYMMETRIC"
      },
      "status": "ENABLED",
      "keyId": 1818673287,
      "outputPrefixType": "RAW"
    }
  ]
}
  1. Start caddy with the following config
{
  storage gcs {
    bucket-name some-bucket
    encryption-key-set ./keyset.json
  }
}
localhost
acme_server
respond "Hello Caddy Storage GCS!"
# restart the fake gcs backend to start with an empty bucket
docker restart gcp-storage-emulator

# start caddy
xcaddy run

# to rotate the key-set
tinkey rotate-keyset --in keyset.json  --key-template AES128_GCM_RAW

certmagic-gcs's People

Contributors

chaudyg avatar dependabot[bot] avatar filewalkwithme avatar hairyhenderson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.