Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DjangoCon Europe 2012 Keynote: Make Me Make Good Choices

jesstess
June 06, 2012
200

DjangoCon Europe 2012 Keynote: Make Me Make Good Choices

jesstess

June 06, 2012
Tweet

Transcript

  1. Make me make good choices Education and best practices by

    default for novice web developers Jessica McKellar http://jesstess.com
  2. Visual Accessibility • 7-10% of Caucasian men have some form

    of color blindness (back of the envelope ~250 million men worldwide) • 2.6% of the global population is visually impaired (~285 million people) http://www.hhmi.org/senses/b130.html http://www.who.int/mediacentre/factsheets/fs28 2/en/index.html
  3. Accessibility Guidelines • World Wide Web Consortium's Web Accessibility Initiative

    http://www.w3.org/WAI/ • (USA) Section 508 Amendment to the Rehabilitation Act of 1973 http://www.section508.gov/
  4. Accessibility Guidelines • Alt-text on images • Accessible intra- and

    inter-page navigation • Audio and video accessibility: captions, transcriptions • Indicate important information with more than color alone • Accessible forms: labels, proximity of prompting text • Degrading JavaScript gracefully
  5. Accessibility Guidelines • Alt-text on images • Accessible intra- and

    inter-page navigation • Audio and video accessibility: captions, transcriptions • Indicate important information with more than color alone • Accessible forms: labels, proximity of prompting text • Degrading JavaScript gracefully
  6. Django Accessibility • Set a good example: audit ourselves •

    Websites • Conferences! • Accessibility tutorial? • Accessibility checklist? • Warnings on easily correctible issues? How can Django help people like me avoid, detect, and address accessibility issues?
  7. Cross site scripting (XSS) • “Improper or insufficient neutralization of

    user-controllable input before it is placed in output that is used as a web page that is served to other users.” • #4 on MITRE's “Top 25 Most Dangerous Software Errors”
  8. XSS protection in Django • Autoescaping enabled by default since

    2007 • https://docs.djangoproject.com/en/1.4/topics/se curity/#cross-site-scripting-xss-protection /path/? name=<script>alert('XSS');</script> /path/? name=&lt;script&gt;alert(&apos;XSS&apos ;);&lt;/script&gt;
  9. Cross site request forgery (CSRF) • “The web application does

    not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.” • #12 on MITRE's “Top 25 Most Dangerous Software Errors”
  10. CSRF protection in Django • Easy to enable • Thoughtful

    about testing • Flexible in how you opt in or out • Great documentation, even mentioned in tutorial (part 4) • https://docs.djangoproject.com/en/1.4/ref/contri b/csrf/ <form action="." method="post">{% csrf_token %}
  11. s

  12. CSRF protection in Django • Easy to enable, but I

    need to be told that I have to do this! <form action="." method="post">{% csrf_token %}
  13. SQL injection attacks • “Improper or insufficient neutralization of user-controllable

    input used in a SQL command.” • #1 on MITRE's “Top 25 Most Dangerous Software Errors”
  14. SQL injection attacks "SELECT * FROM items WHERE owner =

    '" + userName + "' AND itemname = '" + itemName + "'"; SELECT * FROM items WHERE owner = 'wiley' AND itemname = 'name'; DELETE FROM items; --'
  15. SQL injection protection in Django • “By using Django's querysets,

    the resulting SQL will be properly escaped by the underlying database driver.” • Remaining opportunities for injection: • Raw queries • Custom SQL
  16. Clickjacking • “Occurs when a malicious site tricks a user

    into clicking on a concealed element of another site which they have loaded in a hidden frame or iframe.”
  17. Clickjacking protection in Django • New in 1.4, awesome! •

    Easy to enable, but I need to be told that I have to do this!
  18. Leaky cookies • “If a browser connects initially via HTTP,

    which is the default for most browsers, it is possible for existing cookies to be leaked.”
  19. django-secure “Helping you remember to do the stupid little things

    to improve your Django site's security.” http://pypi.python.org/pypi/django-secure
  20. Django Security • Even more conservative defaults? • Security as

    part of the overview and tutorial? • Security tutorial? • Security checklist? • Sprint idea: public Django projects audit How can Django help people like me avoid, detect, and address security issues?
  21. django.contrib.auth.models.User • This is a HARD problem to address. Thank

    you django-developers for sticking with it! • Over 6 years of thoughtful discussion • https://groups.google.com/d/topic/django- developers/PLTW8Mon9QU/discussion • https://code.djangoproject.com/ticket/3011
  22. Django Internationalization • Set a good example: audit ourselves •

    Websites • Conferences! • Internationalization tutorial? • Internationalization checklist? How can Django help people like me avoid, detect, and address internationalization issues?
  23. Make me make good choices Education and best practices by

    default for novice web developers Jessica McKellar http://jesstess.com