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
0
7k
Don't Commit Your Secrets
How to keep your application secrets safe
Nicholas Henry
June 17, 2014
Tweet
Share
More Decks by Nicholas Henry
See All by Nicholas Henry
Mise en Place for Ecto
nicholasjhenry
0
10
Beyond Mocks - Messing with Our Preconceptions of Testing
nicholasjhenry
0
16
Preventing Brain Freeze: Onboarding New Developers with Living Documentation
nicholasjhenry
0
110
The Upside Down Dimension of Elixir - ElixirConf
nicholasjhenry
0
8
The Upside Down Dimension of Elixir - An introduction to metaprogramming
nicholasjhenry
1
220
Building the Montreal Elixir Community
nicholasjhenry
0
54
How Elixir is Transforming My Mind
nicholasjhenry
1
6.2k
Modeling on the Right Side of the Brain
nicholasjhenry
1
9.3k
Other Decks in Programming
See All in Programming
CSC307 Lecture 02
javiergs
PRO
1
770
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
190
高速開発のためのコード整理術
sutetotanuki
1
390
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Fragmented Architectures
denyspoltorak
0
150
今から始めるClaude Code超入門
448jp
8
8.6k
Oxlintはいいぞ
yug1224
5
1.3k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.4k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
260
AI時代の認知負荷との向き合い方
optfit
0
150
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
450
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Everyday Curiosity
cassininazir
0
130
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
We Have a Design System, Now What?
morganepeng
54
8k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
HDC tutorial
michielstock
1
370
Skip the Path - Find Your Career Trail
mkilby
0
53
Design in an AI World
tapps
0
140
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