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.5k
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
44
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
45
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
140
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
33
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
250
Building the Montreal Elixir Community
nicholasjhenry
0
62
How Elixir is Transforming My Mind
nicholasjhenry
1
6.7k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.7k
Other Decks in Programming
See All in Programming
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
54
36k
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
業務時間外もAIに働いてもらう話
colorful12
3
10k
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
120
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
430
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
860
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
1
490
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
160
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
320
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
820
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Discover your Explorer Soul
emna__ayadi
2
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
GraphQLとの向き合い方2022年版
quramy
50
15k
It's Worth the Effort
3n
188
29k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to Talk to Developers About Accessibility
jct
2
540
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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