$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Don't Commit Your Secrets
Search
Nicholas Henry
June 17, 2014
Programming
0
6.9k
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
9
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
15
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
110
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
6
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
210
Building the Montreal Elixir Community
nicholasjhenry
0
54
How Elixir is Transforming My Mind
nicholasjhenry
1
6.1k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.1k
Other Decks in Programming
See All in Programming
AIコーディングエージェント(Manus)
kondai24
0
160
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
How Software Deployment tools have changed in the past 20 years
geshan
0
28k
スタートアップを支える技術戦略と組織づくり
pospome
8
16k
SwiftUIで本格音ゲー実装してみた
hypebeans
0
110
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
580
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
2.2k
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
12
7.1k
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.7k
Featured
See All Featured
Building an army of robots
kneath
306
46k
Balancing Empowerment & Direction
lara
5
790
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How GitHub (no longer) Works
holman
316
140k
Become a Pro
speakerdeck
PRO
31
5.7k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Building Applications with DynamoDB
mza
96
6.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
It's Worth the Effort
3n
187
29k
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