Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Oops I Committed My Secret Key
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Philip James
July 20, 2016
Technology
430
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Oops I Committed My Secret Key
Lightning talk given at DjangoCon US 2016
Philip James
July 20, 2016
More Decks by Philip James
See All by Philip James
Frog and Toad Learn about Django Security - NBT6
phildini
0
39
The Elephant and the Serpent (PyLatam 2019)
phildini
0
78
Account Security for the Fashionable App Developer
phildini
1
79
All in the Timing: Side-Channel Attacks
phildini
0
92
Giving Thanks
phildini
0
54
All in the Timing: Side-Channel Attacks in Python
phildini
0
440
API-Driven Django
phildini
1
460
Type uWSGI; Press Enter; What Happens?
phildini
0
120
Type uWSGI; Press Enter; What Happens?
phildini
1
100
Other Decks in Technology
See All in Technology
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
290
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
130
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
自作バイナリを動かす「入口」8選
puhitaku
1
550
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
320
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
410
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
210
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
160
プロダクト価値を、 チームが使える判断軸に変える
vivion
0
130
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.2k
ログラスのマルチプロダクトを 支える認証基盤 〜テナントごとに異なる統制とどう向き合うか〜
dada4386
3
410
Deep Data Security 機能解説
oracle4engineer
PRO
2
720
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Skip the Path - Find Your Career Trail
mkilby
1
240
GraphQLとの向き合い方2022年版
quramy
50
15k
GitHub's CSS Performance
jonrohan
1033
470k
Mind Mapping
helmedeiros
1
390
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
350
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Producing Creativity
orderedlist
PRO
348
41k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Between Models and Reality
mayunak
4
490
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
Oops I Commi*ed My Secret Key Philip James @phildini h*ps:/
/www.wordfugue.com
$ django-admin.py startproject bestthingever $ git init $ git add
. $ git commit -m "Initial commit” $ git push origin master
None
Wait, have I?
YES. Signed Cookies Secure Sessions Password Reset Tokens
What do I do?
import os import warnings from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name):
""" Get the environment variable or return exception """ try: return os.environ[var_name] except KeyError: error_msg = "Set the %s env variable" % var_name if DEBUG: warnings.warn(error_msg) else: raise ImproperlyConfigured(error_msg)
SECRET_KEY = get_env_variable("SECRET_KEY")
How do I get a new key?
h*p:/ /www.miniwebtool.com/django-secret-key-generator/ $ python manage.py shell >>> from django.utils.crypto import
get_random_string >>> get_random_string(length=50)
What about my users?
OpOonal: No permanent key
Thanks. @phildini h*p:/ /bit.ly/secret-key Come back at 1:15PM for “Cat
on yer head”!