Skip to content
GitHub

Secrets management

Proper secrets management is critical for securing your Rafiki deployment. This section covers all types of secrets used in the architecture.

Database credentials are used by all services to connect to PostgreSQL and Redis instances.

Secret TypeUsage
PostgreSQL AdminDatabase administration
PostgreSQL ServiceApplication connections
Redis PasswordCache connections

Application-specific secrets used by Rafiki services for encryption and authentication.

Secret TypeUsage
COOKIE_KEYSession cookie encryption
AUTH_SERVER_SECRETJWT token signing
WEBHOOK_SECRETWebhook signature validation
PRIVATE_KEY_FILEILP packet signing

TLS certificates for securing communications between services and external clients.

Certificate TypeUsage
Let’s EncryptPublic HTTPS endpoints
Internal CAService-to-service

Credentials for connecting to external services and APIs.

Credential TypeUsage
GCP Service AccountGoogle Cloud APIs
Container RegistryImage pulls
Monitoring APIsMetrics and alerting
  • Generate strong secrets: Use cryptographically secure methods to generate secrets
  • Secure Kubernetes namespaces: Create Kubernetes secrets for each namespace
  • Use a secrets manager: For enhanced security, store secrets in Google Cloud Secrets Manager or Hashicorp Vault
  • Rotate secrets on a regular basis: Automate secret rotations with CronJobs

With your secrets securely generated and managed:

  1. Secure storage: Store your generated secrets in a secure location (not in Git!)
  2. Setup infrastructure: Deploy GCP infrastructure using Terraform - you’ll need these secrets during the deployment process
  3. Deploy services: Configure and deploy Rafiki and wallet services using your pre-generated secrets

Proper secrets management is foundational to a secure Rafiki deployment. Regular rotation, secure storage, and comprehensive monitoring ensure your payment infrastructure remains protected.