Deployment guides

Docker, Compose and Swarm

Containers are replaced on every deploy, so give each service one canary in the environment file or secret it already loads. Give the Docker host itself a per-machine canary too.

Compose

Write the decoy to an environment file that only you can read, next to the service's other secrets:

umask 077
curl -fsSL https://get.snitchwallet.com | sh -s -- --decoy env:- --name prod-compose > ./secrets/payout.env

Load it in the service:

services:
  api:
    env_file:
      - ./secrets/payout.env

Keep ./secrets/ out of git, like your other secrets.

docker run

docker run --env-file ./secrets/payout.env your-image

Swarm

Create a Swarm secret straight from the pipe:

curl -fsSL https://get.snitchwallet.com | sh -s -- --decoy env:- --name prod-swarm | docker secret create payout_signer -

Give it to the service; each container sees it at /run/secrets/payout_signer:

services:
  api:
    secrets:
      - payout_signer

secrets:
  payout_signer:
    external: true

Never in the image

Don't COPY a decoy into an image or set it with ENV in a Dockerfile. Images get pushed, cached and pulled to many places, so a canary in one can't tell you where it leaked.