<metaname="description" content="Web applications can be attacked by malicious actors in many ways. Learn about security measures on Full Stack Python.">
<p>Website security must be thought about while building every level of the web
stack. However, this section includes topics that deserve particular
treatment, such as cross-site scripting (XSS), SQL injection, cross-site
request forgery and usage of public-private keypairs.</p>
<h2>Security open source projects</h2>
<ul>
<li>
<p><ahref="http://www.bro.org/">Bro</a> is a network security and traffic monitor.</p>
</li>
<li>
<p><ahref="https://github.com/marshyski/quick-secure">quick NIX secure script</a> for
securing Linux distributions.</p>
</li>
</ul>
<h2>HTTPS resources</h2>
<ul>
<li>
<p><ahref="http://robertheaton.com/2014/03/27/how-does-https-actually-work/">How does HTTPS actually work?</a>
is a well-written overview of the protocol including certificates,
signatures, signing and related topics.</p>
</li>
<li>
<p>These
<ahref="https://18f.gsa.gov/2015/07/16/introduction-to-https-webinar/">introduction to HTTPS</a>
videos explain what HTTPS is and how to implement it.</p>
</li>
<li>
<p>This question asking <ahref="http://security.stackexchange.com/questions/5126/whats-the-difference-between-ssl-tls-and-https">what is the difference between TLS and SSL?</a>
explains that TLS is a newer version of SSL and should be used because
SSL through version 3.0 is insecure.</p>
</li>
<li>
<p>If you have wondered what all the SSL/TLS acronyms and settings mean,
read the
<ahref="https://wiki.mozilla.org/Security/Server_Side_TLS">Security/Server Side TLS guide</a>
which Mozilla uses to operationalize its servers.</p>
</li>
<li>
<p>If you're having users submit sensitive information to your site you need
to use SSL/TLS. Anything before TLS is now insecure. Check out this
<ahref="http://wingolog.org/archives/2014/10/17/ffs-ssl">handy guide</a> that goes
over some of the nuances of the subject.</p>
</li>
<li>
<p><ahref="https://hynek.me/talks/tls/">The Sorry State of SSL</a> details the
history and evolution of SSL/TLS. There are important differences between
the versions and Hynek explains why TLS should always be used. The
talk prompted work to improve Python's SSL in 2.7.9 based on the upgrades
in Python 3 outlined in
<ahref="https://developer.rackspace.com/blog/the-not-so-sorry-state-of-ssl-in-python/">The not-so-sorry state of SSL in Python</a>.</p>
<p><ahref="http://httpd.apache.org/docs/current/misc/security_tips.html">Security Tips from Apache</a></p>
</li>
<li>
<p><ahref="http://spenserj.com/blog/2013/07/15/securing-a-linux-server/">Securing a Linux Server</a></p>
</li>
<li>
<p>The EFF has a well written overview on
<ahref="https://www.eff.org/deeplinks/2014/11/what-makes-good-security-audit">what makes a good security audit</a>. It's broad but contains some of their behind the
scenes thinking on important considerations with security audits.</p>
</li>
<li>
<p>Ars Technica wrote posts on
<ahref="http://arstechnica.com/security/2013/02/securing-your-website-a-tough-job-but-someones-got-to-do-it/">securing your website</a>
along with <ahref="http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/">how to set up a safe and secure web server: part 1</a>
and <ahref="http://arstechnica.com/information-technology/2012/11/securing-your-web-server-with-ssltls/">part 2</a>
to explain HTTPS and SSL without much required pre-existing knowledge.</p>
</li>
<li>
<p><ahref="https://www.crypto101.io/">Crypto 101</a> is an introductory course on
cryptography for programmers.</p>
</li>
<li>
<p><ahref="http://getprismatic.com/story/1409447605839">An in-depth analysis of SSH attacks on Amazon EC2</a>
shows how important it is to secure your web servers, especially when they are
hosted in IP address ranges that are commonly scanned by malicious actors.</p>
</li>
<li>
<p><ahref="http://www.infoq.com/articles/cloud-security-auditing-challenges-and-emerging-approaches">Cloud Security Auditing: Challenges and Emerging Approaches</a>
is a high-level overview of some of security auditing problems that come
with cloud deployments.</p>
</li>
<li>
<p><ahref="https://www.digitalocean.com/community/tutorials/7-security-measures-to-protect-your-servers">7 Security Measures to Protect Your Servers</a>
provides a good overview of the fundamentals for how servers should be
configured for baseline security.</p>
</li>
</ul>
<h2>Web security learning checklist</h2>
<ol>
<li>
<p>Read and understand the major web application security flaws that are
commonly exploited by malicious actors. These include cross-site request
forgery (CSRF), cross-site scripting (XSS), SQL injection and session
hijacking. The
<ahref="https://www.owasp.org/index.php/Top_10_2013-Top_10">OWASP top 10 web application vulnerabilities list</a>
is a great place to get an overview of these topics.</p>
</li>
<li>
<p>Determine how the framework you've chosen mitigates these vulnerabilities.</p>
</li>
<li>
<p>Ensure your code implements the mitigation techniques for your framework. </p>
</li>
<li>
<p>Think like an attacker and actively work to break into your own system.
If you do not have enough experience to confidently break the security
consider hiring a known white hat attacker. Have her break the
application's security, report the easiest vulnerabilities to exploit in
your app and help implement protections against those weaknesses.</p>
</li>
<li>
<p>Recognize that no system is ever totally secure. However, the more popular
an application becomes the more attractive a target it is to attackers.
Reevaluate your web application security on a frequent basis.</p>
</li>
</ol>
<h3>What web development topic do you want to learn about next?</h3>
<ahref="http://www.deploypython.com/"><imgsrc="theme/img/sponsored/fsp-deployment-guide.png" alt="The Full Stack Python Guide to Deployments" width="100%"></a>
<pstyle="font-size: .8em; margin-top: 10px;">Searching for a complete, step-by-step deployment walkthrough? Learn more about <ahref="http://www.deploypython.com/">The Full Stack Python Guide to Deployments book</a>.
</p>
</div>
</div><divclass="panel panel-success">
<divclass="panel-heading">
<h3class="panel-head"><ahref="/table-of-contents.html" style="color: #fff;">Table of Contents</a></h3>
<ahref="/about-author.html" class="list-group-item smaller-item " style='font-family: "Helvetica Neue",sans-serif;'>About the Author</a>
</div>
</div>
<divclass="panel panel-success">
<divclass="panel-body">
<ahref="http://www.deploypython.com/"><imgsrc="theme/img/sponsored/fsp-deployment-guide.png" alt="The Full Stack Python Guide to Deployments" width="100%"></a>
<pstyle="font-size: .8em; margin-top: 10px;">Searching for a complete, step-by-step deployment walkthrough? Learn more about <ahref="http://www.deploypython.com/">The Full Stack Python Guide to Deployments book</a>.