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
Nicholas Henry
June 17, 2014
Programming
7.4k
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
38
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
37
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
130
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
24
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
240
Building the Montreal Elixir Community
nicholasjhenry
0
59
How Elixir is Transforming My Mind
nicholasjhenry
1
6.6k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.6k
Other Decks in Programming
See All in Programming
自作OSでスライド発表する
uyuki234
1
3.9k
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
2.8k
AIエージェントで 変わるAndroid開発環境
takahirom
2
690
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
180
symfony/aiとlaravel/boost
77web
0
140
フィードバックで育てるAI開発
kotaminato
1
120
えっ!!コードを読まずに開発を!?
hananouchi
0
230
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
600
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
150
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
330
AIが無かった頃の素敵な出会いの話
codmoninc
1
160
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
180
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
640
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
Building the Perfect Custom Keyboard
takai
2
820
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
How to build a perfect <img>
jonoalderson
1
5.8k
ラッコキーワード サービス紹介資料
rakko
1
4M
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
610
Navigating Weather and Climate Data
rabernat
0
390
Documentation Writing (for coders)
carmenintech
77
5.4k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
180
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