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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
40
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
40
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
130
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
29
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
250
Building the Montreal Elixir Community
nicholasjhenry
0
60
How Elixir is Transforming My Mind
nicholasjhenry
1
6.6k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.7k
Other Decks in Programming
See All in Programming
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.7k
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
160
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
380
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
520
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
510
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
220
今さら聞けない .NET CLI
htkym
0
190
React本体のコードリーディング
high_g_engineer
1
140
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.5k
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
460
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
510
Cloudflare is Agents
chimame
0
170
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Navigating Weather and Climate Data
rabernat
0
480
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
650
Become a Pro
speakerdeck
PRO
31
6.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
230
Six Lessons from altMBA
skipperchong
29
4.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Making the Leap to Tech Lead
cromwellryan
135
10k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
New Earth Scene 8
popppiees
3
2.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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