<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ben Hudson on Medium]]></title>
        <description><![CDATA[Stories by Ben Hudson on Medium]]></description>
        <link>https://medium.com/@bahudso?source=rss-be224e05a61d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VwW1cOJUKVrBT5AT.jpg</url>
            <title>Stories by Ben Hudson on Medium</title>
            <link>https://medium.com/@bahudso?source=rss-be224e05a61d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:20:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bahudso/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ISP Accountability: Tracking Throttling & Blocking]]></title>
            <link>https://medium.com/@bahudso/tracking-throttling-blocking-8bde5d8e7515?source=rss-be224e05a61d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bde5d8e7515</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[net-neutrality]]></category>
            <category><![CDATA[accountability]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Ben Hudson]]></dc:creator>
            <pubDate>Sat, 13 Jan 2018 22:24:47 GMT</pubDate>
            <atom:updated>2018-01-13T22:36:00.123Z</atom:updated>
            <content:encoded><![CDATA[<h4>Ending Net Neutrality means we are now the ones that have to hold ISPs responsible for abuse and anticompetitive behavior</h4><p>Now that Net Neutrality rules have been overturned by the FCC it is upon us, the consumers, to monitor and track abuse from our Internet Service Providers (ISPs). Currently there are not many tools for tracking throttling, blocking or abuse by providers and the tools that do exist require some tech savviness.</p><p>I have been recording statistics on my current Internet Service Provider for a while now. My method is pretty simple. I use <a href="https://github.com/sivel/speedtest-cli">a command-line tool for tracking basic bandwidth</a> and I write the output to a CSV files. I also have a simple script for performing a ping for a few different pre-selected sites. These all run many times per day allowing me to keep pretty good tabs on my available bandwidth throughout each month and if any sites seem to be loading noticeably slower over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*la3bpo3IPgdxVfMPyCqGPw.png" /><figcaption>Download and Upload results from speedtest-cli performed every hour between December 12th, 2017 and January 13th</figcaption></figure><p>My simple methods are not extremely accurate and do not account for the many complexities that go into calculating response times. This is why we need to come up with better tools in order to be able to reliably track throttling by ISPs.</p><p>Firstly we all need to start such tracking in order to ensure fair service from our ISPs. Overall we need to develop better tools for monitoring our networks for abusive behavior from our providers. This is key to ensuring that the lack of Net Neutrality rules have minimal affects on the Internet marketplace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PCaLr5hfFqIYmR3e_GsiA.png" /><figcaption><a href="https://wiki.vuze.com/w/Bad_ISPs#United_States_of_America">https://wiki.vuze.com/w/Bad_ISPs#United_States_of_America</a></figcaption></figure><p><strong>Have you noticed anti-competitive behavior from ISPs? Do you have any methods or ideas for tracking your available bandwidth over time in order to hold your ISP accountable?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bde5d8e7515" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Save the Internet]]></title>
            <link>https://medium.com/@bahudso/save-the-internet-26862721fd82?source=rss-be224e05a61d------2</link>
            <guid isPermaLink="false">https://medium.com/p/26862721fd82</guid>
            <category><![CDATA[government]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[net-neutrality]]></category>
            <category><![CDATA[fcc]]></category>
            <category><![CDATA[free-speech]]></category>
            <dc:creator><![CDATA[Ben Hudson]]></dc:creator>
            <pubDate>Tue, 12 Dec 2017 14:25:37 GMT</pubDate>
            <atom:updated>2017-12-12T16:42:12.046Z</atom:updated>
            <content:encoded><![CDATA[<h4>Net Neutrality protects online consumers and web service providers from anti-competitive practices of ISPs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*tiyuEVhzv2yfI7g78RxkYQ.png" /></figure><p>Net Neutrality is <strong>not</strong> something that has been part of the Internet since it’s inception. In 2014 the public was introduced to the first major issue bringing up the idea of Net Neutrality. Verizon and Comcast began heavily throttling Netflix users’ traffic which caused massive backlash against the ISP giants.</p><p>FCC’s current website states:</p><blockquote>“Two years ago, the FCC abruptly changed course. On a party-line vote, the FCC applied 1930s-era utility-style regulation (“Title II”) to the Internet. That decision appears to have put at risk online investment and innovation, threatening the very open Internet it purported to preserve.”</blockquote><p>The problem with this view on Net Neutrality is that it assumes the victims are the Internet Service Providers. Major ISPs, during which time Net Neutrality was law, told their stakeholders that <a href="https://arstechnica.com/information-technology/2017/05/title-ii-hasnt-hurt-network-investment-according-to-the-isps-themselves/">investment in their networks was not being affected by the new rules</a>[<a href="https://www.freepress.net/sites/default/files/resources/internet-access-and-online-video-markets-are-thriving-in-title-II-era.pdf">²</a>].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BzQSufiJ7sg1UVS4VU4-w.png" /><figcaption>Business Insider — <a href="https://goo.gl/Y8wK8x">https://goo.gl/Y8wK8x</a></figcaption></figure><p>Why did the FCC change course two years ago, changing ISP classification under Title II? It was due to the anti-competitive throttling of online services by major ISPs in 2014 and the (still ongoing) consolidation of media companies into ISP parent companies.</p><p>The FCC’s view of Net Neutrality also relies on a fundamental <a href="https://www.eff.org/deeplinks/2017/12/fcc-still-doesnt-know-how-internet-works">misunderstanding of how the Internet works</a>. They have met plenty of times with Internet Providers but have not listened to Computer Scientists, small ISPs, online business owners, or those that understand the technical workings of the Internet.</p><p>The current FCC has made it clear that they don’t believe Net Neutrality principles are good for ISPs, with no hard evidence. With the current board it’s seemingly inevitable that Net Neutrality rules will soon be ended across party lines. Ajit Pai, FCC Commissioner, has made it obvious that he does not care what the public or small businesses think about his stance on Net Neutrality.</p><p>Ajit Pai plans to override Net Neutrality under Title II and let Congress pass legislation that he says will promote the “Open Internet”. The problem is that <strong>Congress has received over $100 million in donations from the ISP industry</strong>[<a href="https://www.theverge.com/2017/12/11/16746230/net-neutrality-fcc-isp-congress-campaign-contribution">¹</a>]. Congress is incentivized to create legislation and pass a bill that is heavily influenced (if not written) by the very industry from which it is supposedly defending consumers.</p><p>The true victims of throttling, paid prioritization and content blocking are the online consumers and web service providers. ISPs are the gatekeepers to the largest collection of human information in the world. Allowing them to throttle and prioritize traffic drastically affects the online marketplace both for consumers and producers in the internet ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*LklzpDPucFg_Xxe6SViQRA.png" /><figcaption><a href="https://goo.gl/Y8TqRy">“</a>About 54.5 million households had access to at least two wired providers offering 25Mbps speeds, and 6.9 million had access to three such providers. The data goes up to June 2016.” — Ars Technica <a href="https://goo.gl/Y8TqRy">https://goo.gl/Y8TqRy</a></figcaption></figure><p>The lack of competition for low latency broadband in the US does not provide customers with adequate options and thus allows ISPs to abuse their power as service providers. This low amount of competition allows ISPs to operate as monopolies or duopolies in nearly every state. Without Network Neutrality, ISPs have the complete power to dictate the online marketplace that they provide their customers. This can be horrible news for new web service providers looking to compete with web services owned by the network operators.</p><p><strong>Allowing ISPs the power to throttle and prioritize traffic could displace millions of potential and already existing online jobs and businesses.</strong></p><p>The future for networking technologies is bright (Fiber, 5G, etc). But the near future for low latency broadband in the US is dark and could have lasting affects on our economy and our democracy. Innovation online is hampered by anti-competitive throttling/paid prioritization and Net Neutrality rules protect the online marketplace from this behavior.</p><h3>The Internet is an extremely valuable tool for human innovation and we need to protect it with rules preventing blocking, throttling and paid prioritization.</h3><ul><li><a href="https://www.battleforthenet.com/">Were your lawmakers bought by Big Cable?</a></li><li><a href="https://www.savetheinternet.com/net-neutrality-what-you-need-know-now">Net Neutrality: What You Need to Know Now</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26862721fd82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Net Neutrality’s Importance Today]]></title>
            <link>https://medium.com/voices/net-neutralitys-importance-today-ec05c074edbc?source=rss-be224e05a61d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec05c074edbc</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[activism]]></category>
            <category><![CDATA[net-neutrality]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[fcc]]></category>
            <dc:creator><![CDATA[Ben Hudson]]></dc:creator>
            <pubDate>Wed, 12 Jul 2017 12:31:21 GMT</pubDate>
            <atom:updated>2017-07-18T10:22:01.169Z</atom:updated>
            <content:encoded><![CDATA[<h4>While ISP competition is low, Net Neutrality rules are crucial to preserving innovation/competition for web services and content providers</h4><p>The idea of Net Neutrality came about in 2003 to describe how Internet Service Providers (ISPs) should treat all data being exchanged by customers on their network equally, and not discriminate between different types of traffic or service providers. ISPs have not upheld these rules in the past, <a href="https://arstechnica.com/uncategorized/2007/10/evidence-mounts-that-comcast-is-targeting-bittorrent-traffic/">blocking certain protocols</a> and throttling applications like Netflix.</p><p>The FCC made it’s <a href="http://scholarship.law.berkeley.edu/cgi/viewcontent.cgi?article=1788&amp;context=btlj">first Internet management decision</a> in August of 2008, ruling that Comcast had illegally inhibited users from using file-sharing applications by throttling their bandwidth. Then, in 2010, the FCC approved the <a href="https://en.wikipedia.org/wiki/FCC_Open_Internet_Order_2010">FCC Open Internet Order</a> which banned service providers from blocking competitors. <a href="http://www.washingtonpost.com/wp-dyn/content/article/2010/12/21/AR2010122106110.html">Republicans soon announced a plan to reverse the rule</a> but this ruling was not overturned until the DC Court Ruling in <a href="https://en.wikipedia.org/wiki/Verizon_Communications_Inc._v._Federal_Communications_Commission_(2014)">Verizon v FCC</a> — ruling that the FCC did not have the authority under the current “common carrier” classification to enforce these open internet rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Itxty-is2YFxPMlpxbxy_w.png" /></figure><p>In 2014, plans to reclassify ISPs as “Title II” common carriers came about and by 2015 Tom Wheeler and the FCC had cemented (for the time being) <a href="https://www.nytimes.com/2015/03/13/technology/fcc-releases-net-neutrality-rules.html">Net Neutrality rules</a>.</p><p>And that brings us to 2017, with the Trump administration appointing <a href="https://en.wikipedia.org/wiki/Ajit_Varadaraj_Pai">Ajit Pai</a> as chairman of the FCC. Ajit, along with the Republican majority in congress, want to see the Net Neutrality rules scrapped because they see the rules as government overreach that is negatively affecting ISPs.</p><h3>Importance Today</h3><p><strong>Net Neutrality is important today because we still don’t have good selection when choosing a high-speed ISP.</strong> <a href="https://arstechnica.com/information-technology/2017/06/50-million-us-homes-have-only-one-25mbps-internet-provider-or-none-at-all/">Many people in the US only have access to one high speed provider, if that</a>. This means that if an ISP chooses to block or filter their customer’s data, their customers have little choice for switching to a different provider.</p><p>In recent years ISPs have been <a href="https://en.wikipedia.org/wiki/Charter_Communications#2014.E2.80.932017:_Acquisition_of_Time_Warner_Cable_and_Bright_House">consolidating</a> and <a href="https://www.cbinsights.com/blog/top-digital-media-companies-mergers-acquisitions-timeline/">acquiring content/media companies</a>. It’s easy to see that these ISPs, with their monopoly/duopoly, have a lot of power over consumers as they obtain content that they can prioritize on their network — while blocking/throttling competing providers. ISPs having prioritized content can sometimes benefit consumers (like with <a href="https://support.t-mobile.com/docs/DOC-10969">T-Mobile &amp; “Music Freedom”</a>) but ultimately this can lead to less access to content and closed/filtered networks.</p><h3>Possible Futures</h3><p>I see two possible futures for the Internet over the coming years; one a bright future and the other dystopian.</p><ul><li><strong>The best chance for preserving competition for web services and maximizing consumer access to these services/content is to preserve the current standing Open Internet rules.</strong></li><li>If the current rules are overturned we could very well see some drastic changes in the coming years of how we access content and what content we have access to. In a future without Net Neutrality rules, ISPs could limit things like which gaming consoles work on their networks or which streaming applications/websites customers have access to. Imagine Charter only allowing traffic for Xbox’s and permitting media streaming only through their Spectrum service(No Netflix or Hulu) unless customers pay an extra fee. <strong>We could also see less developers and independent software engineers creating applications because of the un-level playing field when competing against the media/web services of ISPs.</strong></li></ul><p><a href="https://gizmodo.com/congress-just-gave-internet-providers-the-green-light-t-1793698939">Congress passing legislation allowing ISPs to sell customer information</a> and calls from top Republicans to end current Net Neutrality rules are not good signs. The communications industry is one of the largest lobbying groups in the US and they want to see Net Neutrality done away with even tho it has <a href="https://arstechnica.com/information-technology/2017/05/title-ii-hasnt-hurt-network-investment-according-to-the-isps-themselves/">not hurt their investment in their networks</a>.</p><p>But, as it tends to do, (communication) <strong>technology is evolving</strong>. We are seeing more big names stepping into the ISP space (<a href="https://fiber.google.com/about/">Google Fiber</a>) and new technologies being introduction (<a href="https://www.fcc.gov/5G">5G</a>). This is a good sign for ISP competition in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*npIBV1f2RsVFRf5rfMarzw.jpeg" /></figure><p><strong>In the short term, while ISP competition is low, I believe that Net Neutrality rules are necessary to preserve the maximum amount of innovation that comes from the most advanced communication system in the world (the Internet)</strong>. Competition for web services is higher when all traffic on a network is treated equally. Net Neutrality is <strong>not</strong> about “regulating the Internet”, it is about protecting consumers and their online rights through equality and transparency as well as protecting web application developers by maintaining a low barrier to entry for new competing web services.</p><p>It is important that our elected representatives understand what they are voting for — and not just vote for lobbyists. Please take a minute to <a href="https://act.freepress.net/call/internet_congress_nn/">call your representative</a>, sign a <a href="https://act.credoaction.com/sign/Pai-netneutrality">petition</a>(<a href="https://www.savetheinternet.com/sti-home">petition #2</a>), and/or <a href="https://advocacy.mozilla.org/en-US/net-neutrality-comments">leave a comment with the FCC</a>.</p><p>If you want to help to preserve our rights online and to protect an Open Internet, please join me in donating to the <a href="https://supporters.eff.org/donate/summer-security-camp-dd">Electronic Frontier Foundation</a>.</p><p>Also check out <a href="https://www.fightforthefuture.org/">Fight for the Future</a> and <a href="https://www.savetheinternet.com/">Save the Internet</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec05c074edbc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voices/net-neutralitys-importance-today-ec05c074edbc">Net Neutrality’s Importance Today</a> was originally published in <a href="https://medium.com/voices">Voices of the Revolution</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Security in the Ruby on Rails Framework]]></title>
            <link>https://medium.com/@bahudso/web-security-in-the-ruby-on-rails-framework-c6463306b54?source=rss-be224e05a61d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6463306b54</guid>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Ben Hudson]]></dc:creator>
            <pubDate>Tue, 15 Mar 2016 15:46:07 GMT</pubDate>
            <atom:updated>2016-03-15T15:47:15.361Z</atom:updated>
            <content:encoded><![CDATA[<h4>An outline of common web application attacks, how Ruby on Rails addresses them, and how to utilize static analysis tools for continuous security auditing</h4><h3>Abstract</h3><p>With the popularity of open source frameworks on the rise within web development, it is important to be aware of address the inherent security vulnerabilities that exist in web applications and address them within frameworks accordingly. Most frameworks, including <a href="http://rubyonrails.org/">Ruby on Rails</a>, address the most common attacks to which web applications are vulnerable. This paper outlines common web application attacks and how Ruby on Rails addresses them, as well as how to setup continuous security auditing on projects.</p><h3>1 Introduction</h3><p>Ruby on Rails is a popular open source framework for building ambitious web applications. Rails provides many advantages to web developers, including default protections against some of the most common web application vulnerabilities. Many production Rails applications running today are not up to date with the latest version of the framework. These applications often have security vulnerabilities that have been patched in newer versions. Staying up to date on security vulnerabilities and patching them is extremely important when securing any web application.</p><p>Since Rails implements many protective efforts against web application vulnerabilities, security is often overlooked. It is important to know the limitations of the framework and what security considerations are made, as well as have an understanding of web application attacks.</p><h3>2 Background</h3><p>This section covers common web application threats and how Rails protects against them.</p><h3>2.1 Web Application Threats</h3><p>All applications running on servers and delivering content to a web browser have common threats that must be considered. The following sections outline some of those possible threats and how attacks can occur.</p><h3>2.1.1 Denial of Service (DOS)</h3><p>A denial of service attack is when a production server is unable to fulfill client requests due to an overload of incoming requests. This usually happens in the form of a Distributed Denial of Service attack where a cluster of computers (often referred to as a “botnet”) target a server and issue numerous requests to block other legitimate users access to the system. This type of attack was experienced in <a href="http://www.zdnet.com/article/sony-playstation-network-struck-by-ddos-attack-bomb-threat-grounds-executive/">2014 by Sony against their PlayStation Network</a>, rendering their network inaccessible for hours.</p><h3>2.1.2 Injection</h3><p>Injection attacks are a class of threats that attempt to introduce malicious code or parameters into a web application in order to execute unauthorized instructions. These types of attacks utilize the vulnerability in trusting user input without proper string sanitization or filtering. Common injection attacks include SQL Injection and Cross-site Scripting (XSS). SQL Injection occurs when malicious SQL code is executed by the application. Web applications are vulnerable to this type of attack when user input is used to build database operations and not properly sanitized. XSS attacks happen in a similar manner except they seek to inject malicious code into the web application that will later be displayed and executed by other users. This code will attempt to communicate with other remote applications (hence “cross-site”) that the user has authenticated with and steal data or execute operations without the victim’s knowledge.</p><h3>2.1.3 Hijacking</h3><p>Hijacking can occur in two different ways: a user session can be hijacked or a user account on the web application could be stolen. Session hijacking can occur if an attacker gains access to the cookie where the user’s session data is being stored. If the attacker steals this cookie and session data, they can utilize it to gain access to the web application by posing as the victim. A user account on a web application can be hijacked in different ways, but the most common is a man-in-the-middle attack. In this type of attack, the malicious user captures network traffic and steals account information to gain access and hijack a user’s account.</p><h3>2.1.4 Cross-Site Request Forgery (CSRF)</h3><p>Cross-Site Request Forgery is a type of attack in which malicious code is executed by an unknowing user, accessing other services with that user’s information. This attack exploits the trust that the server has in the user’s web browser. CSRF attacks perform state-changing requests by secretly executing and authenticating without the user’s knowledge. This type of attack usually is executed by use of social engineering or when a user unknowingly visits a malicious website.</p><h3>2.2 Rails Security Considerations</h3><p>The Ruby on Rails framework provides many protections by default, but as the<a href="http://guides.rubyonrails.org/security.html">Rails Security Guide</a> notes, “there is no such thing as plug-n-play security”. Rails has many helpers to make securing web applications easier, but it is up to the developer to understand the different types of attacks that can occur and to implement protections against them.</p><h3>3 Securing Rails Applications</h3><h3>3.1 Vulnerabilities</h3><p>Various security patches have been added to the Rails framework throughout development. Many of these patches address significant security vulnerabilities. The following sections discuss some of these vulnerabilities and how they can be addressed.</p><h3>3.1.1 Denial of Service (DOS)</h3><p>The best prevention against DOS attacks is to utilize a proxy or <a href="https://github.com/kickstarter/rack-attack">middleware</a> (such as RackAttack) to filter out repetitive requests and thwart the attack before requests reach the application. There was a <a href="https://groups.google.com/forum/#!topic/ruby-security-ann/o0Dsdk2WrQ0">DOS vulnerability in the Rails ActiveRecord</a> that has been patched in versions 3.2.13, 3.1.12, and 2.3.18.</p><h3>3.1.2 Injection</h3><p>SQL Injection, the most common type of injection attack, is easily mitigated by Rails methods that handle SQL. Methods such as <a href="http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-where"><em>.where()</em></a> and <a href="http://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-find"><em>.find()</em></a> escape common characters and line breaks that are used in SQL injection attacks. Cross-Site Scripting (XSS) attacks are addressed in Rails by use of similar helper methods. These methods filter out malicious code through sanitization and should be used on user input as well as output of the application. Examples of these methods include <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize"><em>sanitize()</em></a> and <a href="http://api.rubyonrails.org/classes/ERB/Util.html#method-c-html_escape"><em>html_escape()</em></a>.</p><h3>3.1.3 Hijacking</h3><p>Session hijacking requires the attacker to have access to the session cookie that Rails uses to store session information for a client. Rails has a few implemented defenses against session hijacking including key encrypted sessions and session expiry. Expiring sessions means that if a session is compromised, when it expires the attacker will no longer have access and must completely reauthenticate with the application. Man-in-the-middle style attacks pose a threat to Rails applications in that data is often transferred in plaintext between the client and server, putting users at risk of hijacking. This can be addressed by implementing SSL and forcing its use in Rails versions 3.1 and later.</p><h3>3.1.4 Cross-Site Request Forgery (CSRF)</h3><p>Protecting against CSRF requires an understanding of when to use <em>POST</em> vs <em>GET</em>requests. <em>GET</em> requests should be used for queries and read-only methods of interacting with the web application, whereas <em>POST</em> is to be used for changing data within the web application. To verify <em>POST</em> requests came from the correct application, Rails utilizes a shared token which is sent with the request and verified by the server. This token verification protects against CSRF as long as there are no <em>GET</em> methods that alter application data.</p><h3>3.2 Continuous Security Testing</h3><p>Security auditing can be performed on Rails applications statically by parsing the source code for security vulnerabilities. These analysis tools provide developers with the ability to run tests on their applications before each release in order to make sure that they have not introduced any common vulnerabilities. Static analysis tools can be extremely beneficial and efficient for quickly verifying the security of a Rails application. The following sections review some common tools for security auditing Ruby on Rails applications.</p><h3>3.2.1 Brakeman</h3><p>“Brakeman is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities” 2. Developers can use Brakeman to verify the security of their Rails application by running tests and scanning for common vulnerabilities. Output from a brakeman security audit provides a summary of what tests it performed and a list of security vulnerabilities that it has found. This tool is ideal for running before deploying a new release of a Rails application to verify that no new vulnerabilities have been introduced.</p><h3>3.2.2 BeEF</h3><p>The Browser Exploitation Framework (BeEF) is a tool for penetration testing against browsers and can be used to test web client application vulnerabilities. This tool primarily uses browser vulnerabilities to audit a target application. BeEF is not a tool explicitly for Rails testing like Brakeman, but it can be very useful in getting a better idea of possible threats to a web application.</p><h3>3.2.3 RuboCop</h3><p>RuboCop is a static code analyzer for Ruby. This tool utilizes the <a href="https://github.com/bbatsov/ruby-style-guide">Ruby Style Guide</a>to enforce good syntax and programming methodologies. Although this is not a security-focused tool, it can provide insight into bad programming techniques that may be insecure and suggest fixes.</p><h3>3.2.4 Hakiri</h3><p>Hakiri is a static analysis tool that provides security auditing with Github integration. This tool will scan for 32 different Rails vulnerabilities upon every new push to source control. Hakiri also provides many other tools for testing the security of a Rails application, including gem security audits, server stack audits, and tests for newly published Rails vulnerabilities.</p><h3>3.2.5 Safe-ERB</h3><p>Safe-ERB is a static analysis tool for verifying that Rails output is properly escaped before being loaded in a HTML template. Its primary purpose is to help prevent XSS vulnerabilities within Rails applications.</p><h3>4 Rails Data Confidentiality</h3><p>Rails transmits requests in plaintext by default, just as most common web applications do. This must be taken into consideration when handling transactions containing confidential information. This section outlines how to protect data confidentiality within a Rails application.</p><h3>4.1 Logging</h3><p>Logs can be extremely useful for debugging and security auditing, but they do pose a threat to data confidentiality. If an attacker gains access to the server on which an application is being run, that attacker may be able to steal log files that contain private information. In situations where an application is handling confidential information, it is important to make sure that no private data is being output into logs.</p><h3>4.2 Data Encryption</h3><p>The best way to ensure data confidentiality is to implement encryption. Encrypting sensitive data or even entire transactions can provide protection against interception of sensitive data. It is common practice to save passwords and other sensitive information as encrypted hashes in a database. This ensures that even if an attacker gains access, they will not be able to decrypt the sensitive information.</p><p>SSL is the best method for ensuring data confidentiality when performing transactions, encrypting the entire request from client to server. This is the best way to protect against a man-in-the-middle style attack, as the attacker would only be able to intercept encrypted data rather than plaintext.</p><h3>5 Conclusion</h3><p>Ruby on Rails provides protections against many of the most common types of attacks that web applications experience. Security in a Rails application still requires attention in order to fully protect against attacks, and it is not enough to simply trust that the default security considerations will be enough. It is extremely important for a Rails developer to understand the various types of possible web application attacks and implement proper protections on top of the defaults provided by the framework. Utilizing good security practices and static analysis tools, a Rails developer can be confident in the security of an application upon each new release.</p><h3>References</h3><ol><li>“BeEF.” GitHub. Beefproject. &lt;<a href="https://github.com/beefproject/beef">https://github.com/beefproject/beef</a>&gt;.</li><li>“Brakeman.” GitHub. Presidentbeef. &lt;<a href="https://github.com/presidentbeef/brakeman">https://github.com/presidentbeef/brakeman</a>&gt;.</li><li>“Cross-Site Request Forgery (CSRF).” OWASP. &lt;<a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)">https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)</a>&gt;.</li><li>“Rack-attack.” GitHub. Kickstarter. &lt;<a href="https://github.com/kickstarter/rack-attack">https://github.com/kickstarter/rack-attack</a>&gt;.</li><li>“RuboCop.” GitHub. bbatsov. &lt;<a href="https://github.com/bbatsov/rubocop">https://github.com/bbatsov/rubocop</a>&gt;.</li><li>“Ruby on Rails Security Guide.” Ruby on Rails Guides. &lt;<a href="http://guides.rubyonrails.org/security.html">http://guides.rubyonrails.org/security.html</a>&gt;.</li><li>“Ruby Style Guide.” GitHub. bbatsov. &lt;<a href="https://github.com/bbatsov/ruby-style-guide">https://github.com/bbatsov/ruby-style-guide</a>&gt;.</li><li>“Symbol DoS Vulnerability in Active Record.” Google Groups — Ruby Security. 2015. &lt;<a href="https://groups.google.com/forum/#!topic/ruby-security-ann/o0Dsdk2WrQ0">https://groups.google.com/forum/#!topic/ruby-security-ann/o0Dsdk2WrQ0</a>&gt;.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6463306b54" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>