Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Don't Commit Your Secrets
Search
Nicholas Henry
June 17, 2014
Programming
7.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Don't Commit Your Secrets
How to keep your application secrets safe
Nicholas Henry
June 17, 2014
More Decks by Nicholas Henry
See All by Nicholas Henry
Mise en Place for Ecto
nicholasjhenry
0
51
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
50
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
140
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
39
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
260
Building the Montreal Elixir Community
nicholasjhenry
0
64
How Elixir is Transforming My Mind
nicholasjhenry
1
6.8k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.9k
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
320
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
290
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
200
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
340
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
590
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
790
オーケストレーション記述言語 Katari
yukikurage
0
140
Seven New Principles of Software Engineering
yegor256
0
160
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
Verilogで学ぶCPU自作入門
uyuki234
8
4.2k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
Featured
See All Featured
Being A Developer After 40
akosma
92
590k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Designing for Timeless Needs
cassininazir
1
530
A better future with KSS
kneath
240
18k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
560
Producing Creativity
orderedlist
PRO
348
41k
Facilitating Awesome Meetings
lara
57
7.2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
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