Secrets, Secrets Are No Fun, When You Share with Everyone

Nov 6, 2019 by Kathryn Lewis

Motivation: Spinnaker’s Dirty Little Secret about Secrets

Passwords and tokens (aka “secrets”) are a fact of life in software development, and operating Spinnaker involves managing configs with lots and lots of secrets. Secrets can be a challenge to manage, but tend to be less work than managing a major data breach. Leaked secrets lead to compromises in user privacy, substantial fines, losses in revenue, and damage to public trust and confidence.

More facts of life in software development are version upgrades, changing infrastructure, and the need to maintain version histories of all of these configurations. Source control systems such as Git are excellent solutions for tracking configuration changes and automatically maintaining version histories. However, storing passwords in a GitHub repository is a very dangerous practice, even if it is a private repo. That is, unless you like accidentally sharing your secrets with the entire world…

What not to do…

Until recently, Spinnaker hasn’t had a built-in secrets management system. As a result, users had to construct their own home-brewed solutions for sharing and versioning Spinnaker configurations, or dangerously leave those secrets in a Git repository. Typically, this home-brew solution was less than robust, and was designed as a temporary solution until they could implement a more robust security solution. But then other tasks and product features take priority, and months or years later their temporary security solution was not so temporary or secure.

Implementation Basics: The Secrets to Keeping Secrets Secret

To solve this problem, we’ve added an end-to-end Secrets Management solution to Spinnaker! Secrets can be stored in encrypted S3 buckets (available in OSS and Armory Spinnaker), or in Vault (exclusive to Armory Spinnaker). The solution is extensible, so we can easily add new secret stores – reach out to us here or on Spinnaker Slack to let us know which secret stores you would like to see added.

Spinnaker users simply replace the secret value in their halconfig and/or service yamls with a syntax (described here and here) that tells Spinnaker where to fetch the secret.

Example of the Secrets syntax

The implementation uses role-based access control (RBAC) for permissions, so you simply need to ensure that Halyard and the Spinnaker services are running with roles that can access your chosen secret store.

Operation: The Secret Sauce

Halyard will read in all config values from ~/.hal/config and will decrypt a secret any time it needs the actual value for a task, such as account validation. Halyard stores the value in memory or as a temporary file on disk for any secret that needs to be in file format (e.g., kubeconfig, SAML keystore files, etc.)

When it comes time to create the profiles for each service (found under ~/.hal/default/staging/), Halyard reverts back to using the encrypted syntax and cleans up temporary files. Finally, each Spinnaker service gets deployed, starts up, and decrypts the secrets found in its config files.

Yay! Celebrating Not-So-Secretly

With Armory’s Secrets Management solution, nowhere, in any configuration file, are you required to have a secret in plain text. You can now safely share and version your Spinnaker configurations for faster, more reliable, more secure deployments.

Interested in learning more about Secrets Management with Spinnaker? Reach out to us here or on Spinnaker Slack – we’d love to chat!

Note: This process applies to configuration secrets for Spinnaker itself (GitHub tokens, AWS keys, SAML keystores, etc.), not secrets for the applications Spinnaker is deploying.

Recently Published Posts

How Armory Uses Makelog to Drive New Feature Adoption from Day One

Jun 23, 2022

original post For teams that practice CI/CD and ship multiple times a day, waiting weeks to communicate these updates to customers defeats the purpose. After all, if a feature ships and nobody knows about it, did it really ship? You miss out on delivering value to customers sooner, learning which features they’re most excited about, […]

Read more

Armory Continuous Deployment-as-a-Service is Now Available

Jun 6, 2022

Over the last two years, our customers and prospects have said one thing: everyone wants Continuous Deployment, but adopting CD to production is too hard for many companies. Today we’re excited to announce that Armory is making production-grade continuous deployment available to all users of Kubernetes, regardless of size. Armory Continuous Deployment-as-a-Service has been in […]

Read more

Introducing OpenCost—An Open Source Project for Monitoring Kubernetes Spend

Jun 2, 2022

We are excited to share the launch of OpenCost, an open source project that provides real-time cost monitoring for teams running Kubernetes workloads.   As container and Kubernetes adoption continues to grow, navigating the complexities around measuring and allocating cost is becoming a business-critical challenge. A recent CNCF survey showed overspend is increasingly a problem for […]

Read more