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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nicholas Henry
June 17, 2014
Programming
7.2k
0
Share
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
22
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
25
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
120
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
14
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
230
Building the Montreal Elixir Community
nicholasjhenry
0
55
How Elixir is Transforming My Mind
nicholasjhenry
1
6.4k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.4k
Other Decks in Programming
See All in Programming
AI-DLC Deep Dive
yuukiyo
9
4.3k
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
190
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
260
GitHubCopilotCLIをはじめよう.pdf
htkym
0
190
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
210
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
250
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
130
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
Programming with a DJ Controller — not vibe coding
m_seki
3
110
Coding as Prompting Since 2025
ragingwind
0
840
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
220
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
The Curious Case for Waylosing
cassininazir
0
300
Prompt Engineering for Job Search
mfonobong
0
270
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
How GitHub (no longer) Works
holman
316
150k
Music & Morning Musume
bryan
47
7.2k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
520
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