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
Oops I Committed My Secret Key
Search
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
37
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
53
All in the Timing: Side-Channel Attacks in Python
phildini
0
430
API-Driven Django
phildini
1
450
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
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
9
1.7k
Point Cloud as a Foreign Language for Multi-modal Large Language Model
takmin
0
350
APIセキュリティを組織で実現するには~注力する点と設計・実装に入れたい対策~
riiimparm
2
830
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
130
Bet AI Day 2026丨AIを「使う」から、AIが「働く」へ ― LayerXが進める「組織AI」の社会実装
layerx
PRO
2
400
When Token Pruning is Worse than Random: Understanding Visual Token Information in VLLMs
sansantech
PRO
0
210
みてねにおけるAI-DLC導入活動とAIドリブン開発の現在地/JAWS-UG AI-DLC #2
isaoshimizu
2
320
アクセスキー流出時の対応で再認識した攻撃側と防御側の非対称性について
kazzpapa3
1
490
Digital Credentials API × OpenID4VP ブラウザ完結型本人確認の実装知見(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
400
1.5時間を無駄にして学んだwsl2におけるaptとsnapの選択と仕組み
yosaka0123
0
480
AI時代の「OAuth認証」にどう物申すか?(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
410
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
100
Featured
See All Featured
Between Models and Reality
mayunak
4
430
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
310
Tell your own story through comics
letsgokoyo
1
1.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
The agentic SEO stack - context over prompts
schlessera
0
880
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
500
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
800
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
390
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
430
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”!