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
19
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
23
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
120
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
12
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.3k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.4k
Other Decks in Programming
See All in Programming
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
3.6k
20260315 AWSなんもわからん🥲
chiilog
2
180
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
安いハードウェアでVulkan
fadis
1
850
Codex の「自走力」を高める
yorifuji
0
1.3k
おれのAgentic Coding 2026/03
tsukasagr
1
120
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
320
Coding as Prompting Since 2025
ragingwind
0
550
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
700
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
Featured
See All Featured
A better future with KSS
kneath
240
18k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Practical Orchestrator
shlominoach
191
11k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
87
Building a Scalable Design System with Sketch
lauravandoore
463
34k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
140
Done Done
chrislema
186
16k
Documentation Writing (for coders)
carmenintech
77
5.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Visualization
eitanlees
150
17k
Into the Great Unknown - MozCon
thekraken
40
2.3k
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