Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Don't Commit Your Secrets
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Nicholas Henry
June 17, 2014
Programming
0
7.1k
Don't Commit Your Secrets
How to keep your application secrets safe
Nicholas Henry
June 17, 2014
Tweet
Share
More Decks by Nicholas Henry
See All by Nicholas Henry
Mise en Place for Ecto
nicholasjhenry
0
18
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
22
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
110
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
12
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
230
Building the Montreal Elixir Community
nicholasjhenry
0
55
How Elixir is Transforming My Mind
nicholasjhenry
1
6.3k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.3k
Other Decks in Programming
See All in Programming
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
320
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
400
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
620
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
240
OTP を自動で入力する裏技
megabitsenmzq
0
120
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
100
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
1.9k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
660
The free-lunch guide to idea circularity
hollycummins
0
270
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Believing is Seeing
oripsolob
1
86
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
390
Music & Morning Musume
bryan
47
7.1k
Accessibility Awareness
sabderemane
0
82
エンジニアに許された特別な時間の終わり
watany
106
240k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
We Have a Design System, Now What?
morganepeng
55
8k
Paper Plane (Part 1)
katiecoart
PRO
0
5.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
200
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
Transcript
Don’t Commit Your Secrets How to keep your application
secrets safe ! Nicholas Henry
Your secrets are everywhere • Passwords • Credentials • API
Keys • Database • Amazon S3 • Stripe • Mail Chimp Examples Synonyms
None
• Repository is shared among multiple parties • Increases your
risk for a security exploitation Why is this a bad practice?
• application is open source • application requires a high
level of governance e.g. financial, healthcare • application involves transient contractors e.g. agency • application located on multiple services e.g. CodeClimate When is this a bad practice?
When is this a bad practice? ALWAYS!
• Environment Variables • Configuration files Your options
Environment Variables # setting environment variable export STRIPE_API_KEY=07bfb7a5487dc6df" # retrieving
from Ruby ENV[‘STRIPE_API_KEY’] # =>07bfb7a5487dc6df
1 # config/application.yml" 2 " 3 production:" 4 secret_key_base: 33619eed953400c0e58695"
5 stripe_api_key: 07bfb7a5487dc6df Configuration File
• Rails 4.1 application • Deploy to Heroku Platform as
a Service (PaaS) • Configure Stripe with an API key Payment Gateway Demo
• configuration file / environments variables • config/secrets.yml" • Rails.application.secrets.your_api_key
Rails helps us keep secrets safe
None
Review 1 # config/secrets.yml" 2 " 3 production:" 4 secret_key_base:
<%= ENV[‘SECRET_KEY_BASE’] %>" 5 stripe_api_key: <%= ENV[‘STRIPE_API_KEY’] %> 1 2 3 heroku config:add STRIPE_API_KEY=montreal.rb-prod 1 # config/initializers/stripe.rb" 2 " 3 Stripe.api_key = " 4 Rails.application.secrets.stripe_api_key
• Don’t commit your secrets • If you have committed
your secrets: • setup your application to use environment variables or a configuration file • reset your API keys and other secrets Remember
nicholas@firsthand.ca @nicholasjhenry Nicholas Henry http://blog.firsthand.ca