
<rss version="2.0" 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" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Tue, 14 Apr 2026 23:03:48 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Get better visibility for the WAF with payload logging]]></title>
            <link>https://blog.cloudflare.com/waf-payload-logging/</link>
            <pubDate>Mon, 24 Nov 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ The WAF provides ways for our customers to gain insight into why it takes certain actions. The more granular and precise the insight, the more reproducible and understandable it is. Revamped payload logging is one such method.  ]]></description>
            <content:encoded><![CDATA[ <p>As the surface area for attacks on the web increases, Cloudflare’s <a href="https://www.cloudflare.com/application-services/products/waf/"><u>Web Application Firewall (WAF)</u></a>  provides a myriad of solutions to mitigate these attacks. This is great for our customers, but the cardinality in the workloads of the millions of requests we service means that generating false positives is inevitable. This means that the default configuration we have for our customers has to be fine-tuned. </p><p>Fine-tuning isn’t an opaque process: customers have to get some data points and then decide what works for them. This post explains the technologies we offer to enable customers to see why the WAF takes certain actions — and the improvements that have been made to reduce noise and increase signal.</p>
    <div>
      <h2>The Log action is great — can we do more?</h2>
      <a href="#the-log-action-is-great-can-we-do-more">
        
      </a>
    </div>
    <p>Cloudflare’s <a href="https://www.cloudflare.com/application-services/products/waf/"><u>WAF</u></a> protects origin servers from different kinds of layer 7 attacks, which are attacks that <a href="https://www.cloudflare.com/learning/ddos/application-layer-ddos-attack/"><u>target the application layer</u></a>. Protection is provided with various tools like:</p><ul><li><p><a href="https://developers.cloudflare.com/waf/managed-rules/"><u>Managed rules</u></a>, which security analysts at Cloudflare write to address <a href="https://www.cve.org/"><u>common vulnerabilities and exposures (CVE)</u></a>, <a href="https://www.cloudflare.com/learning/security/threats/owasp-top-10/"><u>OWASP security risks</u></a>, and vulnerabilities like Log4Shell.</p></li><li><p><a href="https://developers.cloudflare.com/waf/custom-rules/"><u>Custom rules</u></a>, where customers can write rules with the expressive <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/"><u>Rules language</u></a>.</p></li><li><p><a href="https://developers.cloudflare.com/waf/rate-limiting-rules/"><u>Rate limiting rules</u></a>, <a href="https://developers.cloudflare.com/waf/detections/malicious-uploads/"><u>malicious uploads detection</u></a>, <a href="https://developers.cloudflare.com/waf/detections/leaked-credentials/"><u>leaked credentials detection</u></a>, etc.</p></li></ul><p>These tools are built on the <a href="https://developers.cloudflare.com/ruleset-engine/"><u>Rulesets engine</u></a>. When there is a match on a <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/"><u>Rule expression</u></a>, the engine executes an <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/actions/"><u>action</u></a>.</p><p>The Log action is used to simulate the behaviour of rules. This action proves that a rule expression is matched by the engine and emits a log event which can be accessed via <a href="https://developers.cloudflare.com/waf/analytics/security-analytics/"><u>Security Analytics</u></a>, <a href="https://developers.cloudflare.com/waf/analytics/security-events/"><u>Security Events</u></a>, <a href="https://developers.cloudflare.com/logs/logpush/"><u>Logpush</u></a> or <a href="https://developers.cloudflare.com/logs/logpush/logpush-job/edge-log-delivery/"><u>Edge Log Delivery</u></a>.</p><p>Logs are great at validating a rule works as expected on the traffic it was expected to match, but showing that the rule matches isn’t sufficient, especially when a rule expression can take many code paths.

In pseudocode, an expression can look like:</p><p><code>If any of the http request headers contains an “authorization” key OR the lowercased representation of the http host header starts with “cloudflare” THEN log</code>

The rules language syntax will be:</p>
            <pre><code>any(http.request.headers[*] contains "authorization") or starts_with(lower(http.host), "cloudflare")</code></pre>
            <p>Debugging this expression poses a couple of problems. Is it the left-hand side (LHS) or right-hand side (RHS) of the OR expression above that matches? Functions such as <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/functions/#decode_base64"><u>Base64 decoding</u></a>, <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/functions/#url_decode"><u>URL decoding</u></a>, and in this case <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/functions/#lower"><u>lowercasing</u></a> can apply transformations to the original representation of these fields, which leads to further ambiguity as to which characteristics of the request led to a match.</p><p>To further complicate this, many <a href="https://developers.cloudflare.com/ruleset-engine/about/rules/"><u>rules</u></a> in a <a href="https://developers.cloudflare.com/ruleset-engine/about/rulesets/"><u>ruleset</u></a> can register matches. Rulesets like <a href="https://developers.cloudflare.com/waf/managed-rules/reference/owasp-core-ruleset/"><u>Cloudflare OWASP</u></a> use a cumulative score of different rules to trigger an action when the score crosses a <a href="https://developers.cloudflare.com/waf/managed-rules/reference/owasp-core-ruleset/concepts/#score-threshold"><u>set threshold</u></a>. </p><p>Additionally, the expressions of the Cloudflare Managed and OWASP rules are private. This increases our security posture – but it also means that customers can only guess what these rules do from their titles, tags and descriptions. For instance, one might be labeled “SonicWall SMA - Remote Code Execution - CVE:CVE-2025-32819.”</p><p>Which raises questions: What part of my request led to a match in the Rulesets engine? Are these false positives? </p><p>This is where payload logging shines. It can help us drill down to the specific fields and their respective values, post-transformation, in the rule that led to a match. </p>
    <div>
      <h2>Payload logging</h2>
      <a href="#payload-logging">
        
      </a>
    </div>
    <p>Payload logging is a feature that logs which fields in the request are associated with a rule that led to the WAF taking an action. This reduces ambiguity and provides useful information that can help spot check false positives, guarantee correctness, and aid in fine-tuning of these rules for better performance.</p><p>From the example above, a payload log entry will contain either the LHS or RHS of the expression, but not both. </p>
    <div>
      <h3>How does payload logging work ?</h3>
      <a href="#how-does-payload-logging-work">
        
      </a>
    </div>
    <p>The payload logging and Rulesets engines are built on Wirefilter, which has been <a href="https://blog.cloudflare.com/building-fast-interpreters-in-rust/"><u>explained extensively</u></a>.</p><p>Fundamentally, these engines are objects written in Rust which implement a <a href="https://github.com/cloudflare/wirefilter/blob/72e3954622ff7f30c4171f45461c2274656ee1e3/engine/src/compiler.rs#L7"><u>compiler</u></a> trait. This trait drives the compilation of the abstract syntax trees (ASTs) derived from these expressions.</p>
            <pre><code>struct PayloadLoggingCompiler {
     regex_cache HashMap&lt;String, Arc&lt;Regex&gt;&gt;
}

impl wirefilter::Compiler for PayloadLoggingCompiler {
	type U = PayloadLoggingUserData
	
	fn compile_logical_expr(&amp;mut self, node: LogicalExpr) -&gt; CompiledExpr&lt;Self::U&gt; {
		// ...
		let regex = self.regex_cache.entry(regex_pattern)
		.or_insert_with(|| Arc::new(regex))
		// ...
	}

}</code></pre>
            <p>The Rulesets Engine executes an expression and if it evaluates to true, the expression and its <a href="https://github.com/cloudflare/wirefilter/blob/72e3954622ff7f30c4171f45461c2274656ee1e3/engine/src/execution_context.rs#L38"><u>execution context</u></a> are sent to the payload logging compiler for re-evaluation. The execution context provides all the runtime values needed to evaluate the expression.</p><p>After re-evaluation is done, the fields involved in branches of the expression that evaluate to true are logged.</p><p>The structure of the log is a map of wirefilter fields and their values <code>Map&lt;Field, Value&gt;</code></p>
            <pre><code>{

	“http.host”: “cloudflare.com”,
	“http.method”: “get”,
	“http.user_agent”: “mozilla”

}</code></pre>
            <p>Note: <a href="https://blog.cloudflare.com/encrypt-waf-payloads-hpke/"><u>These logs are encrypted with the public key provided by the customer.</u></a> </p><p>These logs go through our logging pipeline and can be read in different ways. Customers can configure a Logpush job to write to a custom Worker we built that uses the customer’s private key to automatically decrypt these logs. The Payload logging <a href="https://github.com/cloudflare/matched-data-cli"><u>CLI tool</u></a>, <a href="https://github.com/cloudflare/matched-data-worker"><u>Worker</u></a>, or the Cloudflare dashboard can also be used for decryption.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4jTk0nPsfA0yowEwHx5VUr/eed6cece439d238b1ec861a9e0760dd6/image5.png" />
          </figure>
    <div>
      <h3>What improvements have been shipped?</h3>
      <a href="#what-improvements-have-been-shipped">
        
      </a>
    </div>
    <p>In wirefilter, some fields are array types. The field <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/http.request.headers.names/"><u>http.request.headers.names</u></a> is an array of all the header names in a request. For example:</p>
            <pre><code>[“content-type”, “content-length”, “authorization”, "host"]</code></pre>
            <p>An expression that reads <code>any(http.request.headers.names[*] contains “c”)</code> will evaluate to true because at least one of the headers contains the letter “c”. With the previous version of the payload logging compiler, all the headers in the “http.request.headers.names” field will be logged since it's a part of the expression that evaluates to true.  </p><p><b>Payload log (previous)</b></p>
            <pre><code>http.request.headers.names[*] = [“content-type”, “content-length”, “authorization”, "host"]</code></pre>
            <p>Now, we partially evaluate the array fields and log the indexes that match the expressions constraint. In this case, it’ll be just the headers that contain a “c”!</p><p><b>Payload log (new)</b></p>
            <pre><code>http.request.headers.names[0,1] = [“content-type”, “content-length”]</code></pre>
            
    <div>
      <h3>Operators</h3>
      <a href="#operators">
        
      </a>
    </div>
    <p>This brings us to operators in wirefilter. Some operators like “eq” result in exact matches, e.g. <code>http.host eq “a.com”</code>. There are other operators that result in “partial” matches – like “in”, “contains”, “matches” – that work alongside regexes. 

The expression in this example: `<code>any(http.request.headers[*] contains “c”)`</code> uses a “contains” operator which produces a partial match. It also uses the “<code>any</code>” function which we can say produces a partial match, because if at least one of the headers contains a “c”, then we should log <i>that</i> header – not <i>all</i> the headers as we did in the previous version.</p><p>With the improvements to the payload logging compiler, when these expressions are evaluated, we log just the partial matches. In this case, the new payload logging compiler handles the “contains” operator similarly to <a href="https://doc.rust-lang.org/std/string/struct.String.html#method.find"><u>the “find” method for bytes in the Rust standard library</u></a>. This improves our payload log to:</p>
            <pre><code>http.request.headers.names[0,1] = [“c”, “c”]</code></pre>
            <p>This makes things a lot clearer. It also saves our logging pipeline from processing millions of bytes. For example, a field that is analyzed a lot is the request body — <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/http.request.body.raw/"><u>http.request.body.raw </u></a>— which can be tens of kilobytes in size. Sometimes the expressions are checking for a regex pattern that should match three characters. In this case we’ll be logging 3 bytes instead of kilobytes!</p>
    <div>
      <h3>Context</h3>
      <a href="#context">
        
      </a>
    </div>
    <p>I know, I know, <code>[“c”, “c”]</code> doesn’t really mean much. Even if we’ve provided the exact reason for the match and are significantly saving on the volume of bytes written to our customers storage destinations, the key goal is to provide useful debugging information to the customer. As part of the payload logging improvements, the compiler now also logs a “before” and "after” (if applicable) for partial matches. The size for these buffers are currently 15 bytes each. This means our payload log now looks like:</p>
            <pre><code>http.request.headers[0,1] = [
    {
        before: null, // isnt included in the final log
        content: “c”, 
        after: “ontent-length”
    },
    {
        before: null, // isnt included in the final log
        content: “c”, 
        after:”ontent-type”
    }
]</code></pre>
            <p><b>Example of payload log (previous)</b></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4yhJWnG9FiDnQRAuV82t6C/0dbef6ded6f48a7f74d6a69aaf7d52a5/image7.png" />
          </figure><p><b>Example of payload log (new)</b></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6M1bQKaqNvalqtJo7nO6fM/8e87e1927ed404495273c082e258e6ee/image4.png" />
          </figure><p>In the previous log, we have all the header values. In the new log, we have the 8th index which is a malicious script in a HTTP header. The match is on the “&lt;script&gt;” tag and the rest is the context which is the text in gray.      </p>
    <div>
      <h3>Optimizations</h3>
      <a href="#optimizations">
        
      </a>
    </div>
    <p>Managed rules rely heavily on regular expressions to fingerprint malicious requests. Parsing and compiling these expressions are CPU-intensive tasks. As managed rules are written once and deployed across millions of zones, we benefit from compiling these regexes and caching them in memory. This saves us CPU cycles as we don’t have to re-compile these until the process restarts.</p><p>The Payload logging compiler uses a lot of dynamically sized arrays or vectors to store the intermediate state for these logs. Crates like <a href="https://docs.rs/smallvec/latest/smallvec/"><u>smallvec</u></a> are also used to reduce heap allocations.  </p>
    <div>
      <h3>The infamous “TRUNCATED” value</h3>
      <a href="#the-infamous-truncated-value">
        
      </a>
    </div>
    <p>Sometimes, customers see <a href="https://github.com/cloudflare/matched-data-cli/blob/master/src/main.rs#L124-L129"><u>“truncated”</u></a> in their payload logs. This is because every firewall event has a size limit in bytes. When this limit is exceeded, the payload log is truncated. </p><p><b>Payload log (previous)</b></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7234Ub1YB3xCMd6thJ5Gje/22b87bc0149f82a9315c258227764e58/image6.png" />
          </figure><p><b>Payload log (new)</b></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3mBw8ElDalEbpjKmGoVTT3/f877a232df29c6e01889cc1941d1b69a/image1.png" />
          </figure><p>We have seen the p50 byte size of the payload logs shrink from 1.5 Kilobytes to 500 bytes – a 67% reduction! That means way fewer truncated payload logs.</p>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We’re currently using a <a href="https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy"><u>lossy representation of utf-8 strings</u></a> to represent values. This means that non-valid utf-8 strings like multimedia are represented as <a href="https://doc.rust-lang.org/std/char/constant.REPLACEMENT_CHARACTER.html"><u>U+FFFD unicode replacement characters</u></a>. For rules that will work on binary data, the integrity of these values should be preserved with byte arrays or with a different serialization format.</p><p>The storage format for payload logging is JSON. We’ll be benchmarking this alongside other binary formats like <a href="https://cbor.io/"><u>CBOR</u></a>, <a href="https://capnproto.org/"><u>Cap'n Proto</u></a>, <a href="https://protobuf.dev/"><u>Protobuf</u></a>, etc., to see how much processing time this saves our pipeline. This will help us deliver logs to our customers faster, with the added advantage that binary formats can also help with maintaining a defined schema that will be backward compatible. </p><p>Finally, payload logging only works with Managed rules. It will be rolled out to other Cloudflare WAF products like custom rules, WAF attack score, content scanning, <a href="https://developers.cloudflare.com/waf/detections/firewall-for-ai/"><u>Firewall for AI</u></a>, and more. 

<i>An example of payload logging showing prompts containing PII, detected by Firewall for AI: </i></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4nq4rYROygGRVW7mTZ3nqz/3c49b85c54eee6f98aa0397dfce32fa5/image2.png" />
          </figure>
    <div>
      <h2>Why should I be excited?</h2>
      <a href="#why-should-i-be-excited">
        
      </a>
    </div>
    <p>Visibility into the actions taken by the WAF will give customers assurance that their rules or configurations are doing exactly what they expect. Improvements to the specificity of payload logging is a step in this direction — and in the pipeline are further improvements to reliability, latency, and expansion to more WAF products.</p><p>As this was a breaking change to the JSON schema, we’ve rolled this out slowly to customers with <a href="https://developers.cloudflare.com/changelog/2025-05-08-improved-payload-logging/"><u>adequate documentation</u></a>.</p><p>To get started and enable payload logging, <a href="https://developers.cloudflare.com/waf/managed-rules/payload-logging/#turn-on-payload-logging"><u>visit our developer documentation</u></a>. </p> ]]></content:encoded>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Logging]]></category>
            <guid isPermaLink="false">2FEaxrBcxhN1nwrSuT9Jpd</guid>
            <dc:creator>Paschal Obba</dc:creator>
        </item>
        <item>
            <title><![CDATA[A new WAF experience]]></title>
            <link>https://blog.cloudflare.com/new-waf-experience/</link>
            <pubDate>Tue, 15 Mar 2022 12:59:06 GMT</pubDate>
            <description><![CDATA[ The security landscape is moving fast. We invited users to help us shape a new WAF experience that enables us to evolve WAF to meet their demands and use cases ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5AshmKNvJcvQs9VcqUCAp8/b5128c88e4eb56e13d06b710e2b9861b/image2-28.png" />
            
            </figure><p>Around three years ago, we brought multiple features into the <a href="/new-firewall-tab-and-analytics/">Firewall tab</a> in our dashboard navigation, with the motivation “to make our products and services intuitive.” With our hard work in <a href="/tag/waf/">expanding capabilities offerings</a> in the past three years, we want to take another opportunity to evaluate the intuitiveness of <a href="https://www.cloudflare.com/waf/">Cloudflare WAF (Web Application Firewall)</a>.</p>
    <div>
      <h3>Our customers lead the way to new WAF</h3>
      <a href="#our-customers-lead-the-way-to-new-waf">
        
      </a>
    </div>
    <p>The security landscape is moving fast; types of web applications are growing rapidly; and within the industry there are various approaches to what a <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> includes and can offer. Cloudflare not only proxies enterprise applications, but also millions of personal blogs, community sites, and small businesses stores. The diversity of use cases are covered by various products we offer; however, these products are currently scattered and that makes visibility of active protection rules unclear. This pushes us to reflect on how we can best support our customers in getting the most value out of WAF by providing a clearer offering that meets expectations.</p><p>A few months ago, we reached out to our customers to answer a simple question: what do you consider to be part of WAF? We employed a range of user research methods including card sorting, tree testing, design evaluation, and surveys to help with this. The results of this research illustrated how our customers think about WAF, what it means to them, and how it supports their use cases. This inspired the product team to expand scope and contemplate what (Web Application) Security means, beyond merely the WAF.</p><p>Based on what hundreds of customers told us, our user research and product design teams collaborated with product management to rethink the security experience. We examined our assumptions and assessed the effectiveness of design concepts to create a structure (or information architecture) that reflected our customers’ mental models.</p><p>This new structure consolidates firewall rules, managed rules, and rate limiting rules to become a part of WAF. The new WAF strives to be the one-stop shop for web application security as it pertains to differentiating malicious from clean traffic.</p><p>As of today, you will see the following changes to our navigation:</p><ol><li><p><b>Firewall</b> is being renamed to <b>Security.</b></p></li><li><p>Under <b>Security,</b> you will now find <b>WAF.</b></p></li><li><p>Firewall rules, managed rules, and rate limiting rules will now appear under <b>WAF</b>.</p></li></ol><blockquote><p>From now on, when we refer to <b>WAF,</b> we will be referring to above three features.</p></blockquote><p>Further, some important updates are coming for these features. Advanced rate limiting rules will be launched as part of <a href="/welcome-security-week-2022/">Security Week</a>, and every customer will also get a free set of managed rules to <a href="/waf-for-everyone">protect all traffic from high profile vulnerabilities</a>. And finally, in the next few months, firewall rules will move to the <a href="https://developers.cloudflare.com/ruleset-engine/">Ruleset Engine</a>, adding more powerful capabilities thanks to the new Ruleset API. Feeling excited?</p>
    <div>
      <h3>How customers shaped the future of WAF</h3>
      <a href="#how-customers-shaped-the-future-of-waf">
        
      </a>
    </div>
    <p>Almost 500 customers participated in this user research study that helped us learn about needs and context of use. We employed four research methods, all of which were conducted in an unmoderated manner; this meant people around the world could participate remotely at a time and place of their choosing.</p><ul><li><p>Card sorting involved participants grouping navigational elements into categories that made sense to them.</p></li><li><p>Tree testing assessed how well or poorly a proposed navigational structure performed for our target audience.</p></li><li><p>Design evaluation involved a task-based approach to measure effectiveness and utility of design concepts.</p></li><li><p>Survey questions helped us dive deeper into results, as well as painting a picture of our participants.</p></li></ul><p>Results of this four-pronged study informed changes to both WAF and Security that are detailed below.</p>
    <div>
      <h3>The new WAF experience</h3>
      <a href="#the-new-waf-experience">
        
      </a>
    </div>
    <p>The final result reveals the WAF as part of a broader <a href="https://dash.cloudflare.com/?to=/:account/:zone/security">Security category</a>, which also includes Bots, DDoS, API Shield and Page Shield. This destination enables you to create your rules (a.k.a. firewall rules), deploy Cloudflare managed rules, set rate limit conditions, and includes handy tools to protect your web applications.</p><p>All customers across <a href="https://www.cloudflare.com/plans/">all plans</a> will now see the WAF products organized as below:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/777dWCpcmkac0c5KHZz4jp/6728da9e7d713d567a524faeb7f0b905/image1-29.png" />
            
            </figure><ol><li><p><b>Firewall rules</b> allow you to create custom, user-defined logic by blocking or allowing traffic that leverages all the components of the HTTP requests and dynamic fields computed by Cloudflare, such as Bot score.</p></li><li><p><b>Rate limiting rules</b> include the traditional IP-based product we launched back in 2018 and the newer Advanced Rate Limiting for ENT customers on the Advanced plan (coming soon).</p></li><li><p><b>Managed rules</b> allows customers to deploy sets of rules managed by the Cloudflare analyst team. These rulesets include a “Cloudflare Free Managed Ruleset” currently being rolled out <a href="/waf-for-everyone">for all plans</a> including FREE, as well as Cloudflare Managed, OWASP implementation, and Exposed Credentials Check for all paying plans.</p></li><li><p><b>Tools</b> give access to IP Access Rules, Zone Lockdown and User Agent Blocking. Although still actively supported, these products cover specific use cases that can be covered using firewall rules. However, they remain a part of the WAF toolbox for convenience.</p></li></ol>
    <div>
      <h3>Redesigning the WAF experience</h3>
      <a href="#redesigning-the-waf-experience">
        
      </a>
    </div>
    <p>Gestalt design principles suggest that “elements which are close in proximity to each other are perceived to share similar functionality or traits.” This principle in addition to the input from our customers informed our design decisions.</p><p>After reviewing the responses of the study, we understood the importance of making it easy to find the security products in the Dashboard, and the need to make it clear how particular products were related to or worked together with each other.</p><p>Crucially, the page needed to:</p><ul><li><p>Display each type of rule we support, i.e. firewall rules, rate limiting rules and managed rules</p></li><li><p>Show the usage amount of each type</p></li><li><p>Give the customer the ability to add a new rule and manage existing rules</p></li><li><p>Allow the customer to reprioritise rules using the existing drag and drop behavior</p></li><li><p>Be flexible enough to accommodate future additions and consolidations of WAF features</p></li></ul><p>We iterated on multiple options, including predominantly vertical page layouts, table based page layouts, and even accordion based page layouts. Each of these options, however, would force us to replicate buttons of similar functionality on the page. With the risk of causing additional confusion, we abandoned these options in favor of a horizontal, tabbed page layout.</p>
    <div>
      <h3>How can I get it?</h3>
      <a href="#how-can-i-get-it">
        
      </a>
    </div>
    <p>As of today, we are launching this new design of WAF to everyone! In the meantime, we are updating documentation to walk you through how to maximize the power of Cloudflare WAF.</p>
    <div>
      <h3>Looking forward</h3>
      <a href="#looking-forward">
        
      </a>
    </div>
    <p>This is a starting point of our journey to make Cloudflare WAF not only powerful but also easy to adapt to your needs. We are evaluating approaches to empower your decision-making process when protecting your web applications. Among growing intel information and more rules creation possibilities, we want to shorten your path from a possible threat detection (such as by security overview) to setting up the right rule to mitigate such threat. Stay tuned!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product Design]]></category>
            <category><![CDATA[Design]]></category>
            <guid isPermaLink="false">2UUR6KEw3qV6N5GMCAV7eS</guid>
            <dc:creator>Zhiyuan Zheng</dc:creator>
            <dc:creator>Mru Kodali</dc:creator>
            <dc:creator>Syeef Karim</dc:creator>
            <dc:creator>Daniele Molteni</dc:creator>
        </item>
        <item>
            <title><![CDATA[Replace your hardware firewalls with Cloudflare One]]></title>
            <link>https://blog.cloudflare.com/replace-your-hardware-firewalls-with-cloudflare-one/</link>
            <pubDate>Mon, 06 Dec 2021 14:00:01 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to announce new capabilities to help customers make the switch from hardware firewall appliances to a true cloud-native firewall built for next-generation networks. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, we’re excited to announce new capabilities to help customers make the switch from hardware firewall appliances to a true cloud-native firewall built for next-generation networks. Cloudflare One provides a secure, performant, and Zero Trust-enabled platform for administrators to apply consistent security policies across all of their users and resources. Best of all, it’s built on top of our global network, so you never need to worry about scaling, deploying, or maintaining your edge security hardware.</p><p>As part of this announcement, Cloudflare launched the <a href="http://cloudflare.com/oahu">Oahu</a> program today to help customers leave legacy hardware behind; in this post we’ll break down the new capabilities that solve the problems of previous firewall generations and save IT teams time and money.</p>
    <div>
      <h2>How did we get here?</h2>
      <a href="#how-did-we-get-here">
        
      </a>
    </div>
    <p>In order to understand where we are today, it’ll be helpful to start with a brief history of IP firewalls.</p>
    <div>
      <h3>Stateless packet filtering for private networks</h3>
      <a href="#stateless-packet-filtering-for-private-networks">
        
      </a>
    </div>
    <p>The first generation of network firewalls were designed mostly to meet the security requirements of private networks, which started with the castle and moat architecture we defined as Generation 1 in <a href="/welcome-to-cio-week/">our post yesterday</a>. Firewall administrators could build policies around signals available at layers 3 and 4 of the <a href="https://www.cloudflare.com/learning/ddos/glossary/open-systems-interconnection-model-osi/">OSI model</a> (primarily IPs and ports), which was perfect for (e.g.) enabling a group of employees on one floor of an office building to access servers on another via a LAN.</p><p>This packet filtering capability was sufficient until networks got more complicated, including by connecting to the Internet. IT teams began needing to protect their corporate network from bad actors on the outside, which required more sophisticated policies.</p>
    <div>
      <h3>Better protection with stateful &amp; deep packet inspection</h3>
      <a href="#better-protection-with-stateful-deep-packet-inspection">
        
      </a>
    </div>
    <p>Firewall hardware evolved to include stateful packet inspection and the beginnings of deep packet inspection, extending basic firewall concepts by tracking the state of connections passing through them. This enabled administrators to (e.g.) block all incoming packets not tied to an already present outgoing connection.</p><p>These new capabilities provided more sophisticated protection from attackers. But the advancement came at a cost: supporting this higher level of security required more compute and memory resources. These requirements meant that security and network teams had to get better at planning the capacity they’d need for each new appliance and make tradeoffs between cost and redundancy for their network.</p><p>In addition to cost tradeoffs, these new firewalls only provided some insight into how the network was used. You could tell users were accessing 198.51.100.10 on port 80, but to do a further investigation about what these users were accessing would require you to do a reverse lookup of the IP address. That alone would only land you at the front page of the provider, with no insight into what was accessed, reputation of the domain/host, or any other information to help answer “Is this a security event I need to investigate further?”. Determining the source would be difficult here as well, it would require correlating a private IP address handed out via DHCP with a device and then subsequently a user (if you remembered to set long lease times and never shared devices).</p>
    <div>
      <h3>Application awareness with next generation firewalls</h3>
      <a href="#application-awareness-with-next-generation-firewalls">
        
      </a>
    </div>
    <p>To accommodate these challenges, the industry introduced the <a href="https://www.cloudflare.com/learning/security/what-is-next-generation-firewall-ngfw/">Next Generation Firewall</a> (NGFW). These were the long reigning, and in some cases are still the industry standard, corporate edge security device. They adopted all the capabilities of previous generations while adding in application awareness to help administrators gain more control over what passed through their <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">security perimeter</a>. NGFWs introduced the concept of vendor-provided or externally-provided application intelligence, the ability to identify individual applications from traffic characteristics. Intelligence which could then be fed into policies defining what users could and couldn’t do with a given application.</p><p>As more applications moved to the cloud, NGFW vendors started to provide virtualized versions of their appliances. These allowed administrators to no longer worry about lead times for the next hardware version and allowed greater flexibility when deploying to multiple locations.</p><p>Over the years, as the threat landscape continued to evolve and networks became more complex, NGFWs started to build in additional security capabilities, some of which helped consolidate multiple appliances. Depending on the vendor, these included VPN Gateways, IDS/IPS, <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">Web Application Firewalls</a>, and even things like Bot Management and <a href="https://www.cloudflare.com/ddos/">DDoS protection</a>. But even with these features, NGFWs had their drawbacks — administrators still needed to spend time designing and configuring redundant (at least primary/secondary) appliances, as well as choosing which locations had firewalls and incurring performance penalties from backhauling traffic there from other locations. And even still, careful IP address management was required when creating policies to apply pseudo identity.</p>
    <div>
      <h3>Adding user-level controls to move toward Zero Trust</h3>
      <a href="#adding-user-level-controls-to-move-toward-zero-trust">
        
      </a>
    </div>
    <p>As firewall vendors added more sophisticated controls, in parallel, a paradigm shift for network architecture was introduced to address the security concerns introduced as applications and users left the organization’s “castle” for the Internet. <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust security</a> means that no one is trusted by default from inside or outside the network, and verification is required from everyone trying to gain access to resources on the network. Firewalls started incorporating Zero Trust principles by integrating with identity providers (IdPs) and allowing users to build policies around user groups — “only Finance and HR can access payroll systems” — enabling finer-grained control and reducing the need to rely on IP addresses to approximate identity.</p><p>These policies have helped organizations lock down their networks and get closer to Zero Trust, but CIOs are still left with problems: what happens when they need to integrate another organization’s identity provider? How do they safely grant access to corporate resources for contractors? And these new controls don’t address the fundamental problems with managing hardware, which still exist and are getting more complex as companies go through business changes like adding and removing locations or embracing hybrid forms of work. <a href="https://www.cloudflare.com/cio/">CIOs need a solution</a> that works for the future of corporate networks, instead of trying to duct tape together solutions that address only some aspects of what they need.</p>
    <div>
      <h2>The cloud-native firewall for next-generation networks</h2>
      <a href="#the-cloud-native-firewall-for-next-generation-networks">
        
      </a>
    </div>
    <p>Cloudflare is helping customers build the future of their corporate networks by unifying network connectivity and Zero Trust security. Customers who adopt the Cloudflare One platform can deprecate their hardware firewalls in favor of a cloud-native approach, making IT teams’ lives easier by solving the problems of previous generations.</p>
    <div>
      <h3>Connect any source or destination with flexible on-ramps</h3>
      <a href="#connect-any-source-or-destination-with-flexible-on-ramps">
        
      </a>
    </div>
    <p>Rather than managing different devices for different use cases, all traffic across your network — from data centers, offices, cloud properties, and user devices — should be able to flow through a single global firewall. Cloudflare One enables you to connect to the Cloudflare network with a variety of flexible on-ramp methods including network-layer (GRE or <a href="/anycast-ipsec/">IPsec</a> tunnels) or <a href="https://www.cloudflare.com/products/tunnel/">application-layer</a> tunnels, <a href="https://www.cloudflare.com/network-interconnect/">direct connections</a>, <a href="/bringing-your-own-ips-to-cloudflare-byoip/">BYOIP</a>, and a <a href="/warp-for-desktop/">device client</a>. Connectivity to Cloudflare means access to our entire global network, which eliminates many of the challenges with physical or virtualized hardware:</p><ul><li><p><b>No more capacity planning</b>: The capacity of your firewall is the capacity of Cloudflare’s global network (currently &gt;100Tbps and growing).</p></li><li><p><b>No more location planning:</b> Cloudflare’s Anycast network architecture enables traffic to connect automatically to the closest location to its source. No more picking regions or worrying about where your primary/backup appliances are — redundancy and failover are built in by default.</p></li><li><p><b>No maintenance downtimes:</b> Improvements to Cloudflare’s firewall capabilities, like all of our products, are deployed continuously across our global edge.</p></li><li><p><b>DDoS protection built in:</b> No need to worry about DoS attacks overwhelming your firewalls; Cloudflare’s network automatically blocks attacks close to their source and sends only the clean traffic on to its destination.</p></li></ul>
    <div>
      <h3>Configure comprehensive policies, from packet filtering to Zero Trust</h3>
      <a href="#configure-comprehensive-policies-from-packet-filtering-to-zero-trust">
        
      </a>
    </div>
    <p>Cloudflare One policies can be used to secure and route your organizations traffic across all the various traffic ramps. These policies can be crafted using all the same attributes available through a traditional NGFW while expanding to include <a href="https://developers.cloudflare.com/cloudflare-one/identity">Zero Trust attributes</a> as well. These Zero Trust attributes can include one or more IdPs or endpoint security providers.</p><p>When looking strictly at layers 3 through 5 of the OSI model, policies can be based on IP, port, protocol, and other attributes in both a <a href="https://developers.cloudflare.com/magic-firewall/reference/magic-firewall-fields">stateless</a> and <a href="https://developers.cloudflare.com/cloudflare-one/policies/filtering/network-policies#expressions">stateful</a> manner. These attributes can also be used to build your private network on Cloudflare when used in conjunction with any of the identity attributes and the Cloudflare device client.</p><p>Additionally, to help relieve the burden of managing IP allow/block lists, Cloudflare provides a set of managed lists that can be applied to both stateless and stateful policies. And on the more sophisticated end, you can also perform <a href="https://developers.cloudflare.com/magic-firewall/reference/magic-firewall-functions">deep packet inspection</a> and <a href="/programmable-packet-filtering-with-magic-firewall/">write programmable packet filters</a> to enforce a positive security model and thwart the largest of attacks.</p><p>Cloudflare’s intelligence helps power our application and content categories for our Layer 7 policies, which can be used to protect your users from security threats, prevent data exfiltration, and audit usage of company resources. This starts with our protected DNS resolver, which is built on top of our performance leading consumer 1.1.1.1 service. Protected DNS allows administrators to protect their users from navigating or resolving any known or potential <a href="https://developers.cloudflare.com/cloudflare-one/policies/filtering/dns-policies-builder/dns-categories">security risks</a>. Once a domain is resolved, administrators can apply HTTP policies to intercept, inspect, and filter a user's traffic. And if those web applications are self-hosted or SaaS enabled you can even protect them using a Cloudflare access policy, which acts as a web based identity proxy.</p><p>Last but not least, to help prevent data exfiltration, administrators can lock down access to external HTTP applications by utilizing <a href="https://developers.cloudflare.com/cloudflare-one/policies/browser-isolation">remote browser isolation</a>. And coming soon, administrators will be able to log and filter which commands a user can execute over an <a href="https://www.cloudflare.com/learning/access-management/what-is-ssh/">SSH session</a>.</p>
    <div>
      <h3>Simplify policy management: one click to propagate rules everywhere</h3>
      <a href="#simplify-policy-management-one-click-to-propagate-rules-everywhere">
        
      </a>
    </div>
    <p>Traditional firewalls required deploying policies on each device or configuring and maintaining an orchestration tool to help with this process. In contrast, Cloudflare allows you to manage policies across our entire network from a simple dashboard or API, or use Terraform to deploy infrastructure as code. Changes propagate across the edge in seconds thanks to our <a href="/introducing-quicksilver-configuration-distribution-at-internet-scale/">Quicksilver</a> technology. Users can get visibility into traffic flowing through the firewall with logs, which are <a href="/pii-and-selective-logging-controls-for-cloudflares-zero-trust-platform/">now configurable</a>.</p>
    <div>
      <h2>Consolidating multiple firewall use cases in one platform</h2>
      <a href="#consolidating-multiple-firewall-use-cases-in-one-platform">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/security/what-is-a-firewall/">Firewalls</a> need to cover a myriad of traffic flows to satisfy different security needs, including blocking bad inbound traffic, filtering outbound connections to ensure employees and applications are only accessing safe resources, and inspecting internal (“East/West”) traffic flows to enforce Zero Trust. Different hardware often covers one or multiple use cases at different locations; we think it makes sense to consolidate these as much as possible to improve ease of use and establish a single source of truth for firewall policies. Let’s walk through some use cases that were traditionally satisfied with hardware firewalls and explain how IT teams can satisfy them with Cloudflare One.</p>
    <div>
      <h3>Protecting a branch office</h3>
      <a href="#protecting-a-branch-office">
        
      </a>
    </div>
    <p>Traditionally, IT teams needed to provision at least one hardware firewall per office location (multiple for redundancy). This involved forecasting the amount of traffic at a given branch and ordering, installing, and maintaining the appliance(s). Now, customers can connect branch office traffic to Cloudflare from whatever hardware they already have — any standard router that supports GRE or IPsec will work — and control filtering policies across all of that traffic from Cloudflare’s dashboard.</p><p><b>Step 1: Establish a GRE or IPsec tunnel</b>The majority of mainstream hardware providers support GRE and/or IPsec as tunneling methods. Cloudflare will provide an Anycast IP address to use as the tunnel endpoint on our side, and you configure a standard GRE or IPsec tunnel with no additional steps — the Anycast IP provides automatic connectivity to every Cloudflare data center.</p><p><b>Step 2: Configure network-layer firewall rules</b>All IP traffic can be filtered through Magic Firewall, which includes the ability to construct policies based on any packet characteristic — e.g., source or destination IP, port, protocol, country, or bit field match. Magic Firewall also integrates with <a href="/introducing-ip-lists/">IP Lists</a> and includes advanced capabilities like <a href="/programmable-packet-filtering-with-magic-firewall/">programmable packet filtering</a>.</p><p><b>Step 3: Upgrade traffic for application-level firewall rules</b>After it flows through Magic Firewall, TCP and UDP traffic can be “upgraded” for fine-grained filtering through Cloudflare Gateway. This upgrade unlocks a full suite of filtering capabilities including application and content awareness, identity enforcement, SSH/HTTP proxying, and DLP.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/15mxsEXJnTAjsD1goBIwn3/f00d5d46972d43a07b14e1d256b5493b/unnamed-2.png" />
            
            </figure>
    <div>
      <h3>Protecting a high-traffic data center or VPC</h3>
      <a href="#protecting-a-high-traffic-data-center-or-vpc">
        
      </a>
    </div>
    <p>Firewalls used for processing data at a high-traffic headquarters or data center location can be some of the largest capital expenditures in an IT team’s budget. Traditionally, data centers have been protected by beefy appliances that can handle high volumes gracefully, which comes at an increased cost. With Cloudflare’s architecture, because every server across our network can share the responsibility of processing customer traffic, no one device creates a bottleneck or requires expensive specialized components. Customers can on-ramp traffic to Cloudflare with BYOIP, a standard tunnel mechanism, or Cloudflare Network Interconnect, and process up to terabits per second of traffic through firewall rules smoothly.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5efjp1MCUcxTZfrszwZyKj/b2fc5a524ca4e7bd5269f1c08c975bfa/unnamed--1--1.png" />
            
            </figure>
    <div>
      <h3>Protecting a roaming or hybrid workforce</h3>
      <a href="#protecting-a-roaming-or-hybrid-workforce">
        
      </a>
    </div>
    <p>In order to connect to corporate resources or get secure access to the Internet, users in traditional network architectures establish a VPN connection from their devices to a central location where firewalls are located. There, their traffic is processed before it’s allowed to its final destination. This architecture introduces performance penalties and while modern firewalls can enable user-level controls, they don’t necessarily achieve Zero Trust. Cloudflare enables customers to use a device client as an on-ramp to Zero Trust policies; watch out for more updates later this week on how to smoothly deploy the client at scale.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3O3oEBTYP2VN6fDCLrjZ10/0c855b9a935dde38bb24d5c67fca348c/unnamed--2--1.png" />
            
            </figure>
    <div>
      <h2>What’s next</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We can’t wait to keep evolving this platform to serve new use cases. We’ve heard from customers who are interested in expanding NAT Gateway functionality through Cloudflare One, who want richer analytics, reporting, and <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">user experience monitoring</a> across all our firewall capabilities, and who are excited to adopt a full suite of DLP features across all of their traffic flowing through Cloudflare’s network. Updates on these areas and more are coming soon (stay tuned).</p><p>Cloudflare’s new firewall capabilities are available for enterprise customers today. Learn more <a href="https://www.cloudflare.com/magic-firewall/">here</a> and check out the <a href="http://cloudflare.com/oahu">Oahu Program</a> to learn how you can migrate from hardware firewalls to Zero Trust — or talk to your account team to get started today.</p> ]]></content:encoded>
            <category><![CDATA[CIO Week]]></category>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Cloudflare Gateway]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Zero Trust]]></category>
            <guid isPermaLink="false">NVgWtzBSDEvGcm5UE0AC5</guid>
            <dc:creator>Ankur Aggarwal</dc:creator>
            <dc:creator>Annika Garbers</dc:creator>
        </item>
        <item>
            <title><![CDATA[PII and Selective Logging controls for Cloudflare’s Zero Trust platform]]></title>
            <link>https://blog.cloudflare.com/pii-and-selective-logging-controls-for-cloudflares-zero-trust-platform/</link>
            <pubDate>Mon, 06 Dec 2021 13:59:18 GMT</pubDate>
            <description><![CDATA[ Today we’re excited to announce a combination of two features, Zero Trust role-based access and selective logging. With these features, administrators will be able to protect not only their users but also the data their users generate. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>At Cloudflare, we believe that you shouldn’t have to compromise privacy for security. Last year, we launched Cloudflare Gateway — a comprehensive, Secure Web Gateway with built-in <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> browsing controls for your organization. Today, we’re excited to share the latest set of privacy features available to administrators to log and audit events based on your team’s needs.</p>
    <div>
      <h3>Protecting your organization</h3>
      <a href="#protecting-your-organization">
        
      </a>
    </div>
    <p>Cloudflare Gateway helps organizations replace legacy firewalls while also <a href="https://www.cloudflare.com/learning/access-management/how-to-implement-zero-trust/">implementing Zero Trust controls</a> for their users. Gateway meets you wherever your users are and allows them to connect to the Internet or even your private network running on Cloudflare. This extends your <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">security perimeter</a> without having to purchase or maintain any additional boxes.</p><p>Organizations also benefit from improvements to user performance beyond just removing the backhaul of traffic to an office or data center. Cloudflare’s network delivers security filters closer to the user in over 250 cities around the world. Customers start their connection by using the <a href="/announcing-1111/">world’s fastest DNS resolver</a>. Once connected, Cloudflare intelligently routes their traffic through our network with layer 4 network and layer 7 HTTP filters.</p><p>To get started, administrators deploy Cloudflare’s client (WARP) on user devices, whether those devices are macOS, Windows, iOS, Android, ChromeOS or Linux. The client then sends all outbound layer 4 traffic to Cloudflare, along with the identity of the user on the device.</p><p>With proxy and TLS decryption turned on, Cloudflare will log all traffic sent through Gateway and surface this in Cloudflare’s dashboard in the form of raw logs and aggregate analytics. However, in some instances, administrators may not want to retain logs or allow access to all members of their security team.</p><p>The reasons may vary, but the end result is the same: administrators need the ability to control how their users' data is collected and who can audit those records.</p><p>Legacy solutions typically give administrators an all-or-nothing blunt hammer. Organizations could either enable or disable all logging. Without any logging, those services did not capture any personally identifiable information (PII). By avoiding PII, administrators did not have to worry about control or access permissions, but they lost all visibility to investigate security events.</p><p>That lack of visibility adds even more complications when teams need to address tickets from their users to answer questions like “why was I blocked?”, “why did that request fail?”, or “shouldn’t that have been blocked?”. Without logs related to any of these events, your team can’t help end users diagnose these types of issues.</p>
    <div>
      <h3>Protecting your data</h3>
      <a href="#protecting-your-data">
        
      </a>
    </div>
    <p>Starting today, your team has more options to decide the type of information Cloudflare Gateway logs and who in your organization can review it. We are releasing role-based dashboard access for the logging and analytics pages, as well as selective logging of events. With role-based access, those with access to your account will have PII information redacted from their dashboard view by default.</p><p>We’re excited to help organizations build least-privilege controls into how they manage the deployment of Cloudflare Gateway. Security team members can continue to manage policies or investigate aggregate attacks. However, some events call for further investigation. With today’s release, your team can delegate the ability to review and search using PII to specific team members.</p><p>We still know that some customers want to reduce the logs stored altogether, and we’re excited to help solve that too. Now, administrators can now select what level of logging they want Cloudflare to store on their behalf. They can control this for each component, DNS, Network, or HTTP and can even choose to only log block events.</p><p>That setting does not mean you lose all logs — just that Cloudflare never stores them. Selective logging combined with our previously released <a href="/export-logs-from-cloudflare-gateway-with-logpush/">Logpush service</a> allows users to stop storage of logs on Cloudflare and turn on a Logpush job to their destination of choice in their location of choice as well.</p>
    <div>
      <h3>How to Get Started</h3>
      <a href="#how-to-get-started">
        
      </a>
    </div>
    <p>To get started, any Cloudflare Gateway customer can visit the <a href="https://dash.teams.cloudflare.com/settings/network">Cloudflare for Teams dashboard</a> and navigate to Settings &gt; Network. The first option on this page will be to specify your preference for activity logging. By default, Gateway will log all events, including DNS queries, HTTP requests and Network sessions. In the network settings page, you can then refine what type of events you wish to be logged. For each component of Gateway you will find three options:</p><ol><li><p>Capture all</p></li><li><p>Capture only blocked</p></li><li><p>Don’t capture</p></li></ol>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/51cwm1HCCSZ2XblS4aQuFc/8a14ff5ea45b8f16cc9d71d65e97b99f/image2-10.png" />
            
            </figure><p>Additionally, you’ll find an option to redact all PII from logs by default. This will redact any information that can be used to potentially identify a user including User Name, User Email, User ID, Device ID, source IP, URL, referrer and user agent.</p><p>We’ve also included new roles within the <a href="https://dash.cloudflare.com">Cloudflare dashboard</a>, which provide better granularity when partitioning Administrator access to Access or Gateway components. These new roles will go live in January 2022 and can be modified on enterprise accounts by visiting Account Home → Members.</p><p>If you’re not yet ready to create an account, but would like to explore our Zero Trust services, <a href="https://www.cloudflare.com/teams/self-guided-tour-of-zero-trust-platform/">check out our interactive demo</a> where you can take a self-guided tour of the platform with narrated walkthroughs of key use cases, including setting up DNS and HTTP filtering with Cloudflare Gateway.</p>
    <div>
      <h3>What’s Next</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>Moving forward, we’re excited to continue adding more and more privacy features that will give you and your team more granular control over your environment. The features announced today are available to users on any plan; your team can follow this link to <a href="https://dash.cloudflare.com/sign-up/teams">get started today</a>.</p> ]]></content:encoded>
            <category><![CDATA[CIO Week]]></category>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Cloudflare Gateway]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">1v1p5WFE2xOTy05X4x43AJ</guid>
            <dc:creator>Ankur Aggarwal</dc:creator>
            <dc:creator>Abe Carryl</dc:creator>
        </item>
        <item>
            <title><![CDATA[Account Takeover Protection and WAF mitigations to help stop Global Brute Force Campaigns]]></title>
            <link>https://blog.cloudflare.com/patching-the-internet-against-global-brute-force-campaigns/</link>
            <pubDate>Thu, 01 Jul 2021 17:53:20 GMT</pubDate>
            <description><![CDATA[ Today, we are making our Account Takeover Protection capabilities available to all paid plans at no additional charge. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3F39KwzghBsFpEWzc0k5mI/5cd517735e44c4af6347ad4cff12da51/image1.png" />
            
            </figure><p>Earlier today a cybersecurity advisory was published by international security agencies identifying widespread attacks against government and private sector targets worldwide. You can read the full <a href="https://www.nsa.gov/news-features/press-room/Article/2677750/nsa-partners-release-cybersecurity-advisory-on-brute-force-global-cyber-campaign/">report here</a>, which discusses widespread, distributed, and anonymized brute force access attempts since mid-2019 and still active through early 2021.</p><p>Today, we have rolled out <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> mitigations to protect our customers against these types of attacks.</p><p>And we are making the exposed credential check feature of <a href="https://www.cloudflare.com/zero-trust/solutions/account-takeover-prevention/">Account Takeover Protection</a> available to <a href="https://www.cloudflare.com/plans/">all paid plans</a> at no additional charge today. We had been planning to release these features later this month to a subset of our customers, but when we were informed of this ongoing attack we accelerated the release timeline and expanded those eligible to use the protections.</p><p>The attack which we are now protecting against was carried out in three main steps:</p><ol><li><p>Initial account compromise performed via brute force attacks against authentication endpoints;</p></li><li><p>Once access was gained, network traversal was performed leveraging several publicly known vulnerabilities, including but not limited to <a href="https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2020-0688">CVE 2020-0688</a> and <a href="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2020-17144">CVE 2020-17144</a> that widely affected Microsoft Exchange Servers;</p></li><li><p>Deployment of remote shells, such as a variant of the <a href="https://github.com/xl7dev/WebShell/tree/master/reGeorg-master">reGeorg web shell</a>, and network reconnaissance to gather additional information;</p></li></ol>
    <div>
      <h2>Detecting Brute Force Login Attempts</h2>
      <a href="#detecting-brute-force-login-attempts">
        
      </a>
    </div>
    <p>The findings in the report highlight the increasing problem of password reuse and compromise that affects online applications, including government and large private sector online properties.</p><p>In March 2021, during Security Week, <a href="/account-takeover-protection/">we launched a beta program for a new feature called Exposed Credential Checks</a>. This feature allows website administrators to be notified whenever a login attempt is performed using a breached username and password credential pair. This is a very strong signal to enforce two factor authentication, a password reset, or simply increase user logging for the duration of the session.</p><p>Starting today, all paid plans (i.e., Pro and above) can enable the exposed credential check feature of Account Takeover Protection. We made the decision to give this to more customers due to the severity of the report and ongoing nature of the exploitation attempts.</p><p>While we work to accelerate the automatic deployment of the capability across these plans, you can file a support ticket with “Account Takeover Protections activation request” in the subject line to have it manually enabled today for your domains.</p><p>Customers who are not yet running the <a href="/new-cloudflare-waf/">new WAF announced during Security Week</a> will first be upgraded to this version; all accounts created after May 6, 2021, are already on the new version. The exposed credential managed ruleset can then be turned on with a single click, and supports the following applications out of the box:</p><ul><li><p>WordPress</p></li><li><p>Joomla</p></li><li><p>Drupal</p></li><li><p>Ghost</p></li><li><p>Magento</p></li><li><p>Plone</p></li><li><p>Microsoft Exchange</p></li></ul><p>When turned on, whenever a compromised credential is detected the following header will be added to the request to the origin server:</p>
            <pre><code>Exposed-Credential-Check: 1</code></pre>
            <p>This header alone won’t provide additional security, but can be used by the origin server to enforce additional measures, for example forcing a two factor authentication or password reset flow. The feature can also be deployed in logging mode to easily identify brute force attacks targeting your application using the Firewall Analytics dashboard.</p><p>If your application is not in the default set of protected applications, as long as your login endpoints conform to one of our generic rules, the feature will work as expected. We currently have two options:</p><ul><li><p>A JSON endpoint (<code>application/json</code>) that submits credentials with <code>'email'</code> and <code>'password'</code> keys, for example <code>{“email”:”user@example.com”, “password”:”pass”}</code></p></li><li><p>A standard login HTML form (<code>application/x-www-form-urlencoded</code>), under a URL that contains “login”. The form fields should be named <code>username</code> and <code>password</code> respectively;</p></li></ul><p>Developer documentation can <a href="https://developers.cloudflare.com/waf/exposed-credentials-check">be found here</a>.</p>
    <div>
      <h2>WAF Rule Update</h2>
      <a href="#waf-rule-update">
        
      </a>
    </div>
    <p>In addition to exposed credential checks, we have implemented improvements to the following WAF rules effective immediately:</p><ul><li><p>Improved rule <code>100197</code></p></li><li><p>Added a new rule <code>100197B</code> (default disabled)</p></li></ul><p>These rules will match against request payloads that contain the reGeorg shell variant mentioned in the report. The rule improvements were based on, but not limited to, the Yara rule found in the security advisory. In summary the rule will block payloads which contain the following signatures and similar variations:</p>
            <pre><code>%@ Page Language=C#
StrTr
System.Net.IPEndPoint
Response.AddHeader
Socket</code></pre>
            
    <div>
      <h2>Additional Mitigations</h2>
      <a href="#additional-mitigations">
        
      </a>
    </div>
    <p>In addition to monitoring and defending against credential stuffing attacks using datasets of compromised credentials, security administrators should implement additional best practices for their authentication endpoints. For example, multi-factor authentication, account time-out and lock-out features, and stronger methods of authentication that require “having” something such as a hard token or client certificate—not just “knowing” something such as a username and password.</p><p>Cloudflare has a number of additional features that customers are also advised to deploy where possible on their environments to strengthen their security posture:</p><ul><li><p><a href="https://www.cloudflare.com/teams/access/">Cloudflare Access</a> can be used to provide strong, multi-factor authentication for both internal and external facing applications, and integrates directly with your organization’s SSO and identity providers (IdP);</p></li><li><p>Where possible, implementing Mutual TLS rules (mTLS) in front of authentication endpoints will increase an application security posture considerably by avoiding the use of passwords. This can be done both <a href="https://developers.cloudflare.com/firewall/cf-dashboard/create-mtls-rule">as a Firewall Rule</a> or as an option when <a href="https://developers.cloudflare.com/cloudflare-one/identity/devices/mutual-tls-authentication">setting up Cloudflare Access</a>;</p></li><li><p>We recently announced a <a href="https://developers.cloudflare.com/firewall/cf-firewall-rules/rules-lists#managed-ip-lists-open-proxies">Managed IP list that will contain Open Proxy endpoints</a> identified by Cloudflare’s intelligence - this list can be used when creating Firewall Rules to protect authentication endpoints by issuing Captcha (or other) challenges;</p></li><li><p>The use of our Bot Management detection has recently been expanded to all self-serve paid plans via our <a href="/super-bot-fight-mode/">Super Bot Fight Mode product</a> - this product allows customers to set up rules to challenge/block automated traffic, such as bots attempting brute force attacks, while letting verified bots access Internet properties normally.</p></li></ul>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Brute force attacks are a prevalent and successful means to gain initial access to private networks, especially when applications require only username and password pairs for authentication. The <a href="https://www.nsa.gov/news-features/press-room/Article/2677750/nsa-partners-release-cybersecurity-advisory-on-brute-force-global-cyber-campaign/">report</a> released today reinforced the widespread use of these credential stuffing attacks to gain access and then pivot to additional sensitive resources and data using other vulnerabilities.</p><p>Cloudflare customers are protected against these automated attacks by two new WAF rules, and also through the exposed credential check feature of our Account Takeover Protection offering. We have made the exposed credential check feature available today, to all paid plans, in advance of our planned launch later this month. Reach out to our support team immediately if you would like this feature enabled as we work to turn it on for everyone.</p> ]]></content:encoded>
            <category><![CDATA[WAF Rules]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">5gliYo3Njvyw8B5qyOg0ka</guid>
            <dc:creator>Michael Tremante</dc:creator>
        </item>
        <item>
            <title><![CDATA[A new Cloudflare Web Application Firewall]]></title>
            <link>https://blog.cloudflare.com/new-cloudflare-waf/</link>
            <pubDate>Mon, 29 Mar 2021 13:00:00 GMT</pubDate>
            <description><![CDATA[ Today we are announcing a new Cloudflare Web Application Firewall for all Cloudflare paid zone customers. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Cloudflare <a href="https://www.cloudflare.com/waf/">Web Application Firewall (WAF)</a> blocks more than 57 billion cyber threats per day. That is 650k blocked HTTP requests per second. The original code that filters this traffic was written by Cloudflare’s now CTO and the WAF has since received many accolades including the highest score for ability to execute in the 2020 Gartner Magic Quadrant for WAF.</p><p>Because we value replacing code when it is no longer as maintainable, performant, or scalable as it once was, we regularly rewrite key parts of the Cloudflare stack. That’s necessary as our enormous growth makes yesterday’s solutions unworkable. For some time, we have been working on replacing that original <a href="https://www.youtube.com/watch?v=nlt4XKhucS4">LuaJIT code John wrote</a> with new code, written in Rust, along with an improved UI.</p><p>We are now excited to announce a new Cloudflare Web Application Firewall.</p><p>Starting today, 10% of newly created accounts on Cloudflare will be given access to the new WAF whenever a Pro plan zone or above is added. This percentage will increase to 100% of new accounts over the month of April, after which migration efforts will commence for existing customers. Enterprise customers may migrate early by contacting their account team.</p>
    <div>
      <h3>What’s changing</h3>
      <a href="#whats-changing">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">The Web Application Firewall (WAF)</a> is a core component of the Cloudflare platform. As one of the most used products in the portfolio, we have gained a lot of feedback and experience from running it at scale, that helped guide us in this major iteration. The new WAF brings:</p><ul><li><p><i><b>Better rule browsing and configuration</b></i> - easy one click deploy without losing the power tools: advanced filtering, bulk editing, rule tags and more. Turning on all WordPress rules, setting all Cloudflare Managed Rules to LOG or figuring out which rules are not running is now easy.</p></li><li><p><i><b>A new matching engine</b></i> - written in Rust and supporting the <a href="/how-we-made-firewall-rules/">wirefilter</a> syntax - the same syntax used by custom Firewall Rules. This engine will allow us to have faster managed rule deployments and the ability to scale to the next level by allowing the WAF to be deployed on even more traffic. All while improving performance and security.</p></li><li><p><i><b>Updated Rulesets</b></i> -__ the new WAF ships with updated rulesets that provide better control separating rule status from action. The Cloudflare OWASP Core Ruleset has also been improved based on the latest version of the OWASP Core Ruleset (v3.3 at time of writing), which adds paranoia levels and improves false positives rates compared to the current version available.</p></li><li><p><i><b>Global configuration</b></i> <b><i>-</i></b> deploy the same configuration across your entire account. Group rules as rulesets and make use of native versioning and rollback capabilities.</p></li></ul><p>The list above is only a small subset of the things we are excited about and each point deserves its own post, but here are the highlights.</p>
    <div>
      <h3>Better rule browsing and configuration</h3>
      <a href="#better-rule-browsing-and-configuration">
        
      </a>
    </div>
    <p>The Cloudflare Managed Ruleset, which includes the Cloudflare Specials<sup>1</sup> group, is one of the main components of the WAF. It has several hundred rules that are provided and maintained by Cloudflare. In its default configuration we aim to achieve a very low false positive rate, while providing a very good security baseline for any web application. For the best possible security stance though, you should enable as many rules as possible. This means that, sometimes it’s necessary to deep dive and customise the ruleset behaviour based on the underlying application.</p><p>With the new WAF, we wanted to make sure enabling the Managed Ruleset was a one click effort with the default configuration, while allowing a much better configuration experience for those interested.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/HtlOoLLd8T4mIM5odeQ20/5aff0d8c01df1ccc834c276833bd523b/image8-5.png" />
            
            </figure><p>The new WAF UI. One click to turn on the Cloudflare Managed Ruleset and the Cloudflare OWASP ModSecurity Core Ruleset.</p><p>Today, to turn on our Cloudflare Managed Ruleset, you need to enable a global WAF switch and configure any rule groups of interest. The ten rule groups, which include WordPress, Joomla, PHP, and similar, are displayed directly on the page with on/off toggles. This UI does not allow to easily filter or configure rules within those groups without checking each rule individually.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2tLcQKkTNsP7LwBxjZu8oL/5466321fcd75a20e55eeca0c7f3bba20/image4-49.png" />
            
            </figure><p>The current (old) Managed Ruleset WAF UI. Clicking on a group displays a list of rules in each group.</p><p>Although the UI was simple, it did not allow common tasks to be executed quickly. For example: <i>show me all rules that are off</i> or <i>show me all rules mitigating XSS attacks</i>. Now, all rules are displayed in a single table - but filtering by rule status, action and tag is one click away. Rule tags are also replacing groups, and a rule may have one or more tags, making the system a lot more flexible. Tags will be used for:</p><ul><li><p>Identifying if a rule is applicable to a specific software component</p></li><li><p>Identifying the attack vector (e.g. <a href="https://www.cloudflare.com/learning/security/threats/cross-site-scripting/">XSS</a>, SQLi, RCE)</p></li><li><p>Identifying rules that are CVE specific</p></li></ul><p>Finally, we are allowing for bulk editing controls in addition to inline single rule controls to allow for faster configuration changes based on specific use cases.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/WBKkzAO9JYUGzADTkAbIb/4746b903219f03a0750d58f539148ae6/image3-43.png" />
            
            </figure><p>The new WAF ruleset browser. Bulk options, tags and filtering components in one place.‌‌</p><p>As we expect the number of rules available to increase, and for more users to adopt custom configurations, we have added a review screen when deploying configuration changes. From here you can easily see any changes from the defaults, and optionally revert them.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2pvE7qkr1D7YVAb19s03YQ/a3abf13ae213e627b8d243b07d1733f4/image5-34.png" />
            
            </figure><p>Ruleset deployment review screen. From here you can review any custom configuration overrides from defaults.</p>
    <div>
      <h3>A new matching engine</h3>
      <a href="#a-new-matching-engine">
        
      </a>
    </div>
    <p>The current Cloudflare WAF, responsible for managed ruleset execution, is written in LuaJIT and is implemented as an NGINX module. The rule syntax followed a superset of the syntax implemented by <a href="https://github.com/SpiderLabs/ModSecurity">ModSecurity</a> with added features specific to the Cloudflare implementation.</p><p>By moving to a new engine we wanted to achieve:</p><ul><li><p>A safer, better and more performant environment consistent with other technologies used at Cloudflare</p></li><li><p>Exposure of much better filtering and matching capabilities to allow for flexibility of deployment and easier exception handling</p></li><li><p>Unified product feature set by adopting the wirefilter syntax as the basis for managed rulesets</p></li></ul><p>The last point was especially important not only for us but also for our users because this syntax is already in use for our custom <a href="https://developers.cloudflare.com/firewall/">Firewall Rules</a>, which even uses the same underlying Rust library to execute the filters!</p><p>The new engine is implemented in <a href="https://www.rust-lang.org/">Rust</a>, which we have talked about how much we love quite a few times before <a href="/tag/rust/">on this blog</a>. We're also working on making sure that this new implementation not only comes with safety improvements, but speed improvements as well, the specifics of which we'll go into in future blog posts.</p>
    <div>
      <h3>Updated Cloudflare Rulesets</h3>
      <a href="#updated-cloudflare-rulesets">
        
      </a>
    </div>
    <p>The Cloudflare rulesets have been updated and ported over to the new WAF. Notably the rulesets now use wirefilter syntax and rule status is separated from rule action, allowing you to configure both independently.</p><p>The Cloudflare OWASP Core Ruleset has also received a major update independently from the engine. The current Cloudflare WAF implements a 2.x version of the official <a href="https://owasp.org/www-project-modsecurity-core-rule-set/">OWASP ModSecurity Core Ruleset</a>. In the new WAF the Cloudflare OWASP Core Ruleset is based directly on the latest 3.3 version available from the <a href="https://github.com/SpiderLabs/owasp-modsecurity-crs">GitHub repository</a>.</p><p>The new Cloudflare OWASP Core Ruleset, along with added engine features, brings several improvements over the existing one:</p><ul><li><p>Fewer false positives and more powerful application generic rules</p></li><li><p>More control over the sensitivity score, with clear indication of how much each rule contributes to the score and what the total score was on triggered requests</p></li><li><p>The addition of a <a href="https://coreruleset.org/faq/#paranoialevel">paranoia level</a> - to provide easy inclusion or exclusion or rule groups based on false positive risk</p></li><li><p>Rule tags to allow deployment with pertinent rules based on the application</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/71oxtyw6GNf3wdRFu15PqU/e4ce542543744a20fe6c5646b6211b19/image2-48.png" />
            
            </figure><p>The Cloudflare OWASP Core Ruleset‌‌</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3oXFkEPdACSsi5mn60GsUM/40c33d7774d16389c266f1302da1d8eb/image7-12.png" />
            
            </figure><p>The Cloudflare OWASP Core Ruleset review screen‌‌</p><p>As part of the efforts to convert the latest version of the OWASP ModSecurity Core Ruleset to its Cloudflare implementation, the team has also built a ModSecurity to wirefilter syntax converter. This will enable us to easily deploy and update the ruleset shortly after any upstream improvements to ensure customers have access to the latest version at all times. We also plan to open source and expose the converter in the UI in the future to make customer migrations from ModSecurity-based WAFs to Cloudflare easier.</p>
    <div>
      <h3>Global configuration</h3>
      <a href="#global-configuration">
        
      </a>
    </div>
    <p>Cloudflare has operated on a zone-based model for the Cloudflare WAF since the beginning. This serves well for simple use cases where customers are protecting a small number of applications, or a very diverse set of applications on a per-zone basis.</p><p>More complex or unified deployments across zones are normally implemented by leveraging <a href="https://api.cloudflare.com/">the API</a> or automation tools such as our <a href="https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs">Cloudflare Terraform Provider</a>.</p><p>With the new WAF, ruleset deployments can be made across any arbitrary filter of traffic under a single account. For example:</p><ul><li><p>Deploy Cloudflare Managed Ruleset across all my zones.</p></li><li><p>Deploy Cloudflare OWASP Core Ruleset on all traffic that does not contain <code>/api/*</code> in the path.</p></li><li><p>Disable the Managed Rulesets across my account for traffic coming from my IP.</p></li></ul><p>This enables powerful account wide WAF configurations with a couple of clicks.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/zG8mUtoa200mLuwbvstS5/9a2625812809a6242ac0cc7a2c8e250a/image1-56.png" />
            
            </figure><p>_Three rulesets deployed on arbitrary applications on the account._‌‌</p><p>To achieve this, rulesets (group of rules) become a first class concept, and are natively versioned allowing for both rollback and diffing capabilities directly in the UI — features that we plan to start exposing in the coming months.</p><p>Account-based configurations will initially only be available to Enterprise customers who can now request early access by contacting their account team. Custom Firewall Rules themselves will soon be migrated onto the new engine, allowing for customers to also create their own custom firewall rulesets, and deploy them as needed on any traffic filter.</p>
    <div>
      <h3>A new platform for new features</h3>
      <a href="#a-new-platform-for-new-features">
        
      </a>
    </div>
    <p>There is a lot more to the WAF than meets the eye and the team is already busy finalising a set of additional features built on the new WAF — these include improvements to the engine itself, better analytics and visibility into actionable events. The entire engine is in fact designed to be the basis for many of the Cloudflare rule-based products, with the aim of ultimately representing the entire Cloudflare configuration as a set of rules.</p><p>In the meantime, we look forward to your feedback and we are excited to see how far we can innovate.</p><p>.......</p><p><sup>1</sup>The Cloudflare Specials are rules written by the Cloudflare security team based on observing and protecting millions of web applications that sit behind the Cloudflare platform.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">6AIeoLfZmyryQ4aLh0qraK</guid>
            <dc:creator>Michael Tremante</dc:creator>
        </item>
        <item>
            <title><![CDATA[Protecting your APIs from abuse and data exfiltration]]></title>
            <link>https://blog.cloudflare.com/protecting-apis-from-abuse-and-data-exfiltration/</link>
            <pubDate>Wed, 24 Mar 2021 13:00:00 GMT</pubDate>
            <description><![CDATA[ API Shield is growing with new functionalities: Schema Validation generally available, Managed IP List, more controls to manage certificates, and Data Loss Prevention. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>API traffic is growing fast. Last year alone it grew 300% faster at our edge than web traffic. Because <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">APIs</a> power mobile and web applications, transmitting instructions as diverse as “order a pizza from my favourite restaurant using this credit card” or “place a cryptocurrency trade and these are my personal details”, they are ripe for data theft and abuse. Data exposure is listed as one of the top threats for API traffic by OWASP; this includes <a href="https://www.cloudflare.com/learning/access-management/what-is-dlp/%5D(https://owasp.org/www-project-api-security/)">data leaks</a>. The increase in API traffic and more frequent data attacks call for new security solutions.</p><p>Cloudflare’s security toolkit had always been designed to protect web and API traffic. However, after talking to hundreds of customers we realised that there is a need for easily deployed and configured security tools for API traffic in a single interface. To meet this demand, in October 2020 we launched <a href="/introducing-api-shield/">API Shield<sup>TM</sup></a>, a new product aimed at bringing together all security solutions designed for API traffic. We started by providing mTLS authentication to all Cloudflare users free of charge, gRPC support and Schema Validation in Beta. During the launch we laid a plan for future releases with more advanced security functionality. We are now thrilled to be able to expand our offering with new features designed to protect your APIs from exposing sensitive data.</p><p>Today we are launching four features to help reduce the impact of exfiltration attacks: Schema Validation for all Enterprise customers, a managed IP List allowing you to block traffic from Open Proxies, more control over the certificate lifecycle, and a Data Loss Prevention solution. Later this week, we’ll also announce capabilities to help you discover APIs running on your network that you may not be aware of, and ways to identify anomalous requests that deviate from intended uses.</p>
    <div>
      <h3>Schema Validation generally available</h3>
      <a href="#schema-validation-generally-available">
        
      </a>
    </div>
    <p>During the API Shield launch we introduced Schema Validation and we released it to a few selected customers. Over the last few months, we have been working with our early adopters to add more capabilities and build an easy-to-use interface directly into our dashboard. You can now navigate to the ‘API Shield’ tab where you can deploy <a href="https://www.cloudflare.com/application-services/solutions/api-security/">API security products</a> directly from the UI. The deployment flow will be expanded soon to include additional capabilities found elsewhere in the dashboard, such as mTLS and Rate Limiting. We will also be integrating new features such as API anomaly detection for an easy feedback loop.</p><p>Schema Validation works by creating a positive security model based on an API “schema”, which is a contract that defines the consumption of an API and guides developers to integrate it in their systems. Conversely to a negative security model (where rules define what characteristics a request must have to trigger an action, such as block), Schema Validation is designed to allow requests that have been verified as compliant while taking actions on everything else. Schema Validation accepts schemas that adhere to the OpenAPI v3 Specification (also known as Swagger Specification), which is the standard for defining RESTful interfaces (<a href="https://swagger.io/solutions/getting-started-with-oas/">learn more at this page</a>).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/OmEZLN8YahgdIHEHnTcUz/8189d6e36666fcf4871a26b68133b0bc/image2-32.png" />
            
            </figure><p>Schema Validation evaluates each request against an API Schema logging or blocking requests that do not comply with it.</p><p>API Shield offers an easy to use UI where users can upload their schemas to the Firewall and automatically create rules that validate each request against the API definition. If the request is compliant then it is forwarded to the origin. Conversely, if the format or data content of the request does not match what is expected by API Shield, the call is either logged or dropped protecting the origin from an invalid request or a malicious payload. Requests with extraneous input may not have been anticipated by the API developer, and they may trigger unforeseen application behaviour, such as a data leak.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5h8092G1mGzraEkcdPyJv/4942cf0aec4af6528d7689f12e250984/image6.gif" />
            
            </figure><p>API Shield with Schema Validation being deployed using the Cloudflare Rulesets OpenAPI schema.‌‌</p><p>The UI guides the user through different steps, including defining the hostname and base path of the API where API Shield will be deployed and uploading the schema file. Once API Shield with Schema Validation has been deployed, it is possible to inspect what endpoints have been parsed by the Firewall and what level of protection is being provided. In the review page, there are two groups of endpoints: protected and unprotected. The former lists all endpoints and methods whose schema is supported, the latter indicates any endpoint whose definition was either not supported or ambiguous. To avoid breaking traffic directed to endpoints not listed in the schema file, we include a final rule that matches traffic not directed to any of the protected endpoints.</p><p>Every time a non-compliant request is identified by Schema Validation and an action such as block or log is taken, a new event tagged with the source ‘API Shield’ is created and added to the Firewall logs. Users can access analytics and logs by visiting the Overview page where they can then drill down data using the flexibility of our GraphQL-powered dashboard.</p><p>Schema validation performs checks on the path, path variables, query parameters, headers, and cookies, and allows logging non-compliant traffic. Schema validation Beta is now broadly available to Enterprise customers — <a href="http://www.cloudflare.com/waf/api-shield">fill this form</a> to get access.</p>
    <div>
      <h3>Data Loss Prevention</h3>
      <a href="#data-loss-prevention">
        
      </a>
    </div>
    <p>Data loss is one of the biggest security concerns that affect small and large organisations, but it also has an impact on individuals and their privacy. Loss of sensitive data can have a massive impact on companies in terms of financial impact, brand value erosion, and compliance with the latest laws on data protection. Finally, loss of sensitive data belonging to individuals can have a detrimental effect in terms of monetary loss and privacy concerns.</p><p>Earlier today we announced our Data Loss Prevention (DLP) product suite; we’re now extending this to identify sensitive data leaving your origin in the response phase of an HTTP or API request. The solution evaluates the egress traffic, checking payloads against common patterns of sensitive data. These include personally identifiable information such as Social Security numbers and financial information, including credit card numbers, bank details, etc. For the first release, users will be able to log any match triggered by DLP. We are planning to add other actions such as obfuscating and blocking sensitive data leaving origins behind Cloudflare. Next, we intend to let customers customise the rules to identify sensitive data that are specific to their application.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/75ZzI5AZqM7QuBzVL2OPGU/28debb7198a5879580d888c7dd8d2f2d/DLP-Diagram.png" />
            
            </figure><p>We developed DLP with simplicity in mind so that every customer can be protected without requiring complex and time-consuming set up periods. We are releasing DLP as a managed ruleset that can be turned on through the Firewall Managed Rules tab. DLP can be used as part of the <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> of a reverse proxy, but it can also be used as part of Cloudflare for Teams integrating data protection in a <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> configuration. This tight integration enables better control on who can access sensitive information within your organization.</p><p>DLP is in beta and we are releasing it to selected early adopter customers. Please <a href="http://www.cloudflare.com/waf/api-shield">fill this form</a> to join the waitlist.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4bxKBybax9WBdQR4dN9fvY/8c50dc8ece2b84b5a27ca2a411a31bc2/image22-1.png" />
            
            </figure><p>Data Loss Protection can be turned on as a Managed Ruleset.</p>
    <div>
      <h3>Managed IP List: threat intelligence by Cloudflare</h3>
      <a href="#managed-ip-list-threat-intelligence-by-cloudflare">
        
      </a>
    </div>
    <p>We are launching our first Managed IP List which will be available for use within Firewall Rules. In July 2020 <a href="/introducing-ip-lists/">we released IP Lists</a>, which gave customers the ability to upload large lists of IPs that can be used when writing Firewall Rules. Today we are launching a list that is curated by Cloudflare and that customers can use in their rules exactly as they use custom uploaded Lists.</p><p>‘Cloudflare Open Proxies’ contains the IPs of Open SOCKS and HTTP Proxies determined by Cloudflare by analysing traffic at its edge. This is not just limited to API requests; rules can apply to all types of traffic being evaluated by the Firewall.</p><p>The list is the first feed we are making public based on Cloudflare threat intelligence that leverages the scale and reach of our network. How do we populate this list? We see requests from every publicly routable IP address on the Internet. Cloudflare combines open source lists with its large network to identify open proxies. After verifying the proxies, Cloudflare determines the exit IPs and creates a list. We then feed this reputation data back into our security systems and make it available to our customers in the form of a managed IP list.</p><p>The list is available to all Enterprise plans and it can be used by selecting ‘Cloudflare Open Proxies’ in the drop-down menu collecting all available IP Lists (see picture below).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/351zGO09M0BQM8yd1zyEMP/fea9df4c3a19d78b4cb6e6f64ca8e056/image3-29.png" />
            
            </figure><p>Cloudflare Open Proxies managed list can be used directly in the Firewall rule builder.</p>
    <div>
      <h3>More controls on client certificates</h3>
      <a href="#more-controls-on-client-certificates">
        
      </a>
    </div>
    <p>We launched mTLS with the first release of API Shield with mobile apps and IoT devices in mind. Enforcing strong authentication with client side certificates is a very effective measure to protect traffic from <a href="https://www.cloudflare.com/learning/security/what-is-data-exfiltration/">data exfiltration</a> and abuse in general. However, in the event of an IoT device or mobile phone being stolen, lost or having control taken over by a malicious actor, Cloudflare users need a way to revoke the certificate that is considered a potential security risk. Having the ability to permanently exclude traffic from compromised devices is an effective way to prevent data loss and malicious attacks.</p><p>Many of our customers who have started embedding API Shield certificates in their apps have implemented a revocation solution using Workers with Workers KV. Although this solution allows granular control on certificates, it does require significant development effort from our customers and does not scale easily.</p><p>For Security Week, we are releasing a fully managed solution to revoke (and restore) certificates without the need to write a single line of code. We built a straightforward interface to <a href="https://www.cloudflare.com/application-services/solutions/certificate-lifecycle-management/">manage the entire lifecycle of your certificates</a> at our edge, from issuance to revocation. We take care of this for you, so you can focus on building your application without having to worry about setting up a complex and costly Public Key Infrastructure (PKI) and managing the revocation of potentially risky devices. The customer touchpoints are a new ‘Revoke’ and ‘Restore’ button in the client certificate tab, its supporting API calls and a new field for Firewall Rules.</p><p>Each request presenting a certificate to the Cloudflare’s edge will have two Firewall fields set: cf.tls_client_auth.cert_verified and cf.tls_client_auth.cert_revoked. The request is processed by the Firewall where users can combine these fields with all other Firewall functionality. This allows customers to set different behaviours based on whether the certificate was verified or verified but revoked. It also allows you to implement the required security policy while providing a good experience for end users. A classic configuration is to allow only requests with a verified certificate, while forwarding requests from revoked certificates to a different page or endpoint to handle the exception as required by your users’ journey.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2qbEaiHnrixfMACbSlwQ1q/1a577d5929cf8116f53a6802664f9057/image5-28.png" />
            
            </figure><p>Users can revoke certificates by visiting the Client Certificates tab.</p>
    <div>
      <h3>What’s brewing</h3>
      <a href="#whats-brewing">
        
      </a>
    </div>
    <p>The Cloudflare team is working on releasing additional features under the API Shield umbrella. We are talking to hundreds of customers who are using Cloudflare for API traffic and three features come up as high priority: in-depth API Analytics, a more flexible Rate Limiting tool, and integration with API Anomaly Detection.</p><p>Schema Validation and Data Loss Prevention are released today with full integration in our logs and analytics engine. Going forward, we are planning to expand the ability to analyse traffic and provide customers with tools to identify and manage attacks specifically directed to API endpoints.</p><p>Cloudflare’s rate limiting is designed to work best for web traffic where you can write rules based on URLs and request methods. We are now working on integrating the power of Firewall Rules with the control provided by rate limiting. This will allow users to segment their traffic leveraging the powerful logic available in the Firewall. We are also extending the counting mechanism to include the ability to rate limit based on API key and User ID.</p><p>When targeting API traffic, attack patterns can vary greatly, making traditional Bot Management solutions not the ideal candidate to identify suspicious behaviour. On Friday we will announce two major features that focus on further protecting your applications: API Discovery and Anomaly Detection. Discovery allows customers to <a href="https://www.cloudflare.com/learning/learning/security/api/what-is-api-discovery/">map their endpoints</a> and get visibility on the surface area of their APIs. Anomaly Detection is Cloudflare’s solution to autonomously separate good API traffic from malicious activity reliably and at scale. Customers will be able to set this up along with mTLS, Schema Validation, and Rate Limiting to maximise level of protection. Check out our blog on Friday to learn more about these new products.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[API Shield]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[DLP]]></category>
            <guid isPermaLink="false">4d7kQnp5kXZVmrQFR7GtCp</guid>
            <dc:creator>Daniele Molteni</dc:creator>
        </item>
        <item>
            <title><![CDATA[Magic WAN & Magic Firewall: secure network connectivity as a service]]></title>
            <link>https://blog.cloudflare.com/magic-wan-firewall/</link>
            <pubDate>Mon, 22 Mar 2021 13:00:00 GMT</pubDate>
            <description><![CDATA[ Magic WAN provides secure, performant connectivity and routing for your entire corporate network, reducing cost and operational complexity. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Back in October 2020, we introduced <a href="/cloudflare-one/">Cloudflare One</a>, our vision for the future of <a href="https://www.cloudflare.com/learning/network-layer/network-security/">corporate networking and security</a>. Since then, we’ve been laser-focused on delivering more pieces of this platform, and today we’re excited to announce two of its most foundational aspects: <a href="http://www.cloudflare.com/magic-wan">Magic WAN</a> and Magic Firewall. Magic WAN provides secure, performant connectivity and routing for your entire corporate network, reducing cost and operational complexity. Magic Firewall integrates smoothly with Magic WAN, enabling you to enforce network firewall policies at the edge, across traffic from any entity within your network.</p>
    <div>
      <h3>Traditional network architecture doesn’t solve today’s problems</h3>
      <a href="#traditional-network-architecture-doesnt-solve-todays-problems">
        
      </a>
    </div>
    <p>Enterprise networks have historically adopted one of a few models, which were designed to enable <a href="https://www.cloudflare.com/learning/security/what-is-information-security/">secure information flow</a> between offices and data centers, with access to the Internet locked down and managed at <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">office perimeters</a>. As applications moved to the cloud and employees moved out of offices, these designs stopped working, and band-aid solutions like VPN boxes don’t solve the core problems with <a href="https://www.cloudflare.com/learning/network-layer/enterprise-networking/">enterprise network architecture</a>.</p><p>On the connectivity side, full mesh <a href="https://www.cloudflare.com/learning/network-layer/what-is-mpls/">MPLS (multiprotocol label switching) networks</a> are expensive and time consuming to deploy, challenging to maintain, exponentially hard to scale, and often have major gaps in visibility. Other architectures require backhauling traffic through central locations before sending it back to the source, which introduces unacceptable latency penalties and necessitates purchasing costly hub hardware for maximum capacity rather than actual utilization. And most customers we’ve talked to are struggling with the worst of both worlds: a combination of impossible-to-manage architectures stitched together over years or decades. Security architects also struggle with these models - they have to juggle a stack of security hardware boxes from different vendors and trade off cost, performance, and security as their network grows.</p>
    <div>
      <h3>Move your network perimeter to the edge and secure it as a service</h3>
      <a href="#move-your-network-perimeter-to-the-edge-and-secure-it-as-a-service">
        
      </a>
    </div>
    <p>With Magic WAN, you can securely connect any traffic source - data centers, offices, devices, cloud properties - to Cloudflare’s network and configure routing policies to get the bits where they need to go, all within one SaaS solution. Magic WAN supports a variety of on-ramps including <a href="https://www.cloudflare.com/learning/network-layer/what-is-gre-tunneling/">Anycast GRE tunnels</a>, <a href="https://www.cloudflare.com/network-interconnect/">Cloudflare Network Interconnect</a>, <a href="https://www.cloudflare.com/products/argo-tunnel/">Argo Tunnel</a>, <a href="/warp-for-desktop">WARP</a>, and a variety of <a href="/network-onramp-partnerships">Network On-ramp Partners</a>. No more MPLS expense or lead times, no more performance penalties from traffic trombones, and no more nightmare of managing a tangle of legacy solutions: instead, use Cloudflare’s global Anycast network as an extension of yours, and get better performance and visibility built-in.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2ld2gNBj2OfGU41qVEztvX/6bf3efaad900a825c9096e550eac8592/image4-21.png" />
            
            </figure><p>Once your traffic is connected to Cloudflare, how do you control which entities within your network are allowed to interact with each other, or the Internet? This is where Magic Firewall comes in. Magic Firewall allows you to centrally manage policy across your entire network, all at the edge as a service. Magic Firewall gives you fine-grained control over which data is allowed in and out of your network, or inside your network. Even better, you get visibility into exactly how traffic is flowing through your network from a single dashboard.</p><p>Magic WAN provides the foundation for the broad suite of functions included in Cloudflare One, which were all built in software from the ground up to scale and integrate smoothly. Magic Firewall is available for Magic WAN out of the box, and customers can easily activate additional <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust security</a> and performance features such as our <a href="https://www.cloudflare.com/teams/">Secure Web Gateway</a> with <a href="https://www.cloudflare.com/learning/access-management/what-is-browser-isolation/">remote browser isolation</a>, <a href="/one-more-zero-trust-thing-cloudflare-intrusion-detection/">Intrusion Detection System</a>, Smart Routing, and more.</p><blockquote><p><i>“Our network team is excited by Magic WAN. Cloudflare has built a global network-as-a-service platform that will help network teams manage complex edge and multi-cloud environments much more efficiently. Operating a single global WAN with built-in security and fast routing functionality — regardless of the HQ, data center, branch office, or end user location — is a game-changer in WAN technology.”— Sander Petersson, Head of Infrastructure, FlightRadar24</i></p></blockquote><p>What does this look like concretely? Let's explore some ways you can use Magic WAN and Magic Firewall to <a href="https://www.cloudflare.com/network-services/solutions/enterprise-network-security/">solve problems in enterprise networking and security</a> with an example customer, Acme Corp.</p>
    <div>
      <h3>Replace MPLS between branch offices &amp; data centers</h3>
      <a href="#replace-mpls-between-branch-offices-data-centers">
        
      </a>
    </div>
    <p>Today, Acme Corp has offices around the world that are each connected to regional data centers and to each other with MPLS. Each data center, which hosts corporate applications and a stack of hardware boxes to keep them secure, also has leased line connectivity to at least one other data center. Acme is also migrating some applications to the cloud, and they’re planning to establish direct connections from their data centers to cloud providers to boost security and reliability.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2YQH7Wz81UKrcKrHcpGzAd/a1cabec7843221b8150ab0d85e96a51e/image6-8.png" />
            
            </figure><p>As Acme has grown, one of their network team's most consistent pain points is managing and maintaining their MPLS connectivity. It's expensive and deployment requires long lead times, limiting Acme’s speed of expanding into new locations (especially internationally) or supporting offices added through acquisitions. Employees in Acme’s offices connecting to cloud providers and SaaS apps experience frustrating latency, since traffic hairpins through an Acme data center for security policies enforced through a stack of hardware boxes before being sent to its destination. <a href="https://www.cloudflare.com/learning/network-layer/what-is-branch-networking/">Traffic between offices</a>, such as IP telephony and video conferencing, doesn’t have any security policies applied to it, presenting a gap in Acme’s security posture.</p><p>Just as they're working on transitioning to the cloud for compute and storage, Acme wants to migrate away from these private links and instead leverage the Internet, securely, for connectivity. They considered establishing fully meshed site-to-site IPSec VPN tunnels over the Internet, but the complexity strained their networking team as well as their heterogeneous router deployments. Magic WAN is ready to meet them where they are today, simplifying network management and delivering immediate performance benefits, as well as enabling Acme's gradual transition away from MPLS.</p><p>In this example deployment with Magic WAN, Acme connects each office and VPC to Cloudflare with Anycast GRE tunnels. With this architecture, Acme only needs to set up a single tunnel for each site/Internet connection in order to automatically receive connectivity to Cloudflare's entire global network (200+ cities in 100+ countries around the world) - like a hub and spoke architecture, except the hub is everywhere. Acme also chooses to establish dedicated private connectivity from their data centers with <a href="https://www.cloudflare.com/network-interconnect/">Cloudflare Network Interconnect</a>, enabling even more secure and reliable traffic delivery and great connectivity to other networks/cloud providers through Cloudflare’s <a href="https://www.peeringdb.com/net/4224">highly interconnected</a> network.</p><p>Once these tunnels are established, Acme can configure allowed routes for traffic within their private network (RFC 1918 space), and Cloudflare gets the traffic where it needs to go, providing resiliency and traffic optimization. With an easy setup process that takes only a few hours, Acme Corp can start their migration away from MPLS. And as new Cloudflare One capabilities like QoS and Argo for Networks are introduced, Acme’s network performance and reliability will continue to improve.</p>
    <div>
      <h3>Secure remote employee access to private networks</h3>
      <a href="#secure-remote-employee-access-to-private-networks">
        
      </a>
    </div>
    <p>When Acme Corp's employees abruptly transitioned to working remotely last year due to the COVID-19 pandemic, Acme's IT organization scrambled to find short term fixes to maintain employee access to internal resources. Their legacy VPNs didn't hold up - Acme employees working from home struggled with connectivity, reliability, and performance issues as appliances were pushed beyond the limits they were designed for.</p><p>Thankfully, there's a better solution! Acme Corp can use Cloudflare for Teams and Magic WAN to provide a secure way for employees to access resources behind private networks from their devices, wherever they're working. Acme employees install the WARP client on their devices to send traffic to Cloudflare's network, where it can be authenticated and routed to private resources in data centers or VPCs that are connected to Cloudflare via GRE tunnel (shown in the previous example), Argo Tunnel, Cloudflare Network Interconnect, or IPSec (coming soon). This architecture solves the performance and capacity issues Acme experienced with their legacy VPNs - rather than sending all traffic through single choke point devices, it’s routed to the closest Cloudflare location where policy is applied at the edge before being sent along an optimized path to its destination.</p><p>Traffic from Acme Corp's employee devices, data centers and offices will also be able to be policed by Magic Firewall for powerful, granular policy control that's enforced across all "on-ramps." Whether employees are connecting from their phones and laptops or working from Acme offices, the same policies can be applied in the same place. This simplifies configuration and improves visibility for Acme's IT and security teams, who will be able to log into the Cloudflare dashboard to see and control policies in one place - a game changer compared to managing employee access across different VPNs, firewalls, and cloud services.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2bKIu94AdaXlZTDHf9gJWE/40358ef29ee33fc3875213ff613556e4/image2-22.png" />
            
            </figure><p>This solution allows Acme to transition away from their VPN, firewall, and <a href="https://www.cloudflare.com/learning/access-management/what-is-a-secure-web-gateway/">secure web gateway appliances</a>, improving performance and enabling easy policy management across traffic from wherever their employees are working.</p>
    <div>
      <h3>Migrate network and security functions to the edge</h3>
      <a href="#migrate-network-and-security-functions-to-the-edge">
        
      </a>
    </div>
    <p>Historically, Acme relied on stacks of hardware appliances in physical offices and data centers to enforce <a href="https://www.cloudflare.com/network-security/">network security</a> and get visibility into what’s happening on the network: specialized firewalls to inspect inbound or outbound traffic, intrusion detection systems and <a href="https://www.cloudflare.com/learning/security/what-is-siem/">SIEMs</a>. As their organization is moving to the cloud and rethinking the future of remote work, the Acme security team is looking for sustainable solutions that improve security, even beyond what used to be possible in their traditional castle-and-moat architecture.</p><p>Previously, we walked through how Acme could configure Magic WAN to send traffic from offices, data centers, cloud properties, and devices to Cloudflare’s network. Once this traffic is flowing through Cloudflare, it’s easy to add access controls and filtering functions to augment or replace on-prem security hardware, all delivered and administered through a single pane of glass.</p><p>With Magic Firewall, customers get a single <a href="https://www.cloudflare.com/learning/cloud/what-is-a-cloud-firewall/">firewall-as-a-service</a> that runs at the edge, replacing clunky boxes they have installed at branch offices or data centers. Magic Firewall allows them to easily manage configuration, but also simplifies compliance auditing.</p><p>To <a href="https://www.cloudflare.com/learning/access-management/what-is-access-control/">control access</a>, customers can put policies in place that determine exactly which traffic is allowed to go where. For example, Acme wants traffic to flow from the Internet to their web servers inside data centers on port 80 and 443, but wants to lock down <a href="https://www.cloudflare.com/learning/access-management/what-is-ssh/">SSH access</a> to only certain private networks inside branch offices.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4GEELEJG2qGSpnjGhgk4Mw/d774989e74069792cf14ce52c01a943e/image1-29.png" />
            
            </figure><p>If Acme wants to go further in locking down their network, they can adopt a Zero Trust access model  with <a href="https://www.cloudflare.com/teams/access/">Access</a> and <a href="https://www.cloudflare.com/teams/gateway/">Gateway</a> to control who can reach what, and how, across all their traffic flowing through the Cloudflare network. As Cloudflare releases new filtering and control functions, like our upcoming IDS/IPS and DLP solutions, Acme can enable them to further increase security with only a few clicks.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3aWN98JS4FlEiH4enUx9QP/58caec3717efc9b5851dd7e98cdc3a83/image5-22.png" />
            
            </figure><p>Acme’s long-term goal is to transition all security and performance functions to the cloud, consumed as a service. Magic WAN enables a smooth path for this migration, allowing them to gradually deepen their security posture as they retire legacy hardware.</p><blockquote><p><i>Increased cloud adoption along with the recent pivot to remote workers has increased the volume of Internet, SaaS, and IaaS traffic straining traditional network architectures such as MPLS. WAN architectures that offer a global scale, integrated enterprise network security functions, and direct, secure connectivity to remote users are key to organizations looking to increase their operational agility and lower total costs of ownership.— Ghassan Abdo, IDC Research VP, WW Telecom, Virtualization &amp; CDN</i></p></blockquote>
    <div>
      <h3>Cloudflare’s network as an extension of yours</h3>
      <a href="#cloudflares-network-as-an-extension-of-yours">
        
      </a>
    </div>
    <p>Like many of our products, Cloudflare One started as a collection of solutions to problems that we experienced in growing and securing our own network. Magic WAN and Magic Firewall allow us to extend the benefits of our careful architecture decisions over the past ten years to customers:</p><ul><li><p><b>Global scale &amp; close to eyeballs:</b> wherever your offices, data centers, and users are, we’re close by. We’ve worked hard to establish great connectivity to eyeball networks because of our CDN business, which pays dividends for remote workers who need great connectivity from their homes back to your network. It also means we can stop threats at the edge, close to their source, rather than running the risk of malicious traffic overwhelming capacity-limited on prem appliances.</p></li><li><p><b>Hardware and carrier-agnostic:</b> use whatever hardware you have today to connect to us, and get the benefits of resiliency afforded by our diverse carrier connectivity.</p></li><li><p><b>Built from scratch to work together:</b> we’ve developed our products in software, from the ground up, to integrate easily. We think constantly about how our products can integrate to make each other better as they’re created and evolved.</p></li></ul>
    <div>
      <h3>Get started today</h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>Magic WAN is available in limited beta, and Magic Firewall is generally available for all <a href="https://www.cloudflare.com/magic-transit">Magic Transit</a> customers and included out of the box with Magic WAN. If you’re interested in testing out Magic WAN or want to learn more about how Cloudflare can help your organization replace legacy MPLS architecture, <a href="https://www.cloudflare.com/products/zero-trust/remote-workforces/">secure access for remote workers</a>, and deepen your security posture while reducing total cost of ownership, please <a href="https://www.cloudflare.com/magic-wan">get in touch</a>.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Network]]></category>
            <guid isPermaLink="false">wjmDtPvG1qvzkh0fZl7mo</guid>
            <dc:creator>Achiel van der Mandele</dc:creator>
            <dc:creator>Annika Garbers</dc:creator>
        </item>
        <item>
            <title><![CDATA[Using HPKE to Encrypt Request Payloads]]></title>
            <link>https://blog.cloudflare.com/using-hpke-to-encrypt-request-payloads/</link>
            <pubDate>Fri, 19 Feb 2021 12:00:00 GMT</pubDate>
            <description><![CDATA[ Allowing users to securely log parts of the request that match firewall rules while making it impossible for anyone else to decrypt. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Managed Rules team was recently given the task of allowing Enterprise users to <a href="/encrypt-waf-payloads-hpke/">debug Firewall Rules</a> by viewing the part of a request that matched the rule. This makes it easier to determine what specific attacks a rule is stopping or why a request was a false positive, and what possible refinements of a rule could improve it.</p><p>The fundamental problem, though, was how to securely store this debugging data as it may contain sensitive data such as personally identifiable information from submissions, cookies, and other parts of the request. We needed to store this data in such a way that <b>only</b> the user who is allowed to access it can do so. Even Cloudflare shouldn't be able to see the data, following our philosophy that any personally identifiable information that passes through our network is a <a href="/welcome-to-privacy-and-compliance-week/">toxic asset</a>.</p><p>This means we needed to encrypt the data in such a way that we can allow the user to decrypt it, but not Cloudflare. This means <a href="https://www.cloudflare.com/learning/ssl/how-does-public-key-encryption-work/">public key encryption</a>.</p><p>Now we needed to decide on which encryption algorithm to use. We came up with some questions to help us evaluate which one to use:</p><ul><li><p>What requirements do we have for the algorithm?</p></li><li><p>What language do we implement it in?</p></li><li><p>How do we make this as secure as possible for users?</p></li></ul><p>Here's how we made those decisions.</p>
    <div>
      <h3>Algorithm Requirements</h3>
      <a href="#algorithm-requirements">
        
      </a>
    </div>
    <p>While we knew we needed to use <a href="https://www.cloudflare.com/learning/ssl/how-does-public-key-encryption-work/">public key encryption</a>, we also needed to keep an eye on performance. This led us to select <a href="https://tools.ietf.org/html/draft-irtf-cfrg-hpke-06">Hybrid Public Key Encryption</a> (HPKE) early on as it has a best-of-both-worlds approach to using symmetric as well as public-key cryptography to increase performance. While these best-of-both-worlds schemes aren’t new [<a href="https://nacl.cr.yp.to/box.html">1</a>][<a href="https://github.com/google/tink">2</a>][<a href="https://age-encryption.org/">3</a>], HPKE aims to provide a single, future-proof, robust, interoperable combination of a general key encapsulation mechanism and a symmetric encryption algorithm.</p><p>HPKE is an emerging standard developed by the Crypto Forum Research Group (CFRG), the research body that supports the development of Internet standards at the <a href="http://ietf.org">IETF. The CFRG</a> produces specifications called RFCs (such as <a href="https://tools.ietf.org/html/rfc7748">RFC 7748</a> for elliptic curves) that are then used in higher level protocols including two we talked about previously: <a href="/oblivious-dns/">ODoH</a> and <a href="/encrypted-client-hello/">ECH</a>. Cloudflare has long been a supporter of Internet standards, so HPKE was a natural choice to use for this feature. Additionally, HPKE was co-authored by one of our colleagues at Cloudflare.</p>
    <div>
      <h3>How HPKE Works</h3>
      <a href="#how-hpke-works">
        
      </a>
    </div>
    <p>HPKE combines an asymmetric algorithm such as <a href="https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman">elliptic curve Diffie-Hellman</a> and a symmetric cipher such as AES. One of the upsides of HPKE is that the algorithms aren't dictated to the implementer, but making a combination that’s <a href="https://en.wikipedia.org/wiki/Provable_security#In_cryptography">provably secure</a> and meets the developer’s intuitive notions of security is important. All too often developers reach for a scheme without carefully understanding what it does, resulting in security vulnerabilities.</p><p>HPKE solves these problems by providing a high level of security in a generic manner and providing necessary hooks to tie messages to the context in which they are generated. This is the application of decades of research into the correct security notions and schemes.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/d6wSZdRKA3sg9R7181Rc3/6f61f19999611103d51ee2f394caa00d/image2-13.png" />
            
            </figure><p>HPKE is built in stages. First it turns a Diffie-Hellman key agreement into a Key Encapsulation Mechanism. A key encapsulation mechanism has two algorithms: Encap and Decap. The Encap algorithm creates a symmetric secret and wraps it in a public key, so that only the holder of the private key can unwrap it. An attacker with the encapsulation cannot recover the random key. Decap takes the encapsulation and the private key associated to the public key, and computes the same random key. This translation gives HPKE the flexibility to work almost unchanged with any kind of public key encryption or key agreement algorithm.</p><p>HPKE mixes this key with an optional info argument, as well as information relating to the cryptographic parameters used by each side. This ensures that attackers cannot modify messages’ meaning by taking them out of context. A postcard marked “So happy to see you again soon” is ominous from the dentist and endearing from one’s grandmother.</p><p>The specification for HPKE is open and available on the <a href="https://tools.ietf.org/html/draft-irtf-cfrg-hpke-06">IETF website</a>. It is on its way to becoming an RFC after passing multiple rounds of review and analysis by cryptography experts at the CFRG. HPKE is already gaining adoption in IETF protocols like ODoH, ECH, and the new <a href="https://messaginglayersecurity.rocks/">Messaging Layer Security (MLS)</a> protocol. HPKE is also designed with the <a href="/securing-the-post-quantum-world/">post-quantum future</a> since it is built to work with any KEM, including <a href="https://csrc.nist.gov/News/2020/pqc-third-round-candidate-announcement">all the NIST finalists for post-quantum</a> public-key encryption.</p>
    <div>
      <h3>Implementation Language</h3>
      <a href="#implementation-language">
        
      </a>
    </div>
    <p>Once we had an encryption scheme selected, we needed to settle on an implementation. HPKE is still fairly new, so the libraries aren't quite mature yet. There is a <a href="https://github.com/cisco/go-hpke">reference implementation</a>, and we’re in the process of developing an implementation in Go as part of <a href="https://github.com/cloudflare/circl">CIRCL</a>. However, in the absence of a clear "go to" that is widely known to be the best, we decided to go with <a href="https://github.com/rozbb/rust-hpke">an implementation</a> leveraging the same language already powering much of the Firewall code running at the Cloudflare edge - <a href="/building-fast-interpreters-in-rust/">Rust</a>.</p><p>Aside from this, the language benefits from features like native primitives, and crucially the ability to easily compile to <a href="https://developer.mozilla.org/en-US/docs/WebAssembly">WebAssembly (WASM)</a>.</p><p>As we mentioned in a <a href="/encrypt-waf-payloads-hpke/">previous blog post</a>, customers are able to generate a key pair and decrypt payloads either from the dashboard UI or from a CLI. Instead of writing and maintaining two different codebases for these, we opted to reuse the same implementation across the edge component that encrypts the payloads and the UI and CLI that decrypt them. To achieve this we compile our library to target WASM so it can be used in the dashboard UI code that runs in the browser. While this approach may yield a slightly larger JavaScript bundle size and relatively small computational overhead, we found it preferable to spending a significant amount of time securely re-implementing HPKE using JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API">WebCrypto</a> primitives.</p><p>The HPKE implementation we decided on comes with the caveat of not yet being formally audited, so we performed our own internal security review. We analyzed the cryptography primitives being used and the corresponding libraries. Between the composition of said primitives and secure programming practices like correctly zeroing memory and safe usage of random number generators, we found no security issues.</p>
    <div>
      <h3>Making It Secure For Users</h3>
      <a href="#making-it-secure-for-users">
        
      </a>
    </div>
    <p>To encrypt on behalf of users, we need them to provide us with a public key. To make this as easy as possible, we built a CLI tool along with the ability to do it right in the browser. Either option allows the user to generate a public/private key pair without needing to talk to Cloudflare servers at all.</p><p>In our API, we specifically do not accept the private key of the key pair — we don't want it! We don't need and don't want to be able to decrypt the data we're storing.</p><p>For the dashboard, once the user provides the private key for decryption, the key is held in a temporary JavaScript variable and used for the in-browser decryption. This allows the user to not constantly have to provide the key while browsing the Firewall event logs. The private key is also not persisted in any way in the browser, so any action that refreshes the page such as refreshing or navigating away will require the user to provide the key again. We believe this is an acceptable usability compromise for better security.</p>
    <div>
      <h3>How Payload Extraction Works</h3>
      <a href="#how-payload-extraction-works">
        
      </a>
    </div>
    <p>After deciding how to encrypt the data, we just had to figure out the rest of the feature: what data to encrypt, how to store and transmit it, and how to allow users to decrypt it.</p><p>When an HTTP request reaches the L7 Firewall, it is evaluated against a set of rulesets. Each of these rulesets contain several rules written in the <a href="https://github.com/cloudflare/wirefilter">wirefilter</a> syntax.</p><p>An example of one such rule would be:</p>
            <pre><code>http.request.version eq "HTTP/1.1"
and
(
    http.request.uri.path matches "\n+."
    or
    http.request.uri.query matches "\x00+."
)</code></pre>
            <p>This expression evaluates to a boolean “true” for HTTP/1.1 requests that either contain one or more newlines followed by a character in the request path or one or more NULL bytes followed by a character in the query string.</p><p>Say we had the following request that would match the rule above:</p>
            <pre><code>GET /cms/%0Aadmin?action=%00post HTTP/1.1
Host: example.com</code></pre>
            <p>If matched data logging is enabled, the rules that match would be executed again in a special context that tags all fields that are accessed during execution. We do this second execution because this tagging adds a noticeable computational overhead, and since the vast majority of requests don't trigger a rule at all we would be unnecessarily adding overhead to each request. Requests that do match any rules will only match a few rules as well, so we don't need to re-execute a large portion of the ruleset.</p><p>You may notice that although <code>http.request.uri.query matches "\x00+."</code> evaluates to <code>true</code> for this request, it won’t be executed, because the expression short-circuits with the first <code>or</code> condition that also matches. This results in only <code>http.request.version</code> and <code>http.request.uri.path</code> being tagged as accessed:</p>
            <pre><code>http.request.version -&gt; HTTP/1.1
http.request.uri.path -&gt; /cms/%0Aadmin</code></pre>
            <p>Having gathered the fields that were accessed, the Firewall engine does some post-processing; removing fields that are a subset of others (e.g., the query string and the full URI), or truncating fields that are beyond a certain character length.</p><p>Finally, these get serialized as JSON, encrypted with the customer's public key, serialized again as a set of bytes, and prefixed with a version number should we need to change/update it in the future. To simplify consumption of these blobs, our APIs display a base64 encoded version of the bytes:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3GszxT7kezPhIz3olZ7NRG/5e5468f1d414682c3279c9f427c92dfa/image3-8.png" />
            
            </figure><p>Now that we have encrypted the data at the edge and persisted it in <a href="/tag/clickhouse/">ClickHouse</a>, we need to allow users to decrypt it. As part of the setup of turning this feature on, users generated a key-pair: the public key which was used to encrypt the payloads and a private key which is used to decrypt them. Decryption is done completely offline via either the command line using <a href="https://github.com/cloudflare/matched-data-cli">cloudflare/matched-data-cli</a>:</p>
            <pre><code>$ MATCHED_DATA=AkjQDktMX4FudxeQhwa0UPNezhkgLAUbkglNQ8XVCHYqPgAAAAAAAACox6cEwqWQpFVE2gCFyOFsSdm2hCoE0/oWKXZJGa5UPd5mWSRxNctuXNtU32hcYNR/azLjsGO668Jwk+qCdFvmKjEqEMJgI+fvhwLQmm4=
$ matched-data-cli decrypt -d $MATCHED_DATA -k $PRIVATE_KEY
{"http.request.version": "HTTP/1.1", "http.request.uri.path": "/cms/%0Aadmin"}</code></pre>
            <p>Or the dashboard UI:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4S6H5u9SqEUrWDRRnYnCS/18a59db043aab89967c898bf87185151/image1-7.png" />
            
            </figure><p>Since our CLI tool is open-source and HPKE is interoperable, it can also be used in other tooling as part of a user's logging pipeline, for example in security information and event management (SIEM) software.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>This was a team effort with help from our Research and Security teams throughout the process. We relied on them for recommendations on how best to evaluate the algorithms as well as vetting the libraries we wanted to use.</p><p>We're very pleased with how HPKE has worked out for us from an ease-of-implementation and performance standpoint. It was also an easy choice for us to make due to its impending standardization and best-of-both-worlds approach to security.</p>
    <div>
      <h3>Watch it on Cloudflare TV</h3>
      <a href="#watch-it-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div>
<p></p> ]]></content:encoded>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[WAF Rules]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Cryptography]]></category>
            <guid isPermaLink="false">2D6DVPVrqbmzOVwOsplIix</guid>
            <dc:creator>Miguel de Moura</dc:creator>
            <dc:creator>Andre Bluehs</dc:creator>
        </item>
        <item>
            <title><![CDATA[Holistic web protection: industry recognition for a prolific 2020]]></title>
            <link>https://blog.cloudflare.com/cloudflare-named-the-innovation-leader-in-holistic-web-protection/</link>
            <pubDate>Thu, 14 Jan 2021 17:00:20 GMT</pubDate>
            <description><![CDATA[ Today we’re excited to announce that Frost & Sullivan has named Cloudflare the Innovation Leader in their Frost Radar™: Global Holistic Web Protection Market Report. ]]></description>
            <content:encoded><![CDATA[ <p>I love building products that solve real problems for our customers. These days I don’t get to do so as much directly with our Engineering teams. Instead, about half my time is spent with customers listening to and learning from their security challenges, while the other half of my time is spent with other Cloudflare Product Managers (PMs) helping them solve these customer challenges as simply and elegantly as possible. While I miss the deeply technical engineering discussions, I am proud to have the opportunity to look back every year on all that we’ve shipped across our application security teams.</p><p>Taking the time to reflect on what we’ve delivered also helps to reinforce my belief in the Cloudflare approach to shipping product: release early, stay close to customers for feedback, and iterate quickly to deliver incremental value. To borrow a term from the investment world, this approach brings the benefits of <a href="https://www.ellevest.com/magazine/investing/compounding-returns"><i>compounded</i> returns</a> to our customers: we put new products that solve real-world problems into their hands as quickly as possible, and then reinvest the proceeds of our shared learnings immediately back into the product.</p><p>It is these sustained investments that allow us to release a flurry of small improvements over the course of a year, and be recognized by leading industry analyst firms for the capabilities we’ve accumulated and distributed to our customers. Today we’re excited to announce that Frost &amp; Sullivan has named Cloudflare the Innovation Leader in their <a href="https://www.cloudflare.com/lp/frost-radar-holistic-web/">Frost Radar™: Global Holistic Web Protection Market Report</a>. Frost &amp; Sullivan’s view that this market “will gradually absorb the markets formed around legacy and point solutions” is consistent with <a href="https://www.sec.gov/Archives/edgar/data/1477333/000119312519222176/d735023ds1.htm">our view of the world</a>, and we’re leading the way in “the consolidation of standalone WAF, DDoS mitigation, and Bot Risk Management solutions” they believe is “poised to happen before 2025”.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5Nd202DDxdKpbpRW2Zkrhe/7af782d5be18980571daaf8b160a5fd5/image4-10.png" />
            
            </figure><p>Image © 2020 Frost &amp; Sullivan from Frost Radar™: Global Holistic Web Protection Market Report</p><p>We are honored to receive this recognition, based on the analysis of 10 providers’ competitive strengths and opportunities as assessed by Frost &amp; Sullivan. The rest of this post explains some of the capabilities that we shipped in 2020 across our Web Application Firewall (WAF), Bot Management, and Distributed Denial-of-Service product lines—the scope of Frost &amp; Sullivan’s report. Get a copy of the Frost &amp; Sullivan Frost Radar report to see why Cloudflare was named the Innovation Leader <a href="https://www.cloudflare.com/lp/frost-radar-holistic-web/">here</a>.</p>
    <div>
      <h3>2020 Web Security Themes and Roundup</h3>
      <a href="#2020-web-security-themes-and-roundup">
        
      </a>
    </div>
    <p>Before jumping into specific product and feature launches, I want to briefly explain how we think about building and delivering our web security capabilities. The most important “product” by far that’s been built at Cloudflare <a href="/welcome-to-birthday-week-2020/">over the past 10 years</a> is the massive global network that moves bits securely around the world, as close to the speed of light as possible. Building our features atop this network allows us to reject the legacy tradeoff of performance <i>or</i> security. And equipping customers with the ability to <a href="/cloudflare-workers-serverless-week/">program and extend the network with Cloudflare Workers</a> and <a href="/announcing-firewall-rules/">Firewall Rules</a> allows us to focus on quickly delivering useful security primitives such as functions, operators, and ML-trained data—then later packaging them up in streamlined user interfaces.</p><p>We talk internally about building up the “toolbox” of security controls so customers can express their desired security posture, and that’s how we think about many of the releases over the past year that are discussed below. We begin by providing the saw, hammer, and nails, and let expert builders construct whatever defenses they see fit. By watching how these tools are put to use and observing the results of billions of attempts to evade the erected defenses, we learn how to improve and package them together as a whole for those less inclined to build from components. Most recently we did this with <a href="/introducing-api-shield/">API Shield</a>, providing a guided template to create “positive security” models within Firewall Rules using <a href="https://developers.cloudflare.com/firewall/cf-firewall-language/fields">existing primitives</a> plus new data structures for strong authentication such as Cloudflare-managed client <a href="https://www.cloudflare.com/application-services/products/ssl/">SSL/TLS certificates</a>. Each new tool added to the toolbox increases the value of the existing tools. Each new web request—good or bad—improves the models that our threat intelligence and Bot Management capabilities depend upon.</p>
    <div>
      <h3>Web application firewall (WAF) usability at scale</h3>
      <a href="#web-application-firewall-waf-usability-at-scale">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5zYZ7oR2sLCI1liN7iI6YQ/f4ba1d92208bc6f5714488af25a5b0e2/image3-6.png" />
            
            </figure><p>Last year we spoke with many customers about our plan to decouple configuration from the zone/domain model and allow rules to be set for arbitrary paths and groups of services across an account. In 4Q2020 we put this granular control in the hands of a few developers and some of our most sophisticated enterprise customers, and we’re currently collecting and incorporating feedback before defaulting the capabilities on for new customers.</p><p>Rules are great, especially with increased flexibility, but without data structures and request enrichment at the edge (such as the Bot Management techniques described below) they cannot act on anything beyond static properties of the request. In 3Q2020 we <a href="/introducing-ip-lists/">released our IP Lists capabilities</a> and customers have been steadily uploading their home-grown and third-party subscription lists. These lists can be referenced anywhere in a customer’s account as named variables and then combined with all other attributes of the request, even Bot Management scores, e.g., http.request.uri.path contains “/login” and (not ip.src in $pingdom_probes and cf.bot_management.score &lt; 30) is a Firewall Rule filter that blocks all bots except Pingdom from accessing the login endpoint.</p><p>Requests that are blocked or challenged need to find their way as quickly as possible to our customers’ SOCs for triage, investigation and, occasionally, incident response, so we upgraded our edge-logging framework in 2Q2020 to <a href="/stream-firewall-events-directly-to-your-siem/">push real time security-specific logs directly to customer SIEMs</a>. And in 4Q2020, we released the ability to encrypt sensitive payloads within these logs <a href="/encrypt-waf-payloads-hpke/">using customer-provided encryption keys and novel encryption algorithms</a> termed “Hybrid Public Key Encryption” (HPKE), and a <a href="/introducing-the-cloudflare-data-localization-suite/">data localization suite</a> to provide control over where our customers’ data is stored and protected.</p><p>Built predominantly in 4Q2020 and currently being tested in the Firewall Rules engine is a brand new implementation of our Rate Limiting engine. By moving this matching and enforcement logic from a standalone tool to a component within a <a href="/how-we-made-firewall-rules/">performant, memory-safe, expressive engine built in Rust</a>, we have increased the utility of existing functions. Additional examples of improving this library of capabilities include the work completed in 1Q2020 to <a href="https://developers.cloudflare.com/firewall/cf-firewall-language/functions#overview">add HMAC functions</a> and regex-based <a href="https://developers.cloudflare.com/firewall/cf-firewall-language/fields#http-header-fields">HTTP header</a> and <a href="https://developers.cloudflare.com/firewall/cf-firewall-language/fields#http-body-fields">body inspection</a> to the engine.</p>
    <div>
      <h3>Bots and machine learning (ML)</h3>
      <a href="#bots-and-machine-learning-ml">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5KEBq46aNERzVkijgMpgnS/03bff5bda74c4e820abbd09e65eefd54/image2-3.png" />
            
            </figure><p>In addition to making edge data sets accessible for request evaluation, we continued to invest heavily within our Bot Management team to provide actionable data so that our customers could decide what (if any) automated traffic they wanted to allow to interact with their applications. Our highest priority for Bot research and development has always been efficacy, and last year was no different. A significant portion of our engineering effort was dedicated to our detection engines — both updating and iterating on existing systems or creating entirely new detection engines from scratch.</p><p>In 1Q2020 we completed a total rewrite of our Machine Learning engine, and are continually focused on improving the efficacy of our ML engines. To do this, we draw on one of our major competitive advantages: the massive amount of data flowing through Cloudflare’s network. The early 2020 upgrade to our ML model nearly doubled the number of features we use to evaluate and score requests. And to help customers better understand why requests are flagged as bots, we have recently complemented the bot likelihood score in our logs with attribution to the specific engine that generated the score.</p><p>Also in 1Q2020, we upgraded our behavioral analysis engine to incorporate more features and increase overall accuracy. This engine conducts histogram-based outlier scoring and is now fully deployed to nearly all Bot Management zones.</p><p>In 2Q2020, we developed a lightweight JavaScript element that further advanced our browser fingerprinting capabilities and aids in detection. Specifically, we now silently challenge browsers and detect if a browser is misrepresenting its User Agent. This technique will be incorporated into our ML models and combined with our heuristics engine for more accurate browser fingerprinting. This feature is entirely optional and can be enabled or disabled by customers through our UI and API. Customers with extremely performance sensitive zones or traffic types that are unsuitable for JavaScript (such as API or some mobile app traffic) can still be accurately scored by our Bot Management engine.</p><p>In addition to detection, we also spent (and will continue to spend) engineering effort on mitigation. Our entire JavaScript and <a href="/moving-from-recaptcha-to-hcaptcha/">CAPTCHA challenge</a> platform was rewritten in the last year and deployed to our customer zones in a staged fashion in the second half of 2020. Our new platform is faster and more robust at detecting automated systems attempting to solve the challenges. More importantly, this platform allows us to further invest in new challenge types and modes as we enter 2021.</p><p>The biggest and most well received feature released in 2020 was our <a href="/introducing-bot-analytics/">dedicated Bot Management analytics</a>, released in 3Q2020. We now present informative graphs that double as diagnostic tools. Customers have found that analytics are far more than interesting charts and statistics: in the case of Bot Management, analytics are essential to spotting and subsequently eliminating false positives.</p><p>Last but definitely not least, we <a href="/deprecating-cfduid-cookie/">announced the deprecation of the __cfduid cookie</a> in 4Q2020 which was used primarily to detect bots but caused confusion for some customers including questions about whether they needed to display a <a href="https://www.cloudflare.com/learning/privacy/what-are-cookies/">cookie</a> banner because of what we do.</p><p>To get a sense of the Bot Attack trends we saw in the first half of 2020, take a read through <a href="/bot-attack-trends-for-jan-jul-2020/">this blog post</a>. And if you’re curious about how our ML models and heuristic engines work to keep your properties safe, this <a href="/cloudflare-bot-management-machine-learning-and-more/">deep dive</a> by Alex Bocharov, Machine Learning Tech Lead on the Bots team, is an excellent guide.</p>
    <div>
      <h3>API and IoT security and protection</h3>
      <a href="#api-and-iot-security-and-protection">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4GYNbUKISexzB8PpGBRzzK/7628a4687a3e4d538ed936991b9bcad4/image5-3.png" />
            
            </figure><p>At the beginning of 4Q2020, we released a product called <a href="/introducing-api-shield/">API Shield</a> that was purpose built to secure, protect, and accelerate API traffic — and will eventually provide much of the common functionality expected in traditional API Gateways. The UI for API Shield was built on top of Firewall Rules for maximum flexibility, and will serve as the jump-off point for configuring additional API security features we have planned this year.</p><p>As part of API Shield, every customer now gets a fully managed, domain-scoped private CA generated for each of their zones, and we plan to continue working closely with the SSL/TLS team to expand CA management options based on feedback. Since the release, we’ve seen great adoption from in particular IoT companies focused on locking down their APIs using short-lived client certificates distributed out to devices. Customers can also now upload OpenAPI schemas to be matched against incoming requests from these devices, with bad requests being dropped at the edge rather than passed on to origin infrastructure.</p><p>Another capability we released in 4Q2020 was <a href="/announcing-grpc/">support for gRPC-based API traffic</a>. Since that release, customers have expressed significant interest in using Cloudflare as a secure API gateway between easy-to-use customer-facing JSON endpoints and internal-facing gRPC or GraphQL endpoints. Like most customer challenges at Cloudflare, early adopters are looking to solve these use cases initially with Cloudflare Workers, but we’re keeping an eye on whether there are aspects for which we’ll want to provide first-class feature support.</p>
    <div>
      <h3>Distributed Denial-of-Service (DDoS) protections for web applications and APIs</h3>
      <a href="#distributed-denial-of-service-ddos-protections-for-web-applications-and-apis">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1pXLkySFtelZn124hOnGx0/cf907be1f59e5c3f69d77789f1f80715/image1-6.png" />
            
            </figure><p>The application-layer security of a web application or API is of minimal importance if the service itself is not available due to a persistent DDoS attack at L3-L7. While mitigating such attacks has long been one of Cloudflare’s strengths, <a href="/beat-an-acoustics-inspired-ddos-attack/">attack methodologies evolve</a> and we continued to invest heavily in 2020 to drop attacks more quickly, more efficiently, and more precisely; as a result, automatic mitigation techniques are applied immediately and most malicious traffic is blocked in less than 3 seconds.</p><p>Early in 2020 we responded to a <a href="/rolling-with-the-punches-shifting-attack-tactics-dropping-packets-faster-cheaper-at-the-edge/#edge-analyzed-edge-enforced-mitigations">persistent increase in smaller, more localized attacks</a> by fine-tuning a system that can autonomously detect attacks on any server in any datacenter. In the month prior to us first posting about this tool, it mitigated almost 300,000 network-layer attacks, roughly 55 times greater than the tool we previously relied upon. This new tool, dubbed “dosd”, leverages Linux’s eXpress Data Path (XDP) and allows our system to quickly — and automatically — deploy rules eBPF rules that run on each packet received. We further enhanced our edge mitigation capabilities in 3Q2020 by developing and releasing a protection layer that can <a href="/announcing-flowtrackd/">operate even in environments where we only see one side of the TCP flow</a>. These network layer protections help protect our customers who leverage both <a href="https://www.cloudflare.com/magic-transit/">Magic Transit</a> to protect their IP ranges and our WAF to protect their applications and APIs.</p><p>To document and provide visibility into these attacks, we released a GraphQL-backed interface in 1Q2020 called <a href="/announcing-network-analytics/">Network Analytics</a>. Network Analytics extends the visibility of attacks against our customers’ services from L7 to L3, and includes detailed attack logs containing data such as top source and destination IPs and ports, ASNs, data centers, countries, bit rates, protocol and TCP flag distributions. A litany of improvements made to this graphical rendering engine over the course of 2020 have benefitted all analytics tools using the same front-end. In 4Q2020, <a href="/announcing-spectrum-ddos-analytics-and-ddos-insights-trends/">Network Analytics was extended</a> to provide traffic and attack insights into Cloudflare Spectrum-protected applications, which are terminated at L4 (TCP/UDP).</p><p>Towards the end of 4Q2020, we <a href="/announcing-ddos-alerts/">released real-time DDoS attack alerting</a> capable of sending emails or pages via PagerDuty to alert security teams of ongoing attacks and mitigations. This capability was released just in time to assist with the onslaught of <a href="/ransom-ddos-attacks-target-a-fortune-global-500-company/">ransomware attacks that Cloudflare helped detect and defend against</a>. For additional context on unique attacks we fought off in 2020, consider reading about <a href="/beat-an-acoustics-inspired-ddos-attack/">an acoustics inspired attack</a>, a <a href="/mitigating-a-754-million-pps-ddos-attack-automatically/">754 million packet-per-second</a>, or a roundup of attacks from <a href="/network-layer-ddos-attack-trends-for-q1-2020/">1Q2020</a>, <a href="/network-layer-ddos-attack-trends-for-q2-2020/">2Q2020</a>, or <a href="/network-layer-ddos-attack-trends-for-q3-2020/">3Q2020</a>.</p>
    <div>
      <h3>Wrapping up and looking towards 2021</h3>
      <a href="#wrapping-up-and-looking-towards-2021">
        
      </a>
    </div>
    <p>2020 was a tough year around the world. Throughout what has also been, and continues to be, a period of heightened cyberattacks and breaches, we feel proud that our teams were able to release a steady flow of new and improved capabilities across several critical security product areas reviewed by Frost &amp; Sullivan. These releases culminated in far greater protections for customers at the end of the year than the beginning, and a recognition for our sustained efforts.</p><p>We are pleased to have been named the Innovation Leader in their Frost Radar™: Global Holistic Web Protection Market Report, which “addresses organizations' demand for consolidated, single pane of glass solutions, which not only reduce the security gaps of legacy products but also provide simplified management capabilities”.</p><p>As we look towards 2021 we plan to continue releasing early and often, listening to feedback from our customers, and delivering incremental value along the way. If you have ideas on what additional capabilities you’d like to use to protect your applications and networks, we’d love to hear them below in the comments.</p> ]]></content:encoded>
            <category><![CDATA[Bot Management]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Firewall]]></category>
            <guid isPermaLink="false">6geQrFLmwe1clYApvzZoPc</guid>
            <dc:creator>Patrick R. Donahue</dc:creator>
        </item>
        <item>
            <title><![CDATA[Encrypting your WAF Payloads with Hybrid Public Key Encryption (HPKE)]]></title>
            <link>https://blog.cloudflare.com/encrypt-waf-payloads-hpke/</link>
            <pubDate>Fri, 11 Dec 2020 15:00:00 GMT</pubDate>
            <description><![CDATA[ Allowing logging for payloads that trigger the Web Application Firewall has always led to end-user privacy concerns. We built encrypted matched payload logging to solve this! ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1RlsdFM0TM6rsZcupfwTAL/552a88a05215e1ba9106d922609272f9/Hybrid-WAF-keys.png" />
            
            </figure><p>The Cloudflare <a href="https://www.cloudflare.com/waf/">Web Application Firewall</a> (WAF) blocks more than 72B malicious requests per day from reaching our customers’ applications. Typically, our users can easily confirm these requests were not legitimate by checking the URL, the query parameters, or other metadata that Cloudflare provides as part of the <a href="https://developers.cloudflare.com/logs/log-fields#firewall-events">security event log</a> in the dashboard.</p><p>Sometimes investigating a WAF event requires a bit more research and a trial and error approach, as the WAF may have matched against a field that is not logged by default.</p><p>Not logging all parts of a request is intentional: HTTP headers and payloads often contain sensitive data, including personally identifiable information, which <a href="/welcome-to-privacy-and-compliance-week/">we consider a toxic asset</a>. Request headers may contain cookies and <code>POST</code> payloads may contain username and password pairs submitted during a login attempt among other sensitive data.</p><p>We recognize that providing clear visibility in any security event is a core feature of a firewall, as this allows users to better fine tune their rules. To accomplish this, while ensuring end-user privacy, we built encrypted WAF matched payload logging. This feature will log only the specific component of the request the WAF has deemed malicious — and it is encrypted using a customer-provided key to ensure that no Cloudflare employee can examine the data*. Additionally, the crypto uses an exciting new standard — developed in part by Cloudflare — called Hybrid Public Key Encryption (HPKE).</p><p><i>*All Cloudflare logs are encrypted at rest. This feature implements a second layer of encryption for the specific matched fields so that only the customer can decrypt it.</i></p>
    <div>
      <h3>Encrypting Matched Payloads</h3>
      <a href="#encrypting-matched-payloads">
        
      </a>
    </div>
    <p>To turn on this feature, you need to provide a public key, or generate a private-public key pair directly from the dashboard. Your data will then be encrypted using <a href="https://datatracker.ietf.org/doc/draft-irtf-cfrg-hpke/">Hybrid Public Key Encryption (HPKE)</a>, which offers a great combination of both performance and security.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3q8wP2xSa9UI1I8HApOT3O/f94f88a2461993e3f1d7de6e0e2ff439/image2-36.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2EaIQOvOrl19LBOYFbOFVn/9b6f63a8ae11adb73686f2d242ffbcae/image1-52.png" />
            
            </figure><p>To simplify this process, we have built an easy-to-use <a href="https://github.com/cloudflare/matched-data-cli">command line utility</a> to generate the key pair:</p>
            <pre><code>$ matched-data-cli generate-key-pair
{
  "private_key": "uBS5eBttHrqkdY41kbZPdvYnNz8Vj0TvKIUpjB1y/GA=",
  "public_key": "Ycig/Zr/pZmklmFUN99nr+taURlYItL91g+NcHGYpB8="
}</code></pre>
            <p>Cloudflare does not store the private key and it is our customers’ responsibility to ensure it is stored safely. Lost keys, and the data encrypted with them, cannot be recovered but customers can rotate keys to be used with future payloads.</p><p>Once encrypted, payloads will be available in the logs as encrypted base64 blobs within the <code>metadata</code> field:</p>
            <pre><code>"metadata": [
  {
    "key": "encrypted_matched_data",
    "Value": "AdfVn7odpamJGeFAGj0iW2oTtoXOjVnTFT2x4l+cHKJsEQAAAAAAAAB+zDygjV2aUI92FV4cHMkp+4u37JHnH4fUkRqasPYaCgk="
  }
]</code></pre>
            <p>Decrypting payloads can be done via the dashboard from the Security Events log, or by using the command line utility, as shown below. If done via the dashboard, the browser will decrypt the payload locally (i.e., client side) and will not send the private key to Cloudflare.</p>
            <pre><code>$ printf $PRIVATE_KEY | ./matched-data-cli decrypt -d AdfVn7odpamJGeFAGj0iW2oTtoXOjVnTFT2x4l+cHKJsEQAAAAAAAAB+zDygjV2aUI92FV4cHMkp+4u37JHnH4fUkRqasPYaCgk= --private-key-stdin</code></pre>
            <p>The command above returns:</p>
            <pre><code>{"REQUEST_HEADERS:REFERER":"https:\/\/example.com\/testkey.txt?a=&lt;script&gt;alert('xss');&lt;\/script&gt;"}</code></pre>
            <p>In the example above, the WAF matched against the <code>REQUEST_HEADERS:REFERER</code> field. Any other fields the WAF matched on would be similarly logged.</p>
    <div>
      <h3>Better Logging with User Privacy in Mind</h3>
      <a href="#better-logging-with-user-privacy-in-mind">
        
      </a>
    </div>
    <p>In the coming months, this feature will be available on our dashboard to our Enterprise customers. Enterprise customers who would like this feature enabled sooner should reach out to their account team. Only application owners who also have access to the Cloudflare dashboard as Super Administrators will be able to configure encrypted matched payload logging. Those who do not have access to the private key, including Cloudflare staff, are not able to decrypt the logs.</p><p>We are also excited for this feature to be one of our first to use Hybrid Public Key Encryption, and for Cloudflare to use this emerging standard developed by the Crypto Forum Research Group (CFRG), the research body that supports the development of Internet standards at the <a href="http://ietf.org">IETF</a>. And stay tuned, we will publish a deep dive post with the technical details soon!</p> ]]></content:encoded>
            <category><![CDATA[Privacy Week]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[WAF Rules]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Firewall]]></category>
            <guid isPermaLink="false">bLhJXerM0NRBni5RZyAUx</guid>
            <dc:creator>Michael Tremante</dc:creator>
        </item>
        <item>
            <title><![CDATA[Building even faster interpreters in Rust]]></title>
            <link>https://blog.cloudflare.com/building-even-faster-interpreters-in-rust/</link>
            <pubDate>Thu, 24 Sep 2020 11:00:00 GMT</pubDate>
            <description><![CDATA[ Firewall Rules lets customers filter the traffic hitting their site, powered by our Wirefilter engine. We’re excited to share some in-depth optimizations we have recently made to improve the performance of our edge. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>At Cloudflare, we’re <a href="/making-the-waf-40-faster/">constantly working on</a> improving the performance of our edge — and that was exactly what my internship this summer entailed. I’m excited to share some improvements we’ve made to our popular <a href="/how-we-made-firewall-rules/">Firewall Rules</a> product over the past few months.</p><p>Firewall Rules lets customers filter the traffic hitting their site. It’s built using our engine, Wirefilter, which takes powerful boolean expressions written by customers and matches incoming requests against them. Customers can then choose how to respond to traffic which matches these rules. We will discuss some in-depth optimizations we have recently made to Wirefilter, so you may wish to <a href="/building-fast-interpreters-in-rust/">get familiar</a> with how it works if you haven’t already.</p>
    <div>
      <h3>Minimizing CPU usage</h3>
      <a href="#minimizing-cpu-usage">
        
      </a>
    </div>
    <p>As a new member of the Firewall team, I quickly learned that performance is important — even in our security products. We look for opportunities to make our customers’ Internet properties faster where it’s safe to do so, maximizing both security and performance.</p><p>Our engine is already heavily used, powering all of Firewall Rules. But we have bigger plans. More and more products like our <a href="https://support.cloudflare.com/hc/en-us/articles/200172016-Understanding-the-Cloudflare-Web-Application-Firewall-WAF">Web Application Firewall</a> (WAF) will be running behind our Wirefilter-based engine, and it will become responsible for eating up a sizable chunk of our total CPU usage before long.</p>
    <div>
      <h3>How to measure performance?</h3>
      <a href="#how-to-measure-performance">
        
      </a>
    </div>
    <p>Measuring performance is a notoriously tricky task, and as you can probably imagine trying to do this in a highly distributed environment (aka <a href="https://www.cloudflare.com/learning/serverless/glossary/what-is-edge-computing/">Cloudflare’s edge</a>) does not help. We’ve been surprised in the past by optimizations that look good on paper, but, when tested out in production, just don’t seem to do much.</p><p>Our solution? Performance measurement as a service — an isolated and reproducible benchmark for our Firewall engine and a framework for engineers to easily request runs and view results. It’s worth noting that we took a lot of inspiration from the fantastic <a href="https://perf.rust-lang.org/">Rust Compiler benchmarks</a> to build this.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2j6ou7jUofaSYjEjoMej25/a380fb67cdca84b7b95ff13eb8d98203/image3-10.png" />
            
            </figure><p>Our benchmarking framework, showing how performance during different stages of processing Wirefilter expressions has changed over time [1].</p>
    <div>
      <h3>What to measure?</h3>
      <a href="#what-to-measure">
        
      </a>
    </div>
    <p>Our next challenge was to find some meaningful performance metrics. Some experimentation quickly uncovered that time was far too volatile a measure for meaningful comparisons, so we turned to <a href="https://en.wikipedia.org/wiki/Hardware_performance_counter">hardware counters</a> [2]. It’s not hard to find tools to measure these (<a href="https://perf.wiki.kernel.org/index.php/Main_Page">perf</a> and <a href="https://software.intel.com/content/www/us/en/develop/tools/vtune-profiler.html">VTune</a> are two such examples), although they (<a href="https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/api-support/instrumentation-and-tracing-technology-apis/instrumentation-and-tracing-technology-api-reference/collection-control-api.html">mostly</a>) don’t allow control over which parts of the program are recorded. In our case, we wished to individually record measurements for different stages of filter processing — parsing, compilation, analysis, and execution.</p><p>Once again we took inspiration from the Rust compiler, and its <a href="https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rustc-self-profile.html">self-profiling options</a>, using the <a href="https://www.man7.org/linux/man-pages/man2/perf_event_open.2.html">perf_event_open</a> API to record counters from <i>inside</i> our binary. We then output something like the following, which our framework can easily ingest and store for later visualization.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5rMHtBLVjfrHV0BMfTvaZV/a53037be7211be732df9ced5169b8fe7/Screen-Shot-2020-09-24-at-10.20.42.png" />
            
            </figure><p>Output of our benchmarks in <a href="https://jsonlines.org/">JSON Lines</a> format, showing a list of recordings for each combination of hardware counter and Wirefilter processing stage. We’ve used 10 repeats here for readability, but we use around 20, in addition to 5 warmup rounds, within our framework.</p><p>Whilst we mainly focussed on metrics relating to CPU usage, we also use a combination of <a href="https://man7.org/linux/man-pages/man2/getrusage.2.html"><code>getrusage</code></a> and <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=695f055936938c674473ea071ca7359a863551e7"><code>clear_refs</code></a> to find the maximum resident set size (RSS). This is useful to understand the memory impact of <a href="https://github.com/BurntSushi/aho-corasick">particular algorithms</a> in addition to CPU.</p><p>But the challenge was not over. Cloudflare’s standard CI agents use virtualization and sandboxing for security and convenience, but this makes accessing hardware counters virtually impossible. Running our benchmarks on a dedicated machine gave us access to these counters, and ensured more reproducible results.</p>
    <div>
      <h3>Speeding up the speed test</h3>
      <a href="#speeding-up-the-speed-test">
        
      </a>
    </div>
    <p>Our benchmarks were designed from the outset to take an important place in our development process. For instance, we now perform a full benchmark run before releasing each new version to detect performance regressions.</p><p>But with our benchmarks in place, it quickly became clear that we had a problem. Our benchmarks simply weren’t fast enough — at least if we wanted to complete them in less than a few hours! The problem was we have a very large number  of filters. Since our engine would never usually execute requests against this many filters at once it was proving incredibly costly. We came up with a few tricks to cut this down…</p><ul><li><p><b><b><b>Deduplication.</b></b></b> It turns out that only around a third of filters are structurally unique (something that is easy to check as Wirefilter can helpfully serialize to JSON). We managed to cut down a great deal of time by ignoring duplicate filters in our benchmarks.</p></li><li><p><b><b><b>Sampling.</b></b></b> Still, we had too many filters and random sampling presented an easy solution. A more subtle challenge was to make sure that the random sample was always the same to maintain reproducibility.</p></li><li><p><b><b><b>Partitioning.</b></b></b> We worried that deduplication and sampling would cause us to miss important cases that are useful to optimize. By first partitioning filters by Wirefilter language feature, we can ensure we’re getting a good range of filters. It also helpfully gives us more detail about where specifically the impact of a performance change is.</p></li></ul><p>Most of these are trade-offs, but very necessary ones which allow us to run continual benchmarks without development speed grinding to a halt. At the time of writing, we’ve managed to get a benchmark run down to around 20 minutes using these ideas.</p>
    <div>
      <h3>Optimizing our engine</h3>
      <a href="#optimizing-our-engine">
        
      </a>
    </div>
    <p>With a benchmarking framework in place, we were ready to begin testing optimizations. But how do you optimize an interpreter like Wirefilter? <a href="https://en.wikipedia.org/wiki/Just-in-time_compilation">Just-in-time (JIT) compilation</a>, <a href="https://dl.acm.org/doi/10.1145/277652.277743">selective inlining</a> and <a href="http://www.complang.tuwien.ac.at/andi/papers/dotnet_06.pdf">replication</a> were some ideas floating around in the word of interpreters that seemed attractive. After all, we <a href="/building-fast-interpreters-in-rust/">previously wrote</a> about the cost of dynamic dispatch in Wirefilter. All of these techniques aim to reduce that effect.</p><p>However, running some real filters through a profiler tells a different story. Most execution time, around 65%, is spent not resolving dynamic dispatch calls but instead performing <a href="https://developers.cloudflare.com/firewall/cf-firewall-language/operators/#comparison-operators">operations</a> like comparison and searches. Filters currently in production tend to be pretty light on functions, but throw in a few more of these and even less time would be spent on dynamic dispatch. We suspect that even a fair chunk of the remaining 35% is actually spent reading the memory of request fields.</p>
<table>
<thead>
  <tr>
    <th>Function</th>
    <th>CPU time</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>`matches`</span> operator</td>
    <td>0.6%</td>
  </tr>
  <tr>
    <td><span>`in`</span> operator</td>
    <td>1.1%</td>
  </tr>
  <tr>
    <td><span>`eq`</span> operator</td>
    <td>11.8%</td>
  </tr>
  <tr>
    <td><span>`contains`</span> operator</td>
    <td>51.5%</td>
  </tr>
  <tr>
    <td>Everything else</td>
    <td>35.0%</td>
  </tr>
</tbody>
</table>
<figcaption>Breakdown of CPU time while executing a typical production filter.</figcaption>
    <div>
      <h3>An adventure in substring searching</h3>
      <a href="#an-adventure-in-substring-searching">
        
      </a>
    </div>
    <p>By now, you shouldn’t be surprised that the <code>contains</code> operator was one of the first in line for optimization. If you’ve ever written a Firewall Rule, you’re probably already familiar with what it does — it checks whether a substring is present in the field you are matching against. For example, the following expression would match when the host is “example.com” or “<a href="http://www.example.net”">www.example.net”</a>, but not when it is “cloudflare.com”. In <a href="https://en.wikipedia.org/wiki/String-searching_algorithm">string searching algorithms</a>, this is commonly referred to as finding a ‘needle’ (“example”) within a ‘haystack’ (“example.com”).</p><p><code>http.host contains “example”</code></p><p>How does this work under the hood? Ordinarily, we may have used Rust’s <a href="https://doc.rust-lang.org/std/string/struct.String.html#method.contains">`String::contains` function</a> but Wirefilter also allows raw byte expressions that don’t necessarily conform to UTF-8.</p><p><code>http.host contains 65:78:61:6d:70:6c:65</code></p><p>We therefore used the <a href="https://crates.io/crates/memmem">memmem crate</a> which performs a <a href="https://en.wikipedia.org/wiki/Two-way_string-matching_algorithm">two-way substring search algorithm</a> on raw bytes.</p><p>Sounds good, right? It was, and it was working pretty well, although we’d noticed that rewriting `contains` filters using regular expressions could bizarrely often make them faster.</p><p><code>http.host matches “example”</code></p><p>Regular expressions are great, but since they’re far more powerful than the `contains` operator, they shouldn’t be faster than a specialized algorithm in simple cases like this one.</p><p>Something was definitely up. It turns out that <a href="https://crates.io/crates/regex">Rust’s regex library</a> comes equipped with <a href="https://github.com/rust-lang/regex/blob/691606773f525be32a59a0c28eae203a79663706/src/literal/imp.rs#L24">a whole host</a> of specialized matchers for what it deems to be simple expressions like this. The obvious question was whether we could therefore simply use the regex library. Interestingly, you may not have realized that the popular ripgrep tool does <a href="https://github.com/BurntSushi/ripgrep/blob/1b2c1dc67583d70d1d16fc93c90db80bead4fb09/crates/core/args.rs#L1479">just that</a> when searching for fixed-string patterns.</p><p>However, our use case is a little different. Since we’re building an interpreter (and we’re using dynamic dispatch in any case), we would prefer to dispatch to a specialized case for `contains` expressions, rather than matching on some enum deep within the regex crate when the filter is executed. What’s more, there are some <a href="http://0x80.pl/articles/simd-strfind.html">pretty</a> <a href="https://github.com/intel/hyperscan">cool</a> <a href="https://github.com/jneem/teddy">things</a> being done to perform substring searching that leverages SIMD instruction sets. So we wired up our engine to some <a href="https://github.com/WojciechMula/sse4-strstr">previous work</a> by Wojciech Muła and the results were fantastic.</p>
<table>
<thead>
  <tr>
    <th>Benchmark</th>
    <th>Improvement</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>Expressions using <span>`contains`</span> operator</td>
    <td>72.3%</td>
  </tr>
  <tr>
    <td>‘Simple’ expressions</td>
    <td>0.0%</td>
  </tr>
  <tr>
    <td>All expressions</td>
    <td>31.6%</td>
  </tr>
</tbody>
</table>
<figcaption>Improvements in instruction count using Wojciech Muła’s sse4-strstr library over the memmem crate with Wirefilter.</figcaption><p>I encourage you to <a href="http://0x80.pl/articles/simd-strfind.html">read more</a> on “Algorithm 1”, which we used, but it works something like this (I’ve changed the order a little to help make it clearer). It’s worth <a href="https://en.wikipedia.org/wiki/SIMD">reading up</a> on SIMD instructions if you’re unfamiliar with them — they’re the essence behind what makes this algorithm fast.</p><ol><li><p>We fill one SIMD register with the first byte of the needle being searched for, simply repeated over and over.</p></li><li><p>We load as much of our haystack as we can into another SIMD register and perform a bitwise equality operation with our previous register.</p></li><li><p>Now, any position in the resultant register that is 0 cannot be the start of the match since it doesn’t start with the same byte of the needle.</p></li><li><p>We now repeat this process with the last byte of the needle, offsetting the haystack, to rule out any positions that don’t end with the same byte as the needle.</p></li><li><p>Bitwise ANDing these two results together, we (hopefully) have now drastically reduced our potential matches.</p></li><li><p>Each of the remaining potential matches can be checked manually using a memcmp operation. If we find a match, then we’re done.</p></li><li><p>If not, we continue with the next part of our haystack and repeat until we’ve checked the entire thing.</p></li></ol>
    <div>
      <h3>When it goes wrong</h3>
      <a href="#when-it-goes-wrong">
        
      </a>
    </div>
    <p>You may be wondering what happens if our haystack doesn’t fit neatly into registers. In the original algorithm, nothing. It simply continues reading into the oblivion after the end of the haystack until the last register is full, and uses a bitmask to ignore potential false-positives from this additional region of memory.</p><p>As we mentioned, security is our priority when it comes to optimizations, so we could never deploy something with this kind of behaviour. We ended up porting Muła’s library to Rust (we’ve also <a href="https://crates.io/crates/sliceslice">open-sourced the crate</a>!) and performed an <a href="https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/coding-for-neon---part-2-dealing-with-leftovers">overlapping registers modification</a> found in ARM’s blog.</p><p>It’s best illustrated by example — notice the difference between how we would fill registers on an imaginary SIMD instruction-set with 4-byte registers.</p><p><b>Before modification</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3OUJ2AojfLLoz1mZepPjg0/1b98003bf5fb2a44fed2366f6840fcae/image1-16.png" />
            
            </figure><p>How registers are filled in the original implementation for the haystack “abcdefghij”, red squares indicate out of bounds memory.</p><p><b>After modification</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2j5TTWwSXcV1Rtu7Uaoqsf/138c36a096cc6c201777028933a3f49c/image4-10.png" />
            
            </figure><p>How registers are filled with the overlapping modification for the same haystack, notice how ‘g’ and ‘h’ each appear in two registers.</p><p>In our case, repeating some bytes within two different registers will never change the final outcome, so this modification is allowed as-is. However, in reality, we found it was better to use a bitmask to exclude repeated parts of the final register and minimize the number of memcmp calls.</p><p>What if the haystack is too small to even fill a single register? In this case, we can’t use our overlapping trick since there’s nothing to overlap with. Our solution is straightforward: while we were primarily targeting AVX2, which can store 32-bytes in a lane, we can easily move down to another instruction set with smaller registers that the haystack can fit into. In reality, we don’t currently go any smaller than SSE2. Beyond this, we instead use an implementation of the <a href="https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm">Rabin-Karp searching algorithm</a> which appears to perform well.</p>
<table>
<thead>
  <tr>
    <th>Instruction set</th>
    <th>Register size</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>AVX2</td>
    <td>32 bytes</td>
  </tr>
  <tr>
    <td>SSE2</td>
    <td>16 bytes</td>
  </tr>
  <tr>
    <td>SWAR (u64)</td>
    <td>8 bytes</td>
  </tr>
  <tr>
    <td>SWAR (u32)</td>
    <td>4 bytes</td>
  </tr>
  <tr>
    <td>...</td>
    <td>...</td>
  </tr>
</tbody>
</table>
<figcaption>Register sizes in different SIMD instruction sets [3]. We did not consider AVX512 since support for this is not widespread enough.</figcaption>
    <div>
      <h3>Is it always fast?</h3>
      <a href="#is-it-always-fast">
        
      </a>
    </div>
    <p>Choosing the first and last bytes of the needle to rule out potential matches is a great idea. It means that when it does come to performing a memcmp, we can ignore these, as we know they already match. Unfortunately, as Muła points out, this also makes the algorithm susceptible to a worst-case attack in some instances.</p><p>Let’s give an expression that a customer might write to illustrate this.</p><p><code>http.request.uri.path contains “/wp-admin/”</code></p><p>If we try to search for this within a very long sequence of ‘/’s, we will find a potential match in every position and make lots of calls to memcmp — essentially performing a slow <a href="https://en.wikipedia.org/wiki/String-searching_algorithm#Na%C3%AFve_string_search">bruteforce substring search</a>.</p><p>Clearly we need to choose different bytes from the needle. But which ones should we choose? For each choice, an adversary can always find a slightly different, but equally troublesome, worst case. We instead use <a href="https://en.wikipedia.org/wiki/Randomized_algorithm">randomness</a> to throw off our would-be adversary, picking the first byte of the needle as before, but then choosing another <i>random</i> byte to use.</p><p>Our new version is unsurprisingly slower than Muła’s, yet it still exhibits a great improvement over both the memmem and regex crates. Performance, but without sacrificing safety.</p>
<table>
<thead>
  <tr>
    <th>Benchmark</th>
    <th>Improvement</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td></td>
    <td>sse4-strstr (original)</td>
    <td>sliceslice (our version)</td>
  </tr>
  <tr>
    <td>Expressions using <span>`contains`</span> operator</td>
    <td>72.3%</td>
    <td>49.1%</td>
  </tr>
  <tr>
    <td>‘Simple’ expressions</td>
    <td>0.0%</td>
    <td>0.1%</td>
  </tr>
  <tr>
    <td>All expressions</td>
    <td>31.6%</td>
    <td>24.0%</td>
  </tr>
</tbody>
</table>
<figcaption>Improvements in instruction count of using sse4-strstr and sliceslice over the memmem crate with Wirefilter.</figcaption>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>This is only a small taste of the performance work we’ve been doing, and we have much more yet to come. Nevertheless, none of this would have been possible without the support of my manager Richard and my mentor Elie, who contributed a lot of these ideas. I’ve learned so much over the past few months, but most of all that Cloudflare is an amazing place to be an intern!</p><p>[1] Since our benchmarks are not run within a production environment, results in this post do not represent traffic on our edge.</p><p>[2] We found instruction counts to be a particularly stable measure, and CPU cycles a particularly unstable one.</p><p>[3] Note that <a href="https://en.wikipedia.org/wiki/SWAR">SWAR</a> is technically not an instruction set, but instead uses regular registers like vector registers.</p> ]]></content:encoded>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Performance]]></category>
            <category><![CDATA[Rust]]></category>
            <category><![CDATA[WAF]]></category>
            <guid isPermaLink="false">519hc6hT0fkJoLpme6IKrP</guid>
            <dc:creator>Zak Cutner</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Bot Management: machine learning and more]]></title>
            <link>https://blog.cloudflare.com/cloudflare-bot-management-machine-learning-and-more/</link>
            <pubDate>Wed, 06 May 2020 11:00:00 GMT</pubDate>
            <description><![CDATA[ This is the ongoing story of Bot Management at Cloudflare and also an introduction to a series of blog posts about the detection mechanisms powering it ]]></description>
            <content:encoded><![CDATA[ <p></p>
    <div>
      <h3>Introduction</h3>
      <a href="#introduction">
        
      </a>
    </div>
    <p>Building <a href="https://www.cloudflare.com/application-services/products/bot-management/">Cloudflare Bot Management platform</a> is an exhilarating experience. It blends Distributed Systems, Web Development, Machine Learning, Security and Research (and every discipline in between) while fighting ever-adaptive and motivated adversaries at the same time.</p><p>This is the ongoing story of Bot Management at Cloudflare and also an introduction to a series of blog posts about the detection mechanisms powering it. I’ll start with several definitions from the Bot Management world, then introduce the product and technical requirements, leading to an overview of the platform we’ve built. Finally, I’ll share details about the detection mechanisms powering our platform.</p><p>Let’s start with Bot Management’s nomenclature.</p>
    <div>
      <h3>Some Definitions</h3>
      <a href="#some-definitions">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/bots/what-is-a-bot/"><b>Bot</b></a> - an autonomous program on a network that can interact with computer systems or users, imitating or replacing a human user's behavior, performing repetitive tasks much faster than human users could.</p><p><b>Good bots</b> - bots which are useful to businesses they interact with, e.g. <a href="https://www.cloudflare.com/learning/bots/what-is-a-web-crawler/">search engine bots</a> like Googlebot, Bingbot or bots that operate on social media platforms like Facebook Bot.</p><p><b>Bad bots</b> - bots which are designed to perform malicious actions, ultimately hurting businesses, e.g. <a href="https://www.cloudflare.com/learning/bots/what-is-credential-stuffing/">credential stuffing</a> bots, <a href="https://www.cloudflare.com/learning/bots/what-is-data-scraping/">third-party scraping</a> bots, <a href="https://www.cloudflare.com/learning/bots/what-is-a-spambot/">spam</a> bots and sneakerbots.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5nwyutK4DVA1cjsfMY8ore/fd2ebf6ec92ec7795ea423f4e7d61713/image12.png" />
            
            </figure><p><a href="https://www.cloudflare.com/learning/bots/what-is-bot-management/"><b>Bot Management</b></a> - blocking undesired or malicious Internet bot traffic while still allowing useful bots to access web properties by detecting bot activity, discerning between desirable and undesirable bot behavior, and identifying the sources of the undesirable activity.</p><p><a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/"><b>WAF</b></a> - a security system that monitors and controls network traffic based on a set of security rules.</p>
    <div>
      <h3>Gathering requirements</h3>
      <a href="#gathering-requirements">
        
      </a>
    </div>
    <p>Cloudflare has been stopping malicious bots from accessing websites or misusing <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">APIs</a> from the very <a href="/cloudflare-uses-intelligent-caching-to-avoid/">beginning</a>, at the same time <a href="/cleaning-up-bad-bots/">helping the climate</a> by offsetting the carbon costs from the bots. Over time it became clear that we needed a dedicated platform which would unite different bot fighting techniques and streamline the customer experience. In designing this new platform, we tried to fulfill the following key requirements.</p><ul><li><p><b>Complete, not complex</b> - customers can turn on/off Bot Management with a single click of a button, to protect their websites, mobile applications, or <a href="https://www.cloudflare.com/application-services/solutions/api-security/">APIs</a>.</p></li><li><p><b>Trustworthy</b> - customers want to know whether they can trust the website visitor is who they say they are and provide a certainty indicator for that trust level.</p></li><li><p><b>Flexible</b> - customers should be able to define what subset of the traffic Bot Management mitigations should be applied to, e.g. only login URLs, pricing pages or sitewide.</p></li><li><p><b>Accurate</b> - Bot Management detections should have a very small error, e.g. none or very few human visitors ever should be mistakenly identified as bots.</p></li><li><p><b>Recoverable</b> - in case a wrong prediction was made, human visitors still should be able to access websites as well as good bots being let through.</p></li></ul><p>Moreover, the goal for new Bot Management product was to make it work well on the following use cases:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5z0o8rXLkecZWUhx1UDRHF/78e1e55cc47dac3d8bb58ac274870387/image8.png" />
            
            </figure>
    <div>
      <h3>Technical requirements</h3>
      <a href="#technical-requirements">
        
      </a>
    </div>
    <p>Additionally, to the product requirements above, we engineers had a list of must-haves for the new Bot Management platform. The most critical were:</p><ul><li><p><b>Scalability</b> - the platform should be able to calculate a score on every request, even at over 10 million requests per second.</p></li><li><p><b>Low latency</b> - detections must be performed extremely quickly, not slowing down request processing by more than 100 microseconds, and not requiring additional hardware.</p></li><li><p><b>Configurability</b> - it should be possible to configure what detections are applied on what traffic, including on per domain/data center/server level.</p></li><li><p><b>Modifiability</b> - the platform should be easily extensible with more detection mechanisms, different mitigation actions, richer analytics and logs.</p></li><li><p><b>Security</b> - no sensitive information from one customer should be used to build models that protect another customer.</p></li><li><p><b>Explainability &amp; debuggability</b> - we should be able to explain and tune predictions in an intuitive way.</p></li></ul><p>Equipped with these requirements, back in 2018, our small team of engineers got to work to design and build the next generation of Cloudflare Bot Management.</p>
    <div>
      <h3>Meet the Score</h3>
      <a href="#meet-the-score">
        
      </a>
    </div>
    <blockquote><p><i>“Simplicity is the ultimate sophistication.”- Leonardo Da Vinci</i></p></blockquote><p>Cloudflare operates on a vast scale. At the time of this writing, this means covering 26M+ Internet properties, processing on average 11M requests per second (with peaks over 14M), and examining more than 250 request attributes from different protocol levels. The key question is how to harness the power of such “gargantuan” data to <a href="https://www.cloudflare.com/products/zero-trust/threat-defense/">protect all of our customers from modern day cyberthreats</a> in a simple, reliable and explainable way?</p><p>Bot management is hard. Some bots are much harder to detect and require looking at multiple dimensions of request attributes over a long time, and sometimes a single request attribute could give them away. More signals may help, but are they generalizable?</p><p>When we classify traffic, should customers decide what to do with it or are there decisions we can make on behalf of the customer? What concept could possibly address all these uncertainty problems and also help us to deliver on the requirements from above?</p><p>As you might’ve guessed from the section title, we came up with the concept of Trusted Score or simply <b>The Score</b> <i>-</i> one thing to rule them all - indicating the likelihood between 0 and 100 whether a request originated from a human (high score) vs. an automated program (low score).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3caFJFhAGnz4989GtGg5s4/c03d3fd90168d7d35f79dcc547912db7/image5-1.jpg" />
            
            </figure><p><a href="https://www.flickr.com/photos/purple-lover/13583362554">"One Ring to rule them all"</a> by idreamlikecrazy, used under <a href="https://creativecommons.org/licenses/by/2.0/">CC BY</a> / Desaturated from original</p><p>Okay, let’s imagine that we are able to assign such a score on every incoming HTTP/HTTPS request, what are we or the customer supposed to do with it? Maybe it’s enough to provide such a score in the logs. Customers could then analyze them on their end, find the most frequent IPs with the lowest scores, and then use the <a href="https://www.cloudflare.com/application-services/products/waf/">Cloudflare Firewall</a> to block those IPs. Although useful, such a process would be manual, prone to error and most importantly cannot be done in real time to protect the customer's Internet property.</p><p>Fortunately, around the same time we started worked on this system , our colleagues from the Firewall team had <a href="/announcing-firewall-rules/">just announced Firewall Rules</a>. This new capability provided customers the ability to control requests in a flexible and intuitive way, inspired by the widely known Wireshark®  language. Firewall rules supported a variety of request fields, and we thought - why not have the score be one of these fields? Customers could then write granular rules to block very specific attack types. That’s how the <code>cf.bot_management.score</code> field was born.</p><p>Having a score in the heart of Cloudflare Bot Management addressed multiple product and technical requirements with one strike - it’s simple, flexible, configurable, and it provides customers with telemetry about bots on a per request basis. Customers can adjust the score threshold in firewall rules, depending on their sensitivity to false positives/negatives. Additionally, this intuitive score allows us to extend our detection capabilities under the hood without customers needing to adjust any configuration.</p><p>So how can we produce this score and how hard is it? Let’s explore it in the following section.</p>
    <div>
      <h3>Architecture overview</h3>
      <a href="#architecture-overview">
        
      </a>
    </div>
    <p>What is powering the Bot Management score? The short answer is a set of <a href="https://www.cloudflare.com/learning/serverless/glossary/serverless-microservice/">microservices</a>. Building this platform we tried to re-use as many pipelines, databases and components as we could, however many services had to be built from scratch. Let’s have a look at overall architecture (this overly simplified version contains Bot Management related services):</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5OSC0Ty0XKfbmw651kO9bQ/ebfbf8204161f3db6622291ddb7e4721/image13.png" />
            
            </figure>
    <div>
      <h3>Core Bot Management services</h3>
      <a href="#core-bot-management-services">
        
      </a>
    </div>
    <p>In a nutshell our systems process data received from the edge data centers, produce and store data required for bot detection mechanisms using the following technologies:</p><ul><li><p><b>Databases &amp; data stores</b> - <a href="/squeezing-the-firehose/">Kafka</a>, <a href="/http-analytics-for-6m-requests-per-second-using-clickhouse/">ClickHouse</a>, Postgres, Redis, Ceph.</p></li><li><p><b>Programming languages</b> - Go, Rust, Python, Java, Bash.</p></li><li><p><b>Configuration &amp; schema management</b> - Salt, <a href="/introducing-quicksilver-configuration-distribution-at-internet-scale/">Quicksilver</a>, <a href="https://capnproto.org/">Cap’n Proto</a>.</p></li><li><p><b>Containerization</b> - Docker, Kubernetes, Helm, Mesos/Marathon.</p></li></ul><p>Each of these services is built with resilience, performance, <a href="https://www.cloudflare.com/learning/performance/what-is-observability/">observability</a> and security in mind.</p>
    <div>
      <h3>Edge Bot Management module</h3>
      <a href="#edge-bot-management-module">
        
      </a>
    </div>
    <p>All bot detection mechanisms are applied on every request in real-time during the request processing stage in the Bot Management module running on every machine at Cloudflare’s edge locations. When a request comes in we extract and transform the required request attributes and feed them to our detection mechanisms. The Bot Management module produces the following output:</p><p><b>Firewall fields</b> - <a href="https://support.cloudflare.com/hc/en-us/articles/360027519452-Understanding-Cloudflare-Bot-Management">Bot Management fields</a>- <b>cf.bot_management.score</b> - an integer indicating the likelihood between 0 and 100 whether a request originated from an automated program (low score) to a human (high score).- <b>cf.bot_management.verified_bot</b> - a boolean indicating whether such request comes from a Cloudflare allowlisted bot.- <b>cf.bot_management.static_resource</b> - a boolean indicating whether request matches file extensions for many types of static resources.</p><p><b>Cookies</b> - most notably it produces <a href="https://community.cloudflare.com/t/cf-bm-cookie/56696"><b>cf_bm</b></a>, which helps manage incoming traffic that matches criteria associated with bots.</p><p><b>JS challenges</b> - for some of our detections and customers we inject into invisible JavaScript challenges, providing us with more signals for bot detection.</p><p><b>Detection logs</b> - we log through our data pipelines to ClickHouse details about each applied detection, used features and flags, some of which are used for analytics and customer logs, while others are used to debug and improve our models.</p><p>Once the Bot Management module has produced the required fields, the Firewall takes over the actual bot mitigation.</p>
    <div>
      <h3>Firewall integration</h3>
      <a href="#firewall-integration">
        
      </a>
    </div>
    <p>The Cloudflare Firewall's intuitive dashboard enables users to build powerful rules through easy clicks and also provides Terraform integration. Every request to the firewall is inspected against the rule engine. Suspicious requests can be blocked, challenged or logged as per the needs of the user while legitimate requests are routed to the destination, based on the score produced by the Bot Management module and the configured threshold.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5oSiddu0b8BknoqrAQfCYV/3c6c1e456a6d5dedae0e7e50ac7cf346/image6.png" />
            
            </figure><p>Firewall rules provide the following bot mitigation <a href="https://developers.cloudflare.com/firewall/cf-firewall-rules/actions/">actions</a>:</p><ul><li><p><b>Log</b> - records matching requests in the Cloudflare Logs provided to customers.</p></li><li><p><b>Bypass</b> - allows customers to dynamically disable Cloudflare security features for a request.</p></li><li><p><b>Allow</b> - matching requests are exempt from challenge and block actions triggered by other Firewall Rules content.</p></li><li><p><b>Challenge (Captcha)</b> - useful for ensuring that the visitor accessing the site is human, and not automated.</p></li><li><p><b>JS Challenge</b> - useful for ensuring that bots and spam cannot access the requested resource; browsers, however, are free to satisfy the challenge automatically.</p></li><li><p><b>Block</b> - matching requests are denied access to the site.</p></li></ul><p>Our <a href="/updates-to-firewall-analytics/">Firewall Analytics</a> tool, powered by ClickHouse and <a href="/introducing-the-graphql-analytics-api-exactly-the-data-you-need-all-in-one-place/">GraphQL API</a>, enables customers to quickly identify and investigate security threats using an intuitive interface. In addition to analytics, we provide detailed logs on all bots-related activity using either the <a href="https://developers.cloudflare.com/logs/logpull-api/">Logpull API</a> and/or <a href="/cloudflare-logpush-the-easy-way-to-get-your-logs-to-your-cloud-storage/">LogPush</a>, which provides the easy way to get your logs to your cloud storage.</p>
    <div>
      <h3>Cloudflare Workers integration</h3>
      <a href="#cloudflare-workers-integration">
        
      </a>
    </div>
    <p>In case a customer wants more flexibility on what to do with the requests based on the score, e.g. they might want to inject new, or change existing, HTML page content, or serve incorrect data to the bots, or stall certain requests, <a href="https://www.cloudflare.com/developer-platform/workers/">Cloudflare Workers</a> provide an option to do that. For example, using this small code-snippet, we can pass the score back to the origin server for more advanced real-time analysis or mitigation:</p>
            <pre><code>addEventListener('fetch', event =&gt; {
  event.respondWith(handleRequest(event.request))
})
 
async function handleRequest(request) {
  request = new Request(request);
 
  request.headers.set("Cf-Bot-Score", request.cf.bot_management.score)
 
  return fetch(request);
}</code></pre>
            <p>Now let’s have a look into how a single score is produced using multiple detection mechanisms.</p>
    <div>
      <h3>Detection mechanisms</h3>
      <a href="#detection-mechanisms">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3avrETqHNSco30pzXKi2Bi/d83a61d9a294c2f96ed8ae3101fc8839/image10.png" />
            
            </figure><p>The Cloudflare Bot Management platform currently uses five complementary detection mechanisms, producing their own scores, which we combine to form the single score going to the Firewall. Most of the detection mechanisms are applied on every request, while some are enabled on a per-customer basis to better fit their needs.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6kznWqiXGLzyUvqGbNgrco/3d3d777f8b268bcda1b319c841a518e9/image14.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2SlwP5FY8XUmzYUGbIne0n/f589b67119defdc46d4b80762f81d3f4/image4-1.png" />
            
            </figure><p>Having a score on every request for every customer has the following benefits:</p><ul><li><p><b>Ease of onboarding</b> - even before we enable Bot Management in active mode, we’re able to tell how well it’s going to work for the specific customer, including providing historical trends about bot activity.</p></li><li><p><b>Feedback loop</b> - availability of the score on every request along with all features has tremendous value for continuous improvement of our detection mechanisms.</p></li><li><p><b>Ensures scaling</b> - if we can compute for score every request and customer, it means that every Internet property behind Cloudflare is a potential Bot Management customer.</p></li><li><p><b>Global bot insights</b> - Cloudflare is sitting in front of more than 26M+ Internet properties, which allows us to understand and react to the tectonic shifts happening in security and threat intelligence over time.</p></li></ul><p>Overall globally, more than third of the Internet traffic visible to Cloudflare is coming from bad bots, while Bot Management customers have the ratio of bad bots even higher at ~43%!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/18xm3tKE1ir3wbIDSb1oet/8c7675efd856354dd50648b001662839/image7.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/79Mscr2mfcUGezTFmVG5nM/0bb09659f0707e84b8f8a15b52ba7af4/image9.png" />
            
            </figure><p>Let’s dive into specific detection mechanisms in chronological order of their integration with Cloudflare Bot Management.</p>
    <div>
      <h3>Machine learning</h3>
      <a href="#machine-learning">
        
      </a>
    </div>
    <p>The majority of decisions about the score are made using our machine learning models. These were also the first detection mechanisms to produce a score and to on-board customers back in 2018. The successful application of <a href="https://www.cloudflare.com/learning/ai/what-is-machine-learning/">machine learning</a> requires data high in <a href="/stop-the-bots-practical-lessons-in-machine-learning/">Quantity, Diversity, and Quality</a>, and thanks to both free and paid customers, Cloudflare has all three, enabling continuous learning and improvement of our models for all of our customers.</p><p>At the core of the machine learning detection mechanism is CatBoost  - a high-performance open source library for gradient boosting on decision trees. The choice of CatBoost was driven by the library’s outstanding capabilities:</p><ul><li><p><b>Categorical features support</b> - allowing us to train on even very high cardinality features.</p></li><li><p><b>Superior accuracy</b> - allowing us to reduce overfitting by using a novel gradient-boosting scheme.</p></li><li><p><b>Inference speed</b> - in our case it takes less than 50 microseconds to apply any of our models, making sure request processing stays extremely fast.</p></li><li><p><b>C and Rust API</b> - most of our business logic on the edge is written using Lua, more specifically LuaJIT, so having a compatible FFI interface to be able to apply models is fantastic.</p></li></ul><p>There are multiple CatBoost models run on Cloudflare’s Edge in the <a href="https://christophergs.com/machine%20learning/2019/03/30/deploying-machine-learning-applications-in-shadow-mode/#what">shadow mode</a> on <i>every request on every machine</i>. One of the models is run in active mode, which influences the final score going to Firewall. All ML detection results and features are logged and recorded in ClickHouse for further analysis, model improvement, analytics and customer facing logs. We feed both categorical and numerical features into our models, extracted from request attributes and inter-request features built using those attributes, calculated and delivered by the <i>Gagarin</i> inter-requests features platform.</p><p>We’re able to deploy new ML models in a matter of seconds using an extremely reliable and performant <a href="/introducing-quicksilver-configuration-distribution-at-internet-scale/">Quicksilver</a> configuration database. The same mechanism can be used to configure which version of an ML model should be run in active mode for a specific customer.</p><p>A deep dive into our machine learning detection mechanism deserves a blog post of its own and it will cover how do we train and validate our models on trillions of requests using GPUs, how model feature delivery and extraction works, and how we explain and debug model predictions both internally and externally.</p>
    <div>
      <h3>Heuristics engine</h3>
      <a href="#heuristics-engine">
        
      </a>
    </div>
    <p>Not all problems in the world are the best solved with machine learning. We can tweak the ML models in various ways, but in certain cases they will likely underperform basic heuristics. Often the problems machine learning is trying to solve are not entirely new. When building the Bot Management solution it became apparent that sometimes a single attribute of the request could give a bot away. This means that we can create a bunch of simple rules capturing bots in a straightforward way, while also ensuring lowest false positives.</p><p>The heuristics engine was the second detection mechanism integrated into the Cloudflare Bot Management platform in 2019 and it’s also applied on every request. We have multiple heuristic types and hundreds of specific rules based on certain attributes of the request, some of which are very hard to spoof. When any of the requests matches any of the heuristics - we assign the lowest possible score of 1.</p><p>The engine has the following properties:</p><ul><li><p><b>Speed</b> - if ML model inference takes less than 50 microseconds per model, hundreds of heuristics can be applied just under 20 microseconds!</p></li><li><p><b>Deployability</b> - the heuristics engine allows us to add new heuristic in a matter of seconds using <a href="/introducing-quicksilver-configuration-distribution-at-internet-scale/">Quicksilver</a>, and it will be applied on every request.</p></li><li><p><b>Vast coverage</b> - using a set of simple heuristics allows us to classify ~15% of global traffic and ~30% of Bot Management customers’ traffic as bots. Not too bad for a few if conditions, right?</p></li><li><p><b>Lowest false positives</b> - because we’re very sure and conservative on the heuristics we add, this detection mechanism has the lowest FP rate among all detection mechanisms.</p></li><li><p><b>Labels</b> <b>for ML</b> - because of the high certainty we use requests classified with heuristics to train our ML models, which then can generalize behavior learnt from from heuristics and improve detections accuracy.</p></li></ul><p>So heuristics gave us <a href="https://developers.google.com/machine-learning/guides/rules-of-ml#rule_7_turn_heuristics_into_features_or_handle_them_externally">a lift when tweaked with machine learning</a> and they contained a lot of the intuition about the bots, which helped to advance the Cloudflare Bot Management platform and allowed us to onboard more customers.</p>
    <div>
      <h3>Behavioral analysis</h3>
      <a href="#behavioral-analysis">
        
      </a>
    </div>
    <p>Machine learning and heuristics detections provide tremendous value, but both of them require human input on the labels, or basically a teacher to distinguish between right and wrong. While our supervised ML models can generalize well enough even on novel threats similar to what we taught them on, we decided to go further. What if there was an approach which doesn’t require a teacher, but rather can learn to distinguish bad behavior from the normal behavior?</p><p>Enter the behavioral analysis detection mechanism, initially developed in 2018 and integrated with the Bot Management platform in 2019. This is an unsupervised machine learning approach, which has the following properties:</p><ul><li><p><b>Fitting specific customer needs</b> - it’s automatically enabled for all Bot Management customers, calculating and analyzing normal visitor behavior over an extended period of time.</p></li><li><p><b>Detects bots never seen before</b> - as it doesn’t use known bot labels, it can detect bots and anomalies from the normal behavior on specific customer’s website.</p></li><li><p><b>Harder to evade</b> - anomalous behavior is often a direct result of the bot’s specific goal.</p></li></ul><p>Please stay tuned for a more detailed blog about behavioral analysis models and the platform powering this incredible detection mechanism, protecting many of our customers from unseen attacks.</p>
    <div>
      <h3>Verified bots</h3>
      <a href="#verified-bots">
        
      </a>
    </div>
    <p>So far we’ve discussed how to detect bad bots and humans. What about good bots, some of which are extremely useful for the customer website? Is there a need for a dedicated detection mechanism or is there something we could use from previously described detection mechanisms? While the majority of good bot requests (e.g. Googlebot, Bingbot, LinkedInbot) already have low score produced by other detection mechanisms, we also need a way to avoid accidental blocks of useful bots. That’s how the Firewall field <i>cf.bot_management.verified_bot</i> came into existence in 2019, allowing customers to decide for themselves whether they want to let all of the good bots through or restrict access to certain parts of the website.</p><p>The actual platform calculating Verified Bot flag deserves a detailed blog on its own, but in the nutshell it has the following properties:</p><ul><li><p><b>Validator based approach</b> - we support multiple validation mechanisms, each of them allowing us to reliably confirm good bot identity by clustering a set of IPs.</p></li><li><p><b>Reverse DNS validator</b> - performs a reverse DNS check to determine whether or not a bots IP address matches its alleged hostname.</p></li><li><p><b>ASN Block validator</b> - similar to rDNS check, but performed on ASN block.</p></li><li><p><b>Downloader validator</b> - collects good bot IPs from either text files or HTML pages hosted on bot owner sites.</p></li><li><p><b>Machine learning validator</b> - uses an unsupervised learning algorithm, clustering good bot IPs which are not possible to validate through other means.</p></li><li><p><b>Bots Directory</b> - a database with UI that stores and manages bots that pass through the Cloudflare network.</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7ENyHN774m5EVfRIQpQzXO/d5d8127a3235fc8f26eb44b2de2a3919/image2-1.png" />
            
            </figure><p>Bots directory UI sample‌‌</p><p>Using multiple validation methods listed above, the Verified Bots detection mechanism identifies hundreds of unique good bot identities, belonging to different companies and categories.</p>
    <div>
      <h3>JS fingerprinting</h3>
      <a href="#js-fingerprinting">
        
      </a>
    </div>
    <p>When it comes to Bot Management detection quality it’s all about the signal quality and quantity. All previously described detections use request attributes sent over the network and analyzed on the server side using different techniques. Are there more signals available, which can be extracted from the client to improve our detections?</p><p>As a matter of fact there are plenty, as every browser has unique implementation quirks. Every web browser graphics output such as canvas depends on multiple layers such as hardware (GPU) and software (drivers, operating system rendering). This highly unique output allows precise differentiation between different browser/device types. Moreover, this is achievable without sacrificing website visitor privacy as it’s not a supercookie, and it cannot be used to track and identify individual users, but only to confirm that request’s user agent matches other telemetry gathered through browser canvas API.</p><p>This detection mechanism is implemented as a challenge-response system with challenge injected into the webpage on Cloudflare’s edge. The challenge is then rendered in the background using provided graphic instructions and the result sent back to Cloudflare for validation and further action such as  producing the score. There is a lot going on behind the scenes to make sure we get reliable results without sacrificing users’ privacy while being tamper resistant to replay attacks. The system is currently in private beta and being evaluated for its effectiveness and we already see very promising results. Stay tuned for this new detection mechanism becoming widely available and the blog on how we’ve built it.</p><p>This concludes an overview of the five detection mechanisms we’ve built so far. It’s time to sum it all up!</p>
    <div>
      <h3>Summary</h3>
      <a href="#summary">
        
      </a>
    </div>
    <p>Cloudflare has the unique ability to collect data from trillions of requests flowing through its network every week. With this data, Cloudflare is able to identify likely bot activity with Machine Learning, Heuristics, Behavioral Analysis, and other detection mechanisms. Cloudflare Bot Management integrates seamlessly with other Cloudflare products, such as WAF  and Workers.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7thZNko18uGAk7PKwxuG8s/1baf723065de6b686c81d139fbaa0163/image1-1.png" />
            
            </figure><p>All this could not be possible without hard work across multiple teams! First of all thanks to everybody on the Bots Team for their tremendous efforts to make this platform come to life. Other Cloudflare teams, most notably: Firewall, Data, Solutions Engineering, Performance, SRE, helped us a lot to design, build and support this incredible platform.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ox1rh9KPNDIy5h37liIEO/eadc3dc802b748ccc9279bc01b89b508/image11-1.jpg" />
            
            </figure><p>Bots team during Austin team summit 2019 hunting bots with axes :)</p><p>Lastly, there are more blogs from the Bots series coming soon, diving into internals of our detection mechanisms, so stay tuned for more exciting stories about Cloudflare Bot Management!</p> ]]></content:encoded>
            <category><![CDATA[Deep Dive]]></category>
            <category><![CDATA[Bot Management]]></category>
            <category><![CDATA[Bots]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Salt]]></category>
            <category><![CDATA[Machine Learning]]></category>
            <guid isPermaLink="false">5yHu3o1Z2Z1reLsRB0q026</guid>
            <dc:creator>Alex Bocharov</dc:creator>
        </item>
        <item>
            <title><![CDATA[Stream Firewall Events directly to your SIEM]]></title>
            <link>https://blog.cloudflare.com/stream-firewall-events-directly-to-your-siem/</link>
            <pubDate>Fri, 24 Apr 2020 11:00:00 GMT</pubDate>
            <description><![CDATA[ As of today, customers using Cloudflare Logs can create Logpush jobs that send only Firewall Events. These events arrive much faster than our existing HTTP requests logs: they are typically delivered to your logging platform within 60 seconds of sending the response to the client. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The highest trafficked sites using Cloudflare receive billions of requests per day. But only about 5% of those requests typically trigger security rules, whether they be “managed” rules such as our <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> and DDoS protections, or custom rules such as those configured by customers using our powerful Firewall Rules and Rate Limiting engines.</p><p>When enforcement is taken on a request that interrupts the flow of malicious traffic, a <a href="/updates-to-firewall-analytics/#event-based-logging">Firewall Event is logged with detail</a> about the request including which rule triggered us to take action and what action we took, e.g., challenged or blocked outright.</p><p>Previously, if you wanted to ingest all of these events into your <a href="https://www.cloudflare.com/learning/security/what-is-siem/">SIEM</a> or logging platform, you had to take the whole firehose of requests—good and bad—and then filter them client side. If you’re paying by the log line or scaling your own storage solution, this cost can add up quickly. And if you have a security team monitoring logs, they’re being sent a lot of extraneous data to sift through before determining what needs their attention most.</p><p>As of today, customers using Cloudflare Logs can create <a href="https://developers.cloudflare.com/logs/about">Logpush jobs</a> that send only Firewall Events. These events arrive much faster than our existing HTTP requests logs: they are typically delivered to your logging platform within 60 seconds of sending the response to the client.</p><p>In this post we’ll show you how to use Terraform and Sumo Logic, an <a href="https://developers.cloudflare.com/logs/analytics-integrations/">analytics integration partner</a>, to get this logging set up live in just a few minutes.</p>
    <div>
      <h2>Process overview</h2>
      <a href="#process-overview">
        
      </a>
    </div>
    <p>The steps below take you through the process of configuring Cloudflare Logs to push security events directly to your logging platform. For purposes of this tutorial, we’ve chosen Sumo Logic as our log destination, but you’re free to use any of our <a href="https://developers.cloudflare.com/logs/analytics-integrations/">analytics partners</a>, or any logging platform that can read from cloud storage such as <a href="https://developers.cloudflare.com/logs/logpush/aws-s3/">AWS S3</a>, <a href="https://developers.cloudflare.com/logs/logpush/azure/">Azure Blob Storage</a>, or <a href="https://developers.cloudflare.com/logs/logpush/google-cloud-storage/">Google Cloud Storage</a>.</p><p>To configure Sumo Logic and Cloudflare we make use of Terraform, a popular Infrastructure-as-Code tool from HashiCorp. If you’re new to Terraform, see <a href="/getting-started-with-terraform-and-cloudflare-part-1/">Getting started with Terraform and Cloudflare</a> for a guided walkthrough with best practice recommendations such as how to version and store your configuration in git for easy rollback.</p><p>Once the infrastructure is in place, you’ll send a malicious request towards your site to trigger the Cloudflare Web Application Firewall, and watch as the Firewall Events generated by that request shows up in Sumo Logic about a minute later.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7HQ0Ky3j85kh2abquFBJf7/e0ee2a5d4d613bf597c4298e4be73467/image2-18.png" />
            
            </figure>
    <div>
      <h2>Prerequisites</h2>
      <a href="#prerequisites">
        
      </a>
    </div>
    
    <div>
      <h3>Install Terraform and Go</h3>
      <a href="#install-terraform-and-go">
        
      </a>
    </div>
    <p>First you’ll need to install Terraform. See our Developer Docs for <a href="https://developers.cloudflare.com/terraform/installing/">instructions</a>.</p><p>Next you’ll need to install Go. The easiest way on macOS to do so is with <a href="https://brew.sh/">Homebrew</a>:</p>
            <pre><code>$ brew install golang
$ export GOPATH=$HOME/go
$ mkdir $GOPATH</code></pre>
            <p><a href="https://golang.org/">Go</a> is required because the Sumo Logic Terraform Provider is a "community" plugin, which means it has to be built and installed manually rather than automatically through the Terraform Registry, as will happen later for the Cloudflare Terraform Provider.</p>
    <div>
      <h3>Install the Sumo Logic Terraform Provider Module</h3>
      <a href="#install-the-sumo-logic-terraform-provider-module">
        
      </a>
    </div>
    <p>The official installation instructions for installing the Sumo Logic provider can be found on their <a href="https://github.com/SumoLogic/sumologic-terraform-provider">GitHub Project page</a>, but here are my notes:</p>
            <pre><code>$ mkdir -p $GOPATH/src/github.com/terraform-providers &amp;&amp; cd $_
$ git clone https://github.com/SumoLogic/sumologic-terraform-provider.git
$ cd sumologic-terraform-provider
$ make install</code></pre>
            
    <div>
      <h2>Prepare Sumo Logic to receive Cloudflare Logs</h2>
      <a href="#prepare-sumo-logic-to-receive-cloudflare-logs">
        
      </a>
    </div>
    
    <div>
      <h3>Install Sumo Logic livetail utility</h3>
      <a href="#install-sumo-logic-livetail-utility">
        
      </a>
    </div>
    <p>While not strictly necessary, the <a href="https://help.sumologic.com/05Search/Live-Tail/Live-Tail-CLI">livetail tool</a> from Sumo Logic makes it easy to grab the Cloudflare Logs challenge token we’ll need in a minute, and also to view the fruits of your labor: seeing a Firewall Event appear in Sumo Logic shortly after the malicious request hit the edge.</p><p>On macOS:</p>
            <pre><code>$ brew cask install livetail
...
==&gt; Verifying SHA-256 checksum for Cask 'livetail'.
==&gt; Installing Cask livetail
==&gt; Linking Binary 'livetail' to '/usr/local/bin/livetail'.
?  livetail was successfully installed!</code></pre>
            
    <div>
      <h3>Generate Sumo Logic Access Key</h3>
      <a href="#generate-sumo-logic-access-key">
        
      </a>
    </div>
    <p>This step assumes you already have a Sumo Logic account. If not, you can sign up for a free trial <a href="https://www.sumologic.com/sign-up/">here</a>.</p><ol><li><p>Browse to <code>https://service.$ENV.sumologic.com/ui/#/security/access-keys</code> where <code>$ENV</code> should be replaced by <a href="http://help.sumologic.com/Send_Data/Collector_Management_API/Sumo_Logic_Endpoints">the environment</a> you chose on signup.</p></li><li><p>Click the "+ Add Access Key" button, give it a name, and click "Create Key"</p></li><li><p>In the next step you'll save the Access ID and Access Key that are provided as environment variables, so don’t close this modal until you do.</p></li></ol>
    <div>
      <h3>Generate Cloudflare Scoped API Token</h3>
      <a href="#generate-cloudflare-scoped-api-token">
        
      </a>
    </div>
    <ol><li><p>Log in to the <a href="https://dash.cloudflare.com/">Cloudflare Dashboard</a></p></li><li><p>Click on the profile icon in the top-right corner and then select "My Profile"</p></li><li><p>Select "API Tokens" from the nav bar and click "Create Token"</p></li><li><p>Click the "Get started" button next to the "Create Custom Token" label</p></li></ol><p>On the Create Custom Token screen:</p><ol><li><p>Provide a token name, e.g., "Logpush - Firewall Events"</p></li><li><p>Under Permissions, change Account to Zone, and then select Logs and Edit, respectively, in the two drop-downs to the right</p></li><li><p>Optionally, change Zone Resources and IP Address Filtering to restrict restrict access for this token to specific zones or from specific IPs</p></li></ol><p>Click "Continue to summary" and then "Create token" on the next screen. Save the token somewhere secure, e.g., your password manager, as it'll be needed in just a minute.</p>
    <div>
      <h3>Set environment variables</h3>
      <a href="#set-environment-variables">
        
      </a>
    </div>
    <p>Rather than add sensitive credentials to source files (that may get submitted to your source code repository), we'll set environment variables and have the Terraform modules read from them.</p>
            <pre><code>$ export CLOUDFLARE_API_TOKEN="&lt;your scoped cloudflare API token&gt;"
$ export CF_ZONE_ID="&lt;tag of zone you wish to send logs for&gt;"</code></pre>
            <p>We'll also need your Sumo Logic environment, Access ID, and Access Key:</p>
            <pre><code>$ export SUMOLOGIC_ENVIRONMENT="eu"
$ export SUMOLOGIC_ACCESSID="&lt;access id from previous step&gt;"
$ export SUMOLOGIC_ACCESSKEY="&lt;access key from previous step&gt;"</code></pre>
            
    <div>
      <h3>Create the Sumo Logic Collector and HTTP Source</h3>
      <a href="#create-the-sumo-logic-collector-and-http-source">
        
      </a>
    </div>
    <p>We'll create a directory to store our Terraform project in and build it up as we go:</p>
            <pre><code>$ mkdir -p ~/src/fwevents &amp;&amp; cd $_</code></pre>
            <p>Then we'll create the Collector and HTTP source that will store and provide Firewall Events logs to Sumo Logic:</p>
            <pre><code>$ cat &lt;&lt;'EOF' | tee main.tf
##################
### SUMO LOGIC ###
##################
provider "sumologic" {
    environment = var.sumo_environment
    access_id = var.sumo_access_id
}

resource "sumologic_collector" "collector" {
    name = "CloudflareLogCollector"
    timezone = "Etc/UTC"
}

resource "sumologic_http_source" "http_source" {
    name = "firewall-events-source"
    collector_id = sumologic_collector.collector.id
    timezone = "Etc/UTC"
}
EOF</code></pre>
            <p>Then we'll create a variables file so Terraform has credentials to communicate with Sumo Logic:</p>
            <pre><code>$ cat &lt;&lt;EOF | tee variables.tf
##################
### SUMO LOGIC ###
##################
variable "sumo_environment" {
    default = "$SUMOLOGIC_ENVIRONMENT"
}

variable "sumo_access_id" {
    default = "$SUMOLOGIC_ACCESSID"
}
EOF</code></pre>
            <p>With our Sumo Logic configuration set, we’ll initialize Terraform with <code>terraform init</code> and then preview what changes Terraform is going to make by running <code>terraform plan</code>:</p>
            <pre><code>$ terraform init

Initializing the backend...

Initializing provider plugins...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.</code></pre>
            
            <pre><code>$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # sumologic_collector.collector will be created
  + resource "sumologic_collector" "collector" {
      + destroy        = true
      + id             = (known after apply)
      + lookup_by_name = false
      + name           = "CloudflareLogCollector"
      + timezone       = "Etc/UTC"
    }

  # sumologic_http_source.http_source will be created
  + resource "sumologic_http_source" "http_source" {
      + automatic_date_parsing       = true
      + collector_id                 = (known after apply)
      + cutoff_timestamp             = 0
      + destroy                      = true
      + force_timezone               = false
      + id                           = (known after apply)
      + lookup_by_name               = false
      + message_per_request          = false
      + multiline_processing_enabled = true
      + name                         = "firewall-events-source"
      + timezone                     = "Etc/UTC"
      + url                          = (known after apply)
      + use_autoline_matching        = true
    }

Plan: 2 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.</code></pre>
            <p>Assuming everything looks good, let’s execute the plan:</p>
            <pre><code>$ terraform apply -auto-approve
sumologic_collector.collector: Creating...
sumologic_collector.collector: Creation complete after 3s [id=108448215]
sumologic_http_source.http_source: Creating...
sumologic_http_source.http_source: Creation complete after 0s [id=150364538]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.</code></pre>
            <p>Success! At this point you could log into the Sumo Logic web interface and confirm that your Collector and HTTP Source were created successfully.</p>
    <div>
      <h2>Create a Cloudflare Logpush Job</h2>
      <a href="#create-a-cloudflare-logpush-job">
        
      </a>
    </div>
    <p>Before we’ll start sending logs to your collector, you need to demonstrate the ability to read from it. This validation step prevents accidental (or intentional) misconfigurations from overrunning your logs.</p>
    <div>
      <h3>Tail the Sumo Logic Collector and await the challenge token</h3>
      <a href="#tail-the-sumo-logic-collector-and-await-the-challenge-token">
        
      </a>
    </div>
    <p>In a new shell window—you should keep the current one with your environment variables set for use with Terraform—we'll start tailing Sumo Logic for events sent from the <code>firewall-events-source</code> HTTP source.</p><p>The first time that you run livetail you'll need to specify your <a href="https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security">Sumo Logic Environment</a>, Access ID and Access Key, but these values will be stored in the working directory for subsequent runs:</p>
            <pre><code>$ livetail _source=firewall-events-source
### Welcome to Sumo Logic Live Tail Command Line Interface ###
1 US1
2 US2
3 EU
4 AU
5 DE
6 FED
7 JP
8 CA
Please select Sumo Logic environment: 
See http://help.sumologic.com/Send_Data/Collector_Management_API/Sumo_Logic_Endpoints to choose the correct environment. 3
### Authenticating ###
Please enter your Access ID: &lt;access id&gt;
Please enter your Access Key &lt;access key&gt;
### Starting Live Tail session ###</code></pre>
            
    <div>
      <h3>Request and receive challenge token</h3>
      <a href="#request-and-receive-challenge-token">
        
      </a>
    </div>
    <p>Before requesting a challenge token, we need to figure out where Cloudflare should send logs.</p><p>We do this by asking Terraform for the receiver URL of the recently created HTTP source. Note that we modify the URL returned slightly as Cloudflare Logs expects <code>sumo://</code> rather than <code>https://</code>.</p>
            <pre><code>$ export SUMO_RECEIVER_URL=$(terraform state show sumologic_http_source.http_source | grep url | awk '{print $3}' | sed -e 's/https:/sumo:/; s/"//g')

$ echo $SUMO_RECEIVER_URL
sumo://endpoint1.collection.eu.sumologic.com/receiver/v1/http/&lt;redacted&gt;</code></pre>
            <p>With URL in hand, we can now request the token.</p>
            <pre><code>$ curl -sXPOST -H "Content-Type: application/json" -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" -d '{"destination_conf":"'''$SUMO_RECEIVER_URL'''"}' https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/logpush/ownership

{"errors":[],"messages":[],"result":{"filename":"ownership-challenge-bb2912e0.txt","message":"","valid":true},"success":true}</code></pre>
            <p>Back in the other window where your livetail is running you should see something like this:</p>
            <pre><code>{"content":"eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4R0NNIiwidHlwIjoiSldUIn0..WQhkW_EfxVy8p0BQ.oO6YEvfYFMHCTEd6D8MbmyjJqcrASDLRvHFTbZ5yUTMqBf1oniPNzo9Mn3ZzgTdayKg_jk0Gg-mBpdeqNI8LJFtUzzgTGU-aN1-haQlzmHVksEQdqawX7EZu2yiePT5QVk8RUsMRgloa76WANQbKghx1yivTZ3TGj8WquZELgnsiiQSvHqdFjAsiUJ0g73L962rDMJPG91cHuDqgfXWwSUqPsjVk88pmvGEEH4AMdKIol0EOc-7JIAWFBhcqmnv0uAXVOH5uXHHe_YNZ8PNLfYZXkw1xQlVDwH52wRC93ohIxg.pHAeaOGC8ALwLOXqxpXJgQ","filename":"ownership-challenge-bb2912e0.txt"}</code></pre>
            <p>Copy the content value from above into an environment variable, as you'll need it in a minute to create the job:</p>
            <pre><code>$ export LOGPUSH_CHALLENGE_TOKEN="&lt;content value&gt;"</code></pre>
            
    <div>
      <h3>Create the Logpush job using the challenge token</h3>
      <a href="#create-the-logpush-job-using-the-challenge-token">
        
      </a>
    </div>
    <p>With challenge token in hand, we'll use Terraform to create the job.</p><p>First you’ll want to choose the log fields that should be sent to Sumo Logic. You can enumerate the list by querying the dataset:</p>
            <pre><code>$ curl -sXGET -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/logpush/datasets/firewall_events/fields | jq .
{
  "errors": [],
  "messages": [],
  "result": {
    "Action": "string; the code of the first-class action the Cloudflare Firewall took on this request",
    "ClientASN": "int; the ASN number of the visitor",
    "ClientASNDescription": "string; the ASN of the visitor as string",
    "ClientCountryName": "string; country from which request originated",
    "ClientIP": "string; the visitor's IP address (IPv4 or IPv6)",
    "ClientIPClass": "string; the classification of the visitor's IP address, possible values are: unknown | clean | badHost | searchEngine | whitelist | greylist | monitoringService | securityScanner | noRecord | scan | backupService | mobilePlatform | tor",
    "ClientRefererHost": "string; the referer host",
    "ClientRefererPath": "string; the referer path requested by visitor",
    "ClientRefererQuery": "string; the referer query-string was requested by the visitor",
    "ClientRefererScheme": "string; the referer url scheme requested by the visitor",
    "ClientRequestHTTPHost": "string; the HTTP hostname requested by the visitor",
    "ClientRequestHTTPMethodName": "string; the HTTP method used by the visitor",
    "ClientRequestHTTPProtocol": "string; the version of HTTP protocol requested by the visitor",
    "ClientRequestPath": "string; the path requested by visitor",
    "ClientRequestQuery": "string; the query-string was requested by the visitor",
    "ClientRequestScheme": "string; the url scheme requested by the visitor",
    "Datetime": "int or string; the date and time the event occurred at the edge",
    "EdgeColoName": "string; the airport code of the Cloudflare datacenter that served this request",
    "EdgeResponseStatus": "int; HTTP response status code returned to browser",
    "Kind": "string; the kind of event, currently only possible values are: firewall",
    "MatchIndex": "int; rules match index in the chain",
    "Metadata": "object; additional product-specific information. Metadata is organized in key:value pairs. Key and Value formats can vary by Cloudflare security product and can change over time",
    "OriginResponseStatus": "int; HTTP origin response status code returned to browser",
    "OriginatorRayName": "string; the RayId of the request that issued the challenge/jschallenge",
    "RayName": "string; the RayId of the request",
    "RuleId": "string; the Cloudflare security product-specific RuleId triggered by this request",
    "Source": "string; the Cloudflare security product triggered by this request",
    "UserAgent": "string; visitor's user-agent string"
  },
  "success": true
}</code></pre>
            <p>Then you’ll append your Cloudflare configuration to the <code>main.tf</code> file:</p>
            <pre><code>$ cat &lt;&lt;EOF | tee -a main.tf

##################
### CLOUDFLARE ###
##################
provider "cloudflare" {
  version = "~&gt; 2.0"
}

resource "cloudflare_logpush_job" "firewall_events_job" {
  name = "fwevents-logpush-job"
  zone_id = var.cf_zone_id
  enabled = true
  dataset = "firewall_events"
  logpull_options = "fields=RayName,Source,RuleId,Action,EdgeResponseStatusDatetime,EdgeColoName,ClientIP,ClientCountryName,ClientASNDescription,UserAgent,ClientRequestHTTPMethodName,ClientRequestHTTPHost,ClientRequestHTTPPath&amp;timestamps=rfc3339"
  destination_conf = replace(sumologic_http_source.http_source.url,"https:","sumo:")
  ownership_challenge = "$LOGPUSH_CHALLENGE_TOKEN"
}
EOF</code></pre>
            <p>And add to the <code>variables.tf</code> file:</p>
            <pre><code>$ cat &lt;&lt;EOF | tee -a variables.tf

##################
### CLOUDFLARE ###
##################
variable "cf_zone_id" {
  default = "$CF_ZONE_ID"
}</code></pre>
            <p>Next we re-run <code>terraform init</code> to install the latest Cloudflare Terraform Provider Module. You’ll need to make sure you have at least version 2.6.0 as this is the version in which we added Logpush job support:</p>
            <pre><code>$ terraform init

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "cloudflare" (terraform-providers/cloudflare) 2.6.0...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.</code></pre>
            <p>With the latest Terraform installed, we check out the plan and then apply:</p>
            <pre><code>$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

sumologic_collector.collector: Refreshing state... [id=108448215]
sumologic_http_source.http_source: Refreshing state... [id=150364538]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # cloudflare_logpush_job.firewall_events_job will be created
  + resource "cloudflare_logpush_job" "firewall_events_job" {
      + dataset             = "firewall_events"
      + destination_conf    = "sumo://endpoint1.collection.eu.sumologic.com/receiver/v1/http/(redacted)"
      + enabled             = true
      + id                  = (known after apply)
      + logpull_options     = "fields=RayName,Source,RuleId,Action,EdgeResponseStatusDatetime,EdgeColoName,ClientIP,ClientCountryName,ClientASNDescription,UserAgent,ClientRequestHTTPMethodName,ClientRequestHTTPHost,ClientRequestHTTPPath&amp;timestamps=rfc3339"
      + name                = "fwevents-logpush-job"
      + ownership_challenge = "(redacted)"
      + zone_id             = "(redacted)"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.</code></pre>
            
            <pre><code>$ terraform apply --auto-approve
sumologic_collector.collector: Refreshing state... [id=108448215]
sumologic_http_source.http_source: Refreshing state... [id=150364538]
cloudflare_logpush_job.firewall_events_job: Creating...
cloudflare_logpush_job.firewall_events_job: Creation complete after 3s [id=13746]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.</code></pre>
            <p>Success! Last step is to test your setup.</p>
    <div>
      <h2>Testing your setup by sending a malicious request</h2>
      <a href="#testing-your-setup-by-sending-a-malicious-request">
        
      </a>
    </div>
    <p>The following step assumes that you have the Cloudflare WAF turned on. Alternatively, you can create a Firewall Rule to match your request and generate a Firewall Event that way.</p><p>First make sure that livetail is running as described earlier:</p>
            <pre><code>$ livetail "_source=firewall-events-source"
### Authenticating ###
### Starting Live Tail session ###</code></pre>
            <p>Then in a browser make the following request <code>https://example.com/&lt;script&gt;alert()&lt;/script&gt;</code>. You should see the following returned:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4FOw7aQFIaaERMSbi2bRH3/3ca02fb0fa377956d28b444f4c5b2034/sqli-upinatoms.png" />
            
            </figure><p>And a few moments later in livetail:</p>
            <pre><code>{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"958052","Action":"log","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}
{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"958051","Action":"log","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}
{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"973300","Action":"log","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}
{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"973307","Action":"log","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}
{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"973331","Action":"log","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}
{"RayName":"58830d3f9945bc36","Source":"waf","RuleId":"981176","Action":"drop","EdgeColoName":"LHR","ClientIP":"203.0.113.69","ClientCountryName":"gb","ClientASNDescription":"NTL","UserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36","ClientRequestHTTPMethodName":"GET","ClientRequestHTTPHost":"upinatoms.com"}</code></pre>
            <p>Note that for this one malicious request Cloudflare Logs actually sent 6 separate Firewall Events to Sumo Logic. The reason for this is that this specific request triggered a variety of different Managed Rules: #958051, 958052, 973300, 973307, 973331, and 981176.</p>
    <div>
      <h2>Seeing it all in action</h2>
      <a href="#seeing-it-all-in-action">
        
      </a>
    </div>
    <p>Here's a demo of  launching <code>livetail</code>, making a malicious request in a browser, and then seeing the result sent from the Cloudflare Logpush job:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5KtWEvKCr6QrbGKWZGzQ3a/1142fa4d2dddb6fd7cd7278d3273e0ee/fwevents-sumo-demo.gif" />
            
            </figure> ]]></content:encoded>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Terraform]]></category>
            <category><![CDATA[SIEM]]></category>
            <guid isPermaLink="false">4JdLdzVCAsQGdNwMq7VgCa</guid>
            <dc:creator>Patrick R. Donahue</dc:creator>
        </item>
        <item>
            <title><![CDATA[Firewall Analytics: Now available to all paid plans]]></title>
            <link>https://blog.cloudflare.com/updates-to-firewall-analytics/</link>
            <pubDate>Mon, 09 Dec 2019 15:16:00 GMT</pubDate>
            <description><![CDATA[ Our Firewall Analytics tool enables customers to quickly identify and investigate security threats using an intuitive interface. Until now, this tool had only been available to our Enterprise customers. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3MddwtNEkcoYXgRJ0EnqvU/0530e588f4f11bae3b853de37c135c50/image2.png" />
            
            </figure><p>Our <a href="/new-firewall-tab-and-analytics/">Firewall Analytics tool</a> enables customers to quickly identify and investigate security threats using an intuitive interface. Until now, this tool had only been available to our Enterprise customers, who have been using it to get detailed insights into their traffic and better tailor their security configurations. Today, we are excited to make Firewall Analytics available to all paid plans and share details on several recent improvements we have made.</p><p><a href="https://www.cloudflare.com/plans/">All paid plans</a> are now able to take advantage of these capabilities, along with several important enhancements we’ve made to improve our customers’ workflow and productivity.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7bYZvtN92yqQd8QPEyFk9D/59575d5311ed8a5ddff04f41d25b24d0/image-4.png" />
            
            </figure>
    <div>
      <h3>Increased Data Retention and Adaptive Sampling</h3>
      <a href="#increased-data-retention-and-adaptive-sampling">
        
      </a>
    </div>
    <p>Previously, Enterprise customers could view 14 days of Firewall Analytics for their domains. Today we’re increasing that retention to 30 days, and again to 90 days in the coming months. Business and Professional plan zones will get 30 and 3 days of retention, respectively.</p><p>In addition to the extended retention, we are introducing adaptive sampling to guarantee that Firewall Analytics results are displayed in the Cloudflare Dashboard quickly and reliably, even when you are under a massive attack or otherwise receiving a large volume of requests.</p><p>Adaptive sampling works similar to Netflix: when your internet connection runs low on bandwidth, you receive a slightly downscaled version of the video stream you are watching. When your bandwidth recovers, Netflix then upscales back to the highest quality available.</p><p>Firewall Analytics does this sampling on each query, ensuring that customers see the best precision available in the UI given current load on the zone. When results are sampled, the sampling rate will be displayed as shown below:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1ungfGudFqQaaSjhQiL5Dj/e1d3390f78ee4291fc2495a07ed55994/image4.png" />
            
            </figure>
    <div>
      <h3>Event-Based Logging</h3>
      <a href="#event-based-logging">
        
      </a>
    </div>
    <p>As adoption of our expressive <a href="/announcing-firewall-rules/">Firewall Rules engine</a> has grown, one consistent ask we’ve heard from customers is for a more streamlined way to see <i>all</i> Firewall Events generated by a specific rule. Until today, if a malicious request matched multiple rules, only the last one to execute was shown in the Activity Log, requiring customers to click into the request to see if the rule they’re investigating was listed as an “Additional match”.</p><p>To streamline this process, we’ve changed how the Firewall Analytics UI interacts with the Activity Log. Customers can now filter by a specific rule (or any other criteria) and see a row for each event generated by that rule. This change also makes it easier to review all requests that would have been blocked by a rule by creating it in Log mode first before changing it to Block.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4qtBKSFpvDKii1LsIVdrbC/2687ffb2829d9507fbc66926a9080d8a/image8.png" />
            
            </figure>
    <div>
      <h3>Challenge Solve Rates to help reduce False Positives</h3>
      <a href="#challenge-solve-rates-to-help-reduce-false-positives">
        
      </a>
    </div>
    <p>When our customers write rules to block undesired, automated traffic they want to make sure they’re not blocking or challenging desired traffic, e.g., humans wanting to make a purchase should be allowed but not bots scraping pricing.</p><p>To help customers determine what percent of CAPTCHA challenges returned to users may have been unnecessary, i.e., false positives, we are now showing the Challenge Solve Rate (CSR) for each rule. If you’re seeing rates higher than expected, e.g., for your <a href="https://www.cloudflare.com/products/bot-management/">Bot Management</a> rules, you may want to relax the rule criteria. If the rate you see is 0% indicating that no CAPTCHAs are being solved, you may want to change the rule to Block outright rather than challenge.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6CvqEGoEL5hVokVBlnCMrL/92754bda94c5b3ad2c645d1f268d5a4c/image1.png" />
            
            </figure><p>Hovering over the CSR rate will reveal the number of CAPTCHAs issued vs. solved:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2QEssrmjuvixEQwyRLJL6d/cbc33b830fc482b0ced77f2814d0d536/pasted-image-0.png" />
            
            </figure>
    <div>
      <h3>Exporting Firewall Events</h3>
      <a href="#exporting-firewall-events">
        
      </a>
    </div>
    <p>Business and Enterprise customers can now export a set of 500 events from the Activity Log. The data exported are those events that remain after any selected filters have been applied.</p>
    <div>
      <h3>Column Customization</h3>
      <a href="#column-customization">
        
      </a>
    </div>
    <p>Sometimes the columns shown in the Activity Log do not contain the details you want to see to analyze the threat. When this happens, you can now click “Edit Columns” to select the fields you want to see. For example, a customer diagnosing a Bot related issue may want to also view the User-Agent and the source country whereas a customer investigating a DDoS attack may want to see IP addresses, ASNs, Path, and other attributes. You can now customize what you’d like to see as shown below.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3MN19rZ4CIAeomTXRAbIm3/bc0ba763ddb04978f33156824fa518c7/image-3.png" />
            
            </figure><p>We would love to hear your feedback and suggestions, so feel free to reach out to us via our <a href="https://community.cloudflare.com/">Community forums</a> or through your Customer Success team.</p><p>If you’d like to receive more updates like this one directly to your inbox, <a href="/subscribe/">please subscribe to our Blog</a>!</p> ]]></content:encoded>
            <category><![CDATA[Insights]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">3k18hNXR8FdvyMN2sfVzaz</guid>
            <dc:creator>Alex Cruz Farmer</dc:creator>
        </item>
        <item>
            <title><![CDATA[Supercharging Firewall Events for Self-Serve]]></title>
            <link>https://blog.cloudflare.com/supercharging-firewall-events-for-self-serve/</link>
            <pubDate>Thu, 22 Aug 2019 13:00:00 GMT</pubDate>
            <description><![CDATA[ Today, I’m very pleased to announce the release of a completely overhauled version of our Firewall Event log to our Free, Pro and Business customers. This new Firewall Events log is now available in your Dashboard, and you are not required to do anything to receive this new capability. ]]></description>
            <content:encoded><![CDATA[ <p>Today, I’m very pleased to announce the release of a completely overhauled version of our Firewall Event log to our Free, Pro and Business customers. This new Firewall Events log is now available in your Dashboard, and you are not required to do anything to receive this new capability.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/141jSRK1fTPux3n04DH7ud/0dcd81e892295258abd387fcfa4fbb61/image1-6.png" />
            
            </figure>
    <div>
      <h2>No more modals!</h2>
      <a href="#no-more-modals">
        
      </a>
    </div>
    <p>We have done away with those pesky modals, providing a much smoother user experience. To review more detailed information about an event, you simply click anywhere on the event list row.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/VRogojtxjTNxa5Xjo5UBK/6611c2560fd3b102c69f33a42a3de1f2/image4-3.png" />
            
            </figure><p>In the expanded view, you are provided with all the information you may need to identify or diagnose issues with your Firewall or find more details about a potential threat to your application.</p>
    <div>
      <h2>Additional matches per event</h2>
      <a href="#additional-matches-per-event">
        
      </a>
    </div>
    <p>Cloudflare has several Firewall features to give customers granular control of their security. With this control comes some complexity when debugging why a request was stopped by the Firewall. To help clarify what happened, we have provided an “Additional matches” count at the bottom for events triggered by multiple services or rules for the same request. Clicking the number expands a list showing each rule and service along with the corresponding action.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4fqalGyuTVZGq4sEX8Dtl8/cf7278c59f4e83c748083ffadc512a9c/image5.png" />
            
            </figure>
    <div>
      <h2>Search for any field within a Firewall Event</h2>
      <a href="#search-for-any-field-within-a-firewall-event">
        
      </a>
    </div>
    <p>This is one of my favourite parts of our new Firewall Event Log. Many of our customers have expressed their frustration with the difficulty of pinpointing specific events. This is where our new search capabilities come into their own. Customers can now filter and freeform search for any field that is visible in a Firewall Event!</p><p>Let’s say you want to find all the requests originating from a specific ISP or country where your Firewall Rules issued a JavaScript challenge. There are two different ways to do this in the UI.</p><p>Firstly, when in the detail view, you can create an <i>include</i> or <i>exclude</i> filter for that field value.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7xIXJmuiiwnn8xlida4IaN/0af3214cc4f4b70b265f7d84a541a1a8/image6.gif" />
            
            </figure><p>Secondly, you can create a freeform filter using the “+ Add Filter” button at the top, or edit one of the already filtered fields:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5xg5KWxcCmxUCyRrNsw6dp/9e43274178c59c966ce32dfad233cdd0/image2.gif" />
            
            </figure><p>As illustrated above, with our WAF Managed Rules enabled in log only, we can see all the rules which would have triggered if this was a legitimate attack. This allows you to confirm that your configuration is working as expected.</p>
    <div>
      <h2>Scoping your search to a specific date and time</h2>
      <a href="#scoping-your-search-to-a-specific-date-and-time">
        
      </a>
    </div>
    <p>In our old Firewall Event Log, to find an event, users had to traverse through many pages to find Events from a specific date. The last major change we have added is the capability to select a time window to view events between two points in time over the last 2 weeks. In the time selection window, Free and Pro customers can choose a 24 hour time window and our Business customers can view up to 72 hours.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4tHEAR3fymBerYnU86FSsk/4424d791d85ecaede8c05cb639c1c326/image3.gif" />
            
            </figure>
    <div>
      <h2>We want your feedback!</h2>
      <a href="#we-want-your-feedback">
        
      </a>
    </div>
    <p>We need your help! Please feel free to leave any feedback on our <a href="https://community.cloudflare.com">Community forums</a>, or open a Support ticket with any problems you find. Your feedback is critical to our product improvement process, and we look forward to hearing from you.</p> ]]></content:encoded>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Dashboard]]></category>
            <guid isPermaLink="false">f2KfzUCSa58hGW7XhGCY5</guid>
            <dc:creator>Alex Cruz Farmer</dc:creator>
        </item>
        <item>
            <title><![CDATA[Protecting Project Galileo websites from HTTP attacks]]></title>
            <link>https://blog.cloudflare.com/protecting-galileo-websites/</link>
            <pubDate>Thu, 13 Jun 2019 13:00:00 GMT</pubDate>
            <description><![CDATA[ Yesterday, we celebrated the fifth anniversary of Project Galileo. More than 550 websites are part of this program, and they have something in common: each and every one of them has been subject to attacks in the last month. ]]></description>
            <content:encoded><![CDATA[ <p>Yesterday, we celebrated the <a href="/project-galileo-fifth-anniversary/">fifth anniversary of Project Galileo</a>. More than 550 websites are part of this program, and they have something in common: each and every one of them has been subject to attacks in the last month. In this blog post, we will look at the security events we observed between the 23 April 2019 and 23 May 2019.</p><p>Project Galileo sites are protected by the Cloudflare Firewall and Advanced DDoS Protection which contain a number of features that can be used to detect and mitigate different types of attack and suspicious traffic. The following table shows how each of these features contributed to the protection of sites on Project Galileo.</p>
    <div>
      <h3>WAF (Web Application Firewall)</h3>
      <a href="#waf-web-application-firewall">
        
      </a>
    </div>
    <p>Although not the most impressive in terms of blocked requests, the <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> is the most interesting as it identifies and blocks malicious requests, based on heuristics and rules that are the result of seeing attacks across all of our customers and learning from those. The WAF is available to all of our paying customers, protecting them against 0-days, SQL/XSS exploits and more. For the Project Galileo customers the WAF rules blocked more than <b>4.5</b> million requests in the month that we looked at, matching over 130 WAF rules and approximately 150k requests per day.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/xeVZ4bwsq4aySUxpIdXkU/d97be07840a080be16f7cf6a8e65135c/AJxk6op83jW6A3LcLLhGJaGFaVpCsBd4ty_K_QhFcnW0_FKXEkJYV6bbIvg7DL-yOtWIfmvlEVChFTmGh8IMjywqn2adoBwb8fmY6-Birvpx43kAgzsjwqx2YmAX.png" />
            
            </figure><p>Heat map showing the attacks seen on customer sites (rows) per day (columns)</p><p>This heat map may initially appear confusing but reading one is easy once you know what to expect so bear with us! It is a table where each line is a website on Project Galileo and each column is a day. The color represents the number of requests triggering WAF rules - on a scale from 0 (white) to a lot (dark red). The darker the cell, the more requests were blocked on this day.</p><p>We observe malicious traffic on a daily basis for most websites we protect. The average Project Galileo site saw malicious traffic for 27 days in the 1 month observed, and for almost 60% of the sites we noticed daily events.</p><p>Fortunately, the vast majority of websites only receive a few malicious requests per day, likely from automated scanners. In some cases, we notice a net increase in attacks against some websites - and a few websites are under a constant influx of attacks.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3jspr63m1ZPzhccip8JViU/2d3bdf2c382b12ecf60bb107079a0fb3/KaFgtLheT89hQ073frYp-5DBiBPAESZ93t6FIPYz8t0oo02omlH8sugpKIGJA847c8jh2O0iErKU61Vuf06IAeCNQWn8TT-eETZu-SkgIYCl98GtxVCEqC0hIPWf.png" />
            
            </figure><p>Heat map showing the attacks blocked for each WAF rule (rows) per day (columns)</p><p>This heat map shows the WAF rules that blocked requests by day. At first, it seems some rules are useless as they never match malicious requests, but this plot makes it obvious that some attack vectors become active all of a sudden (isolated dark cells). This is especially true for 0-days, malicious traffic starts once an exploit is published and is very active on the first few days. The dark active lines are the most common malicious requests, and these WAF rules protect against things like <a href="https://www.cloudflare.com/learning/security/how-to-prevent-xss-attacks/">XSS</a> and SQL injection attacks.</p>
    <div>
      <h3>DoS (Denial of Service)</h3>
      <a href="#dos-denial-of-service">
        
      </a>
    </div>
    <p>A <a href="https://www.cloudflare.com/learning/ddos/ddos-mitigation/"><b>DoS</b></a> attack prevents legitimate visitors from accessing a website by flooding it with bad traffic.  Due to the way Cloudflare works, websites protected by Cloudflare are immune to many DoS vectors, out of the box. We block layer 3 and 4 attacks, which includes SYN floods and UDP amplifications. DNS nameservers, often described as the Internet’s phone book, are fully managed by Cloudflare, and protected - visitors know how to reach the websites.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7dkARodmacrTw5PrQla5Oy/f9ee8f84538a7af737977fd3f002764b/QKswAfRZDj8yH9Q6c6sWB0x-KokAOFijKoFRwT6lsE9JYmc6hR9SbVgkvjRdbATfczLZ5ZPLtRzZMEuwximdwmKgPgH7Gno9GHZWL27VX3xSPY0CMI7JRCxLe9M.jpeg" />
            
            </figure><p>Line plot - requests per second to a website under DoS attack</p><p>Can you spot the attack?</p><p>As for layer 7 attacks (for instance, HTTP floods), we rely on Gatebot, an automated tool to detect, analyse and block DoS attacks, so you can sleep. The graph shows the requests per second we received on a zone, and whether or not it reached the origin server. As you can see, the bad traffic was identified automatically by Gatebot, and more than 1.6 million requests were blocked as a result.</p>
    <div>
      <h3>Firewall Rules</h3>
      <a href="#firewall-rules">
        
      </a>
    </div>
    <p>For websites with specific requirements we provide tools to allow customers to block traffic to precisely fit their needs. Customers can easily implement complex logic using Firewall Rules to filter out specific chunks of traffic, block IPs / Networks / Countries using Access Rules and Project Galileo sites have done just that. Let’s see a few examples.</p><p><a href="/announcing-firewall-rules/"><b>Firewall Rules</b></a> allows website owners to challenge or block as much or as little traffic as they desire, and this can be done as a surgical tool “block just this request” or as a general tool “challenge every request”.</p><p>For instance, a well-known website used <b>Firewall Rules</b> to prevent twenty IPs from fetching specific pages. 3 of these IPs were then used to send a total of 4.5 million requests over a short period of time, and the following chart shows the requests seen for this website. When this happened Cloudflare, mitigated the traffic ensuring that the website remains available.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1QX05tYEJtJONlXhXLT4Rd/0b481c7b58a8101bd588801ab96b6b7f/vO5ctEREt3GkkAHbKc3YGsP52-1_G0BEFUgcjL7pvlYGwkjHv5xm5X6QI3yD84bBlArh7hjI-CI2qWZ-pU-DBsF0gBXBMjA0YcLfMVcc2gG__20xRKI86ObNvfjS.png" />
            
            </figure><p>Cumulative line plot. Requests per second to a website</p><p>Another website, built with WordPress, is using Cloudflare to cache their webpages. As POST requests are not cacheable, they always hit the origin machine and increase load on the origin server - that’s why this website is using firewall rules to block POST requests, except on their administration backend. Smart!</p><p>Website owners can also deny or challenge requests based on the visitor’s IP address, Autonomous System Number (ASN) or Country. Dubbed <a href="https://support.cloudflare.com/hc/en-us/articles/217074967-Configuring-IP-Access-Rules"><b>Access Rules</b></a>, it is enforced on all pages of a website - hassle-free.</p><p>For example, a news website is using Cloudflare’s Access Rules to challenge visitors from countries outside of their geographic region who are accessing their website. We enforce the rules globally even for cached resources, and take care of GeoIP database updates for them, so they don’t have to.</p><p>The <a href="https://support.cloudflare.com/hc/en-us/articles/115001595131-How-do-I-Lockdown-URLs-in-Cloudflare-"><b>Zone Lockdown</b></a> utility restricts a specific URL to specific IP addresses. This is useful to protect an internal but public path being accessed by external IP addresses. A non-profit based in the United Kingdom is using Zone Lockdown to restrict access to their WordPress’ admin panel and login page, hardening their website without relying on non official plugins. Although it does not prevent very sophisticated attacks, it shields them against automated attacks and phishing attempts - as even if their credentials are stolen, they can’t be used as easily.</p>
    <div>
      <h3>Rate Limiting</h3>
      <a href="#rate-limiting">
        
      </a>
    </div>
    <p>Cloudflare acts as a CDN, caching resources and happily serving them, reducing bandwidth used by the origin server … and indirectly the costs. Unfortunately, not all requests can be cached and some requests are very expensive to handle. Malicious users may abuse this to increase load on the server, and website owners can rely on our <a href="https://support.cloudflare.com/hc/en-us/articles/235240767-Cloudflare-Rate-Limiting"><b>Rate Limit</b></a> to help them: they define thresholds, expressed in requests over a time span, and we make sure to enforce this threshold. A non-profit fighting against poverty relies on rate limits to protect their donation page, and we are glad to help!</p>
    <div>
      <h3>Security Level</h3>
      <a href="#security-level">
        
      </a>
    </div>
    <p>Last but not least, one of Cloudflare’s greatest assets is our threat intelligence. With such a wide lens of the threat landscape, Cloudflare uses our Firewall data, combined with machine learning to curate our IP Reputation databases. This data is provided to all Cloudflare customers, and is configured through our <b>Security Level</b> feature. Customers then may define their threshold sensitivity, ranging  from <b>Essentially Off</b> to <b>I’m Under Attack</b>. For every incoming request, we ask visitors to complete a challenge if the score is above a customer defined threshold. This system alone is responsible for 25% of the requests we mitigated: it’s extremely easy to use, and it constantly learns from the other protections.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>When taken together, the Cloudflare Firewall features provide our Project Galileo customers comprehensive and effective security that enables them to ensure their important work is available. The majority of security events were handled automatically, and this is our strength - security that is always on, always available, always learning.</p> ]]></content:encoded>
            <category><![CDATA[Project Galileo]]></category>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Attacks]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <guid isPermaLink="false">kOHvUGZUIed1rVROWYqvt</guid>
            <dc:creator>Maxime Guerreiro</dc:creator>
        </item>
        <item>
            <title><![CDATA[Spectrum for UDP: DDoS protection and firewalling for unreliable protocols]]></title>
            <link>https://blog.cloudflare.com/spectrum-for-udp-ddos-protection-and-firewalling-for-unreliable-protocols/</link>
            <pubDate>Wed, 20 Mar 2019 15:01:00 GMT</pubDate>
            <description><![CDATA[ Today, we're announcing Spectrum for UDP. Spectrum for UDP works the same as Spectrum for TCP: Spectrum sits between your clients and your origin. Incoming connections are proxied through, whilst applying our DDoS protection and IP Firewall rules.  ]]></description>
            <content:encoded><![CDATA[ <p>Today, we're announcing Spectrum for UDP. Spectrum for UDP works the same as Spectrum for TCP: Spectrum sits between your clients and your origin. Incoming connections are <i>proxied</i> through, whilst applying our DDoS protection and IP Firewall rules. This allows you to protect your services from all sorts of nasty attacks and completely hides your origin behind Cloudflare.</p><p>Last year, we launched <a href="/spectrum/">Spectrum</a>. Spectrum brought the power of our DDoS and firewall features to all TCP ports and services. Spectrum for TCP allows you to protect your SSH services, gaming protocols, and as of last month, even <a href="https://developers.cloudflare.com/spectrum/getting-started/ftp/">FTP servers</a>. We’ve seen customers running all sorts of applications behind Spectrum, such as <a href="https://www.bitfly.at">Bitfly</a>, <a href="https://nicehash.com">Nicehash</a>, and <a href="https://hypixel.net">Hypixel</a>.</p><p>This is great if you're running TCP services, but plenty of our customers also have workloads running over UDP. As an example, many multiplayer games prefer the low cost and lighter weight of UDP and don't care about whether packets arrive or not.</p><p>UDP applications have historically been hard to protect and secure, which is why we built Spectrum for UDP. Spectrum for UDP allows you to protect standard UDP services (such as RDP over UDP), but can also protect any custom protocol you come up with! The only requirement is that it uses UDP as an underlying protocol.</p>
    <div>
      <h3>Configuring a UDP application on Spectrum</h3>
      <a href="#configuring-a-udp-application-on-spectrum">
        
      </a>
    </div>
    <p>To configure on the dashboard, simply switch the application type from TCP to UDP:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6mq0LQqGOJk7r1M8rwwC8P/fb5cab669371da0048342fc1c00a018e/image1.png" />
            
            </figure>
    <div>
      <h3>Retrieving client information</h3>
      <a href="#retrieving-client-information">
        
      </a>
    </div>
    <p>With Spectrum, we terminate the connection and open a new one to your origin. But, what if you want to still see who's actually connecting to you? For TCP, there's <a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt">Proxy Protocol</a>. Whilst initially introduced by HAProxy, it has since been adopted by more parties, such as <a href="https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/">nginx</a>. We added <a href="https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/">support</a> late 2018, allowing you to easily read the client's IP and port from a header that precedes each data stream.</p><p>Unfortunately, there is no equivalent for UDP, so we're rolling our own. Due to the fact that UDP is connection-less, we can't get away with the Proxy Protocol approach for TCP, which prepends the entire stream with one header. Instead, we are forced to prepend each packet with a small header that specifies:</p><ul><li><p>the original client IP</p></li><li><p>the Spectrum IP</p></li><li><p>the original client port</p></li><li><p>the Spectrum port</p></li></ul><p>Schema representing a UDP packet prefaced with our <i>Simple Proxy Protocol</i> header.</p>
            <pre><code>0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Magic Number         |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                                                               +
|                                                               |
+                         Client Address                        +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                                                               +
|                                                               |
+                         Proxy Address                         +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |         Client Port           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Proxy Port          |          Payload...           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</code></pre>
            <p>Simple Proxy Protocol is turned off by default, which means UDP packets will arrive at your origin as if they were sent from Spectrum. To enable, just enable it on your Spectrum app.</p>
    <div>
      <h3>Getting access to Spectrum for UDP</h3>
      <a href="#getting-access-to-spectrum-for-udp">
        
      </a>
    </div>
    <p>We're excited about launching this and and even more excited to see what you'll build and protect with it. In fact, what if you could build serverless services on Spectrum, without actually having an origin running? Stay tuned for some cool announcements in the near future.</p><p>Spectrum for UDP is currently an Enterprise-only feature. To get UDP enabled for your account, please reach out to your account team and we’ll get you set up.</p><p>One more thing... if you’re at <a href="https://gdconf.com">GDC</a> this year, say hello at booth <a href="https://www.expocad.com/host/fx/ubm/gdc19/exfx.html#floorplan">P1639</a>! We’d love to talk more and learn about what you’d like to do with Spectrum.</p> ]]></content:encoded>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Spectrum]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[TCP]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Firewall]]></category>
            <guid isPermaLink="false">5sYOiRAlrMZkxNKFcfX66T</guid>
            <dc:creator>Achiel van der Mandele</dc:creator>
        </item>
        <item>
            <title><![CDATA[How we made Firewall Rules]]></title>
            <link>https://blog.cloudflare.com/how-we-made-firewall-rules/</link>
            <pubDate>Mon, 04 Mar 2019 13:00:00 GMT</pubDate>
            <description><![CDATA[ Recently we launched Firewall Rules, a new feature that allows you to construct expressions that perform complex matching against HTTP requests and then choose how that traffic is handled. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Recently we launched <a href="/announcing-firewall-rules/">Firewall Rules</a>, a new feature that allows you to construct expressions that perform complex matching against HTTP requests and then choose how that traffic is handled. As a Firewall feature you can, of course, block traffic. The expressions we support within Firewall Rules along with powerful control over the order in which they are applied allows complex new behaviour.</p><p>In this blog post I tell the story of Cloudflare’s <a href="https://www.cloudflare.com/features-page-rules/">Page Rules</a> mechanism and how Firewall Rules came to be. Along the way I’ll look at the technical choices that led to us building the new matching engine in Rust.</p>
    <div>
      <h3>The evolution of the Cloudflare Firewall</h3>
      <a href="#the-evolution-of-the-cloudflare-firewall">
        
      </a>
    </div>
    <p>Cloudflare offers two types of firewall for web applications, a managed firewall in the form of a <a href="https://en.wikipedia.org/wiki/Web_application_firewall">WAF</a> where we write and maintain the rules for you, and a configurable firewall where you write and maintain rules. In this article, we will focus on the configurable firewall.</p><p>One of the earliest Cloudflare firewall features was the IP Access Rule. It dates backs to the earliest versions of the Cloudflare Firewall and simply allows you to block traffic from specific IP addresses:</p>
            <pre><code>if request IP equals 203.0.113.1 then block the request</code></pre>
            <p>As attackers and spammers frequently launched attacks from a given network we also introduced the <a href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)">ASN</a> matching capability:</p>
            <pre><code>if request IP belongs to ASN 64496 then block the request</code></pre>
            <p>We also allowed blocking ranges of addresses defined by <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR</a> notation when an IP was too specific and an ASN too broad:</p>
            <pre><code>if request IP is within 203.0.113.0/24 then block the request</code></pre>
            <p>Blocking is not the only action you might need and so other actions are available:</p><ul><li><p>Allowlist = apply no other firewall rules and allow the request to pass this part of the firewall</p></li><li><p>Challenge = issue a <a href="https://en.wikipedia.org/wiki/CAPTCHA">CAPTCHA</a> and if this is passed then allow the request but otherwise deny. This would be used to determine if the request came from a human operator</p></li><li><p>JavaScript challenge = issue an automated JavaScript challenge and if this is passed then allow the request. This would be used to determine if the request came from a simple stateless bot (perhaps a wget or curl script)</p></li><li><p>Block = deny the request</p></li></ul><p>Cloudflare also has Page Rules. Page Rules allow you to match full URIs and then perform actions such as redirects or to raise the security level which can be considered firewall functions:</p>
            <pre><code>if request URI matches /nullroute then redirect to http://127.0.0.1</code></pre>
            <p>Cloudflare also added GeoIP information within an HTTP header and the firewall was extended to include that:</p>
            <pre><code>if request IP originates from county GB then CAPTCHA the request</code></pre>
            <p>All of the above existed in Cloudflare pre-2014, and then during 2016 we set about to identify the most commonly requested firewall features (according to Customer Support tickets and feedback from paying customers) and provide a self-service solution. From that analysis, we added three new capabilities during late 2016: Rate Limiting, User Agent Rules, and Zone Lockdown.</p><p>Whilst Cloudflare automatically stops very large denial of service attacks, rate limiting allowed customers to stop smaller attacks that were a real concern to them but were low enough volume that Cloudflare’s DDoS defences were not being applied.</p>
            <pre><code>if request method is POST and request URI matches /wp-admin/index.php and response status code is 403 and more than 3 requests like this occur in a 15 minute time period then block the traffic for 2 hours</code></pre>
            <p>User Agent rules are as simple as:</p>
            <pre><code>if request user_agent is `Fake User Agent` then CAPTCHA the request</code></pre>
            <p>Zone Lockdown, however was the first default deny feature. The Cloudflare Firewall could be thought of as “allow all traffic, except where a rule exists to block it”. Zone Lockdown is the opposite “for a given URI, block all traffic, except where a rule exists to allow it”.</p><p>Zone Lockdown allowed customers could to block access to a public website for all but a few IP addresses or IP ranges. For example, many customers wanted access to a staging website to only be available to their office IP addresses.</p>
            <pre><code>if request URI matches https://staging.example.com/ and request IP not in 203.0.113.0/24 then block the request</code></pre>
            <p>Finally, an Enterprise customer could also contact Cloudflare and have a truly bespoke rule created for them within the WAF engine.</p>
    <div>
      <h3>Seeing the problem</h3>
      <a href="#seeing-the-problem">
        
      </a>
    </div>
    <p>The firewall worked well for simple mitigation, but it didn’t fully meet the needs of our customers.</p><p>Each of the firewall features had targeted a single attribute, and the interfaces and implementations reflected that. Whilst the Cloudflare Firewall had evolved to solve a problem as each problem arose, these did not work together. In late 2017 you could sum up the firewall capabilities as:</p><p>You can block any attack traffic on any criteria, so long as you <b>only</b> pick <b>one</b> of:</p><ul><li><p>IP</p></li><li><p>CIDR</p></li><li><p>ASN</p></li><li><p>Country</p></li><li><p>User Agent</p></li><li><p>URI</p></li></ul><p>We saw the problem, but how to fix it?</p><p>We match our firewall rules in two ways:</p><ul><li><p>Lookup matching</p></li><li><p>String pattern matching</p></li></ul><p>Lookup matching covers the IP, CIDR, ASN, Country and User Agent rules. We would create a key in our globally distributed key/value data store Quicksilver, and store the action in the value:</p>
            <pre><code>Key   = zone:www.example.com_ip:203.0.113.1
Value = block</code></pre>
            <p>When a request for <code>www.example.com</code> is received, we look at the IP address of the client that made the request, construct the key and perform the lookup. If the key exists in the store, then the value would tell us what action to perform, in this case if the client IP were <code>203.0.113.1</code> then we would block the request.</p><p>Lookup matching is a joy to work with, it is O(1) complexity meaning that a single request would only perform a single lookup for an IP rule regardless of how many IP rules a customer had. Whilst most customers had a few rules, some customers had hundreds of thousands of rules (typically created automatically by combining fail2ban or similar with a Cloudflare API call).</p><p>Lookups work well when you are only looking up a single value. If you need to combine an IP and a User Agent we would need to produce keys that composed these values together. This massively increases the number of keys that you need to publish.</p><p>String pattern matching occurs where URI matching is required. For our Page Rules feature this meant combining all of the Page Rules into a single regular expression that we would apply to the request URI whilst handling a request.</p><p>If you had Page Rules that said (in order):</p><ul><li><p>Match <code>*/wp-admin/index.php</code> and then block</p></li><li><p>Then match <code>*/xmlrpc.php</code> and then block</p></li></ul><p>These are converted into:</p>
            <pre><code>^(?&lt;block__1&gt;(?:.*/wp-admin/index.php))|(?&lt;block__2&gt;(?:.*/xmlrpc.php))$</code></pre>
            <p>Yes, you read that correctly. Each Page Rule was appended to a single regular expression in the order of execution, and the naming group is used as an overload for the desired action.</p><p>This works surprisingly well as <a href="https://swtch.com/~rsc/regexp/regexp1.html">regular expression matching can be simple and fast</a> especially when the regular expression matches against a single value like the URI, but as soon as you want to match the URI plus an IP range it becomes less obvious how to extend this.</p><p>This is what we had, a set of features that worked really well providing you want to match a single property of a request. The implementation also meant that none of these features could be trivially extended to embrace multiple properties at a time. We needed something else, a fast way to compute if a request matches a rule that could contain multiple properties as well as pattern matching.</p>
    <div>
      <h3>A solution that works now and in the future</h3>
      <a href="#a-solution-that-works-now-and-in-the-future">
        
      </a>
    </div>
    <p>Over time Cloudflare engineers authored internal posts exploring how a new matching engine might work. The first thing that occurred to every engineer was that the matching must be an expression. These ideas followed a similar approach which we would construct an expression within JSON as a DSL (Domain Specific Language) of our expression language. This DSL could describe matching a request and a UI could render this, and a backend could process it.</p><p>Early proposals looked like this:</p>
            <pre><code>{
  "And": [
    {
      "Equals"{
        "host": "www.example.com"
      }
    },
    "Or": [
      {
        "Regex": {
          "path": "^(?: .*/wp-admin/index.php)$"
        }
      }{
        "Regex": {
          "path": "^(?: .*/xmlrpc.php)$"
        }
      }
    ]
  ]
}</code></pre>
            <p>The JSON describes an expression that computers can easily turn into a rule to apply, but people find this hard to read and work with.</p><p>As we did not wish to display JSON like this in our dashboard we thought about how we might summarise it for a UI:</p>
            <pre><code>if request host equals www.example.com and (request path matches ^(?:.*/wp-admin/index.php)$ or request path matches ^(?:.*/xmlrpc.php)$)</code></pre>
            <p>And there came an epiphany. As engineers working we’ve seen an expression language similar to this before, so may I introduce to you our old friend <a href="https://www.wireshark.org">Wireshark</a><b>®</b>.</p><p>Wireshark is a network protocol analyzer. To use it you must run a packet capture to record network traffic from a capture device (usually a network card). This is then saved to disk as a .pcap file which you subsequently open in the Wireshark GUI. The Wireshark GUI has a display filter entry box, and when you fill in a display filter the GUI will dissect the saved packet capture such that it will determine which packets match the expression and then show those in the GUI.</p><p>But we don’t need to do that. In fact, for our scenario that approach does not work as we have a firewall and need to make decisions in real-time as part of the HTTP request handling rather than via the packet capture process.</p><p>For Cloudflare, we would want to use something like the expression language that is the <a href="https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html">Wireshark Display Filters</a> but without the capture and dissection as we would want to do this potentially thousands of times per request without noticeable delay.</p><p>If we were able to use a Wireshark-style expression language then we can reduce the JSON encapsulated expression above to:</p>
            <pre><code>http.host eq "www.example.com" and (http.request.path ~ "wp-admin/index\.php" or http.request.path ~ "xmlrpc.php")</code></pre>
            <p>This is human readable, machine parseable, succinct.</p><p>It also benefits from being highly similar to Wireshark. For security engineers used to working with Wireshark when investigating attacks it offers a degree of portability from an investigation tool to a mitigation engine.</p><p>To make this work we would need to collect the properties of the request into a simple data structure to match the expressions against. Unlike the packet capture approach we run our firewall within the context of an HTTP server and the web server has already computed the request properties, so we can avoid dissection and populate the fields from the web server knowledge:</p><table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>http.cookie</td>
<td><pre><code>session=8521F670545D7865F79C3D7BED C29CCE;-background=light</code></pre></td>
</tr><tr>
<td>http.host</td>
<td><pre><code>www.example.com</code></pre></td>
</tr><tr>
<td>http.referer</td>
<td></td>
</tr><tr>
<td>http.request.method</td>
<td><pre><code>GET</code></pre></td>
</tr><tr>
<td>http.request.uri</td>
<td><pre><code>/articles/index?section=539061&amp;expand=comments</code></pre></td>
</tr><tr>
<td>http.request.uri.path</td>
<td><pre><code>/articles/index</code></pre></td>
</tr><tr>
<td>http.request.uri.query</td>
<td><pre><code>section=539061&amp;expand=comments</code></pre></td>
</tr><tr>
<td>http.user_agent</td>
<td><pre><code>Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36</code></pre></td>
</tr><tr>
<td>http.x_forwarded_for</td>
<td></td>
</tr><tr>
<td>ip.src</td>
<td><pre><code>203.0.113.1</code></pre></td>
</tr><tr>
<td>ip.geoip.asnum</td>
<td><pre><code>64496</code></pre></td>
</tr><tr>
<td>ip.geoip.country</td>
<td><pre><code>GB</code></pre></td>
</tr><tr>
<td>ssl</td>
<td><pre><code>true</code></pre></td>
</tr>
</tbody>
</table><p>With a table of HTTP request properties and an expression language that can provide a <a href="https://developers.cloudflare.com/firewall/cf-firewall-rules/fields-and-expressions/">matching expression</a> we were 90% of the way towards a solution! All we needed for the <a href="https://en.wikipedia.org/wiki/Hofstadter%27s_law">last 90%</a> was the matching engine itself that would provide us with an answer to the question: Does this request match one of the expressions?</p><p>Enter wirefilter.</p><p>Wirefilter is the name of the Rust library that Cloudflare has created, and it provides:</p><ul><li><p>The ability for Cloudflare to define a set of fields of types, i.e. <code>ip.src</code> is a field of type <code>IPAddress</code></p></li><li><p>The ability to define a table of properties from all of the fields that are defined</p></li><li><p>The ability to parse an expression and to say whether it is syntactically valid, whether the fields in the expression are valid against the fields defined, and whether the operators used for a field are valid for the type of the field</p></li><li><p>The ability to apply an expression to a table and return a true|false response indicating whether the evaluated expression matches the request</p></li></ul><p>It is named wirefilter as a hat tip towards Wireshark for inspiring our Wireshark-like expression language and also because in our context of the Cloudflare Firewall these expressions act as a filter over traffic.</p><p>The implementation of wirefilter allows us to embed this matching engine within our REST API which is written in Go:</p>
            <pre><code>// scheme stores the list of fields and their types that an expression can use
var scheme = filterexpr.Scheme{
	"http.cookie":                     filterexpr.TypeString,
	"http.host":                       filterexpr.TypeString,
	"http.referer":                    filterexpr.TypeString,
	"http.request.full_uri":           filterexpr.TypeString,
	"http.request.method":             filterexpr.TypeString,
	"http.request.uri":                filterexpr.TypeString,
	"http.request.uri.path":           filterexpr.TypeString,
	"http.request.uri.query":          filterexpr.TypeString,
	"http.user_agent":                 filterexpr.TypeString,
	"http.x_forwarded_for":            filterexpr.TypeString,
	"ip.src":                          filterexpr.TypeIP,
	"ip.geoip.asnum":                  filterexpr.TypeNumber,
	"ip.geoip.country":                filterexpr.TypeString,
	"ssl":                             filterexpr.TypeBool,
}</code></pre>
            <p>Later we validate expressions provided to the API:</p>
            <pre><code>// expression here is a string that may look like:
// `ip.src eq 203.0.113.1`
expressionHash, err := filterexpr.ValidateFilter(scheme, expression)
if fve, ok := err.(*filterexpr.ValidationError); ok {
	validationErrs = append(validationErrs, fve.Ascii)
} else if err != nil {
	return nil, stderrors.Errorf("failed to validate filter: %v", err)
}</code></pre>
            <p>This tells us whether the expression is syntactically correct and also whether the field operators and values match the field type. If the expression is valid then we can use the returned hash to determine uniqueness (the hash is generated inside wirefilter so that uniqueness can ignore blanks and minor differences).</p><p>The expressions are then published to our global network of PoPs and are consumed by Lua within our web proxy. The web proxy has the same list of fields that the API does, and is now responsible for building the table of properties from the context within the web proxy:</p>
            <pre><code>-- The `traits` table defines the mapping between the fields and
-- the corresponding values from the nginx evaluation context.
local traits = {
   ['http.host'] = field.str(function(ctx) return ctx.host end),
   ['http.cookie'] = field.str(function(ctx)
      local value = ctx.req_headers.cookie or ''
      if type(value) == 'table' then
         value = table.concat(value, ";")
      end
      return value
   end),
   ['http.referer'] = field.str(function(ctx) return ctx.req_headers.referer or '' end),
   ['http.request.method'] = field.str(function(ctx) return ctx.method end),
   ['http.request.uri'] = field.str(function(ctx)
      return ctx.rewrite_uri or ctx.request_uri
   end),
   ['http.request.uri.path'] = field.str(function(ctx)
      return ctx.uri or '/'
   end),
   ...</code></pre>
            <p>With this per-request table describing a request we can see test the filters. In our case what we’re doing here is:</p><ul><li><p>Fetch a list of all the expressions we would like to match against the request</p></li><li><p>Check whether any expression, when applied via wirefilter to the table above, return true as having matched</p></li><li><p>For all matched expressions check the associated actions and their priority</p></li></ul><p>The actions are not part of the matching itself. Once we have a list of matched expressions we determine which action takes precedence and that is the one that we will execute.</p><p>Wirefilter then, is a generic library that provides this matching capability that we’ve plugged into our Go APIs and our Lua web proxy, and we use that to power the Cloudflare Firewall.</p><p>We chose Rust for wirefilter as early in the project we recognised that if we attempted to make implementations of this in Go and Lua, that it would result in inconsistencies that attackers may be able to exploit. We needed our API and edge proxy to behave exactly the same. For this needed a library, both could call and we could choose one of our existing languages at the edge like C, C++, Go, Lua or even implement this not as a library but as a worker in JavaScript. With a mixed set of requirements of performance, memory safety, low memory use, and the capability to be part of other products that we’re working on like Spectrum, Rust stood out as the strongest option.</p><p>With a library in place and the ability to now match all HTTP traffic, how to get that to a public API and UI without diluting the capability? The problems that arose related to specificity and mutual exclusion.</p><p>In the past all of our firewall rules had a single dimension to them: i.e. act on IP addresses. And this meant that we had a single property of a single type and whilst there were occasionally edge cases for the most part there were strategies to answer the question “Which is the most specific rule?”. I.e. an IP address is more specific then a /24 which is more specific than a /8. Likewise with URI matching an overly simplistic strategy is that the longer a URI the more specific it is. And if we had 2 IP rules, then only 1 could ever have matched as a request does not come from 2 IPs at once so mutual exclusion is in effect.</p><p>The old system meant that given 2 rules, we could implicitly and trivially say “this rule is most specific so use the action associated with this rule”.</p><p>With wirefilter powering Firewall Rules, it isn’t obvious that an IP address is more or less specific when compared to a URI. It gets even more complex when a rule can have negation, as a rule that matches a /8 is less specific than a rule that <b>does not</b> match a single IP (the whole address space except this IP - one of the gotchas of Firewall Rules is also a source of it’s power; you can invert your firewall into a <a href="https://www.owasp.org/index.php/Positive_security_model">positive security model</a>.</p><p>As we couldn’t answer specificity using the expression alone, we needed another aspect of the Firewall Rule to provide us this guidance and we realised that customers already had a mechanism to tell us which rules were important… the action.</p><p>Given a set of rules, we logically have ordered them according to their action (Log has highest priority, Block has lowest):</p><ol><li><p>Log</p></li><li><p>Allow</p></li><li><p>Challenge (CAPTCHA)</p></li><li><p>JavaScript Challenge</p></li><li><p>Block</p></li></ol><p>For the vast majority of scenarios this proves to be good enough.</p><p>What about when that isn’t good enough though? Do we have examples of complex configuration that break that approach? Yes!</p><p>Because the expression language within Firewall Rules is so powerful, and we can support many Firewall Rules, it means that we can now create different firewall configuration for different parts of a web site. i.e. /blog could have wholly different rules than /shop, or for different audiences, i.e. visitors from your office IPs might be allowed on a given URI but everyone else trying to access that URI may be blocked.</p><p>In this scenario you need the ability to say “run all of these rules first, and then run the other rules”.</p><p>In single machine firewalls like iptables, OS X Firewall, or your home router firewall, the firewall rules were explicitly ordered so that when you match the first rule it terminates execution and you won’t hit the next rule. When you add a new rule the entire set of rules is republished and this helps to guarantee this behaviour. But this approach does not work well for a <a href="https://www.cloudflare.com/learning/cloud/what-is-a-cloud-firewall/">Cloud Firewall</a> as a large website with many web applications typically also has a large number of firewall rules. Republishing all of these rules in a single transaction can be slow and if you are adding lots of rules quickly this can lead to delays to the final state being live.</p><p>If we published individual rules and supported explicit ordering, we risked race conditions where two rules that both were configured in position 4 might exist at the same time and the behaviour if they matched the request would be non-determinable.</p><p>We solved this by introducing a priority value, where 1 is the highest priority and as an int32 you can create low priority rules all the way down to priority = 2147483647. Not providing a priority value is the equivalent of “lowest” and runs after all rules that have a priority.</p><p>Priority does not have to be a unique value within Firewall Rules. If two rules are of equal priority then we resort to the order of precedence of the actions as defined earlier.</p><p>This provides us a few benefits:</p><ol><li><p>Because priority allows rules that share a priority to exist we can publish rules 1 at a time… when you add a new rule the speed at which we deploy that globally is not affected by the number of rules you already have.</p></li><li><p>If you do have existing rules in a system that does sequentially order the rules, you can import those into Firewall Rules and preserve their order, i.e. this rule should always run before that rule.</p></li><li><p>But you don’t have to use priority exclusively for ordering as you can also use priority for grouping. For example you may say that all spammers are priority=10000 and all trolls are priority = 5000.</p></li></ol><p>Finally… let’s look at those fields again, <code>http.request.path</code> notice that <code>http</code> prefix? By following the naming convention Wireshark has (see their <a href="https://www.wireshark.org/docs/dfref/">Display Filter Reference</a>) we have not limited this firewall capability solely to a HTTP web proxy. It is a small leap to imagine that if a <a href="https://www.cloudflare.com/products/cloudflare-spectrum/">Spectrum</a>  application declares itself as running SMTP that we could also define fields that understand SMTP and allow filtering of traffic on other application protocols or even at layer 4.</p><p>What we have built in Firewall Rules gives us these features today:</p><ul><li><p>Rich expression language capable of targeting traffic precisely and in real-time</p></li><li><p>Fast global deployment of individual rules</p></li><li><p>A lot of control over the management and organisation of Firewall Rules</p></li></ul><p>And in the future, we have a product that can go beyond HTTP and be a true Cloud Firewall for all protocols…the Cloudflare Firewall with Firewall Rules.</p> ]]></content:encoded>
            <category><![CDATA[Firewall]]></category>
            <category><![CDATA[Page Rules]]></category>
            <category><![CDATA[Rust]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[WAF]]></category>
            <guid isPermaLink="false">2ZJuPaDwCLknYvVUR1SPwG</guid>
            <dc:creator>David Kitchen</dc:creator>
        </item>
        <item>
            <title><![CDATA[New Firewall Tab and Analytics]]></title>
            <link>https://blog.cloudflare.com/new-firewall-tab-and-analytics/</link>
            <pubDate>Fri, 01 Mar 2019 10:00:00 GMT</pubDate>
            <description><![CDATA[ At Cloudflare, we focus on intuitive products to aid customers in accelerating and protecting their web properties. We’re excited to share two updates to make our Firewall simpler and more accessible. ]]></description>
            <content:encoded><![CDATA[ <p>At Cloudflare, one of our top priorities is to make our products and services intuitive so that we can enable customers to accelerate and protect their Internet properties. We're excited to launch two improvements designed to make our Firewall easier to use and more accessible, and helping our customers better manage and visualize their threat-related data.</p>
    <div>
      <h3>New Firewall Tabs for ease of access</h3>
      <a href="#new-firewall-tabs-for-ease-of-access">
        
      </a>
    </div>
    <p>We have reorganised our features into meaningful pages: Events, Firewall Rules, Managed Rules, Tools, and Settings. Our customers will see an Overview tab, which contains our new Firewall Analytics, detailed below.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2kdnXnB5nhWqSPwKNQq1rH/7c2556c5550677c1b7c32e0cb082414f/image3.png" />
            
            </figure><p>All the features you know and love are still available, and can be found in one of the four new tabs. Here is a breakdown of their new locations.</p><table><tr><td><p>Feature</p></td><td><p>New Location</p></td></tr><tr><td><p>Firewall Event Log</p></td><td><p>Events (Overview for Enterprise only)</p></td></tr><tr><td><p>Firewall Rules</p></td><td><p>Firewall Rules</p></td></tr><tr><td><p>Web Application Firewall</p></td><td><p>Managed Ruleset</p></td></tr><tr><td><p>IP Access Rules (IP Firewall</p></td><td><p>Tools</p></td></tr><tr><td><p>Rate Limiting</p></td><td><p>Tools</p></td></tr><tr><td><p>User Agent Blocking</p></td><td><p>Tools</p></td></tr><tr><td><p>Zone Lockdown</p></td><td><p>Tools</p></td></tr><tr><td><p>Browser Integrity Check</p></td><td><p>Settings</p></td></tr><tr><td><p>Challenge Passage</p></td><td><p>Settings</p></td></tr><tr><td><p>Privacy Pass</p></td><td><p>Settings</p></td></tr><tr><td><p>Security Level</p></td><td><p>Settings</p></td></tr></table><p><i>If the new sub navigation has not appeared, you may need to re-login to the dashboard or clear your browser’s cookies.</i></p>
    <div>
      <h3>New Firewall Analytics for analysing events and maintaining optimal configurations</h3>
      <a href="#new-firewall-analytics-for-analysing-events-and-maintaining-optimal-configurations">
        
      </a>
    </div>
    <p>Insights into security events are critical for <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">monitoring the health of your web applications</a>. Furthermore, distinguishing between actual threats from false positives is essential for maintaining an optimal security configuration. Today, we are very pleased to announce our new Firewall Analytics which will help our Enterprise customers get detailed insights into firewall events, helping them to tailor their security configurations more effectively</p><p>Our new Firewall Analytics now enables our Enterprise customers to:</p><ul><li><p>visualise and analyse Firewall Events in one place to better understand their threat landscape</p></li><li><p>identify, mitigate, and review attacks more effectively</p></li></ul>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2GWzKZjrZneKTVZS9CbxLH/6f899311075421fa3dc82f7867f53ee6/dashandgraph.png" />
            
            </figure><p>After speaking with many of our customers, we learned a lot about their processes to identify and analyse attacks and the kinds of insights they needed to improve these processes. We then translated these learnings into useful features and charts that would help answer some of the most common questions such as ‘What kinds of security events occurred in a certain time frame?’ and ‘What caused a spike in a certain type of security event?’.  </p><p>Firewall Analytics and Firewall Configuration can be found together in the Firewall tab. A tight feedback loop between Firewall configuration and the resulting events allow for rapid iteration, ideal for security-focused teams.</p><p>To best demonstrate the power of Firewall Analytics, here’s a workflow that would answer a popular question our customers ask: “Why did I have a spike in threats?”. In the screenshot below, we can see a set of activity which triggered a number of ‘Blocks’ events:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5joMt07Y2KqXhkWUoWh5M2/e62592cabbb5f1325a68dbd36ddb9bbb/eventsbyaction.png" />
            
            </figure><p>To minimize the possibility of polluting our TopN statistics with event types other than ‘Block’ and get the most accurate diagnostic information, we will need to filter down to just ‘Block’ actions.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2KOOmBIuqo2t2Cowve8clo/df5d47596f65f3afec3ee05baeee276c/Screen-Recording-2019-02-25-at-11.42-am.gif" />
            
            </figure><p>Now that only Block events are displayed, checking the Service Breakdowns will help us to identify which of our Firewall features was triggered.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6ci2daHFBCKxcw6vvKyb7z/426bfa12c499121b1239ccd11c493c55/eventsbyservice.png" />
            
            </figure><p>From the Events breakdown, we can see that the Block events were triggered by a Country Block configured within Access Rules. Digging deeper and looking at our TopN breakdowns, we start to get a much more granular understanding of which Networks, IPs, User-Agents, Paths etc, were targeted.</p><p>Looking at our TopN breakdowns, we start to get a much more granular understanding of which Networks, IPs, User-Agents, Paths etc, were targeted.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5u8OjEPbiRu5wB7isPaMwj/ff1072bd907c458623b39589858ed6c2/topeventsbysource.png" />
            
            </figure><p>From here, we can see that there are two specific IP addresses which were targeting my application to “/”.</p><p>To get the most detailed information, we can drill down further in the refreshed Firewall Event log, now controlled inline.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1i4JSK8xtYeFymPzemYdHr/c39456a948ebe8c249d93285920b5f19/actiontaken.png" />
            
            </figure><p>Whilst these TopNs and filters are great for clearly identifiable threats, they can also help identify false positives. Using the power of Cloudflare’s filters, it is possible to add a user-defined filter, which can be a RayID, User-Agent or IP address.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/8p29JPMFJNumBRm7cu91i/e6f73b5b5ecdcb4a2df836402aede6b7/firewallevents.png" />
            
            </figure><p>This is just one example of how the new Firewall Analytics can help expedite the process of identifying and mitigating threats. Firewall Analytics is now live for all Enterprise customers. Let us know your feedback by reaching out to your Enterprise Account Team.</p> ]]></content:encoded>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Firewall]]></category>
            <guid isPermaLink="false">47iwgd9LB7Bpvd4LBFew28</guid>
            <dc:creator>Alex Cruz Farmer</dc:creator>
        </item>
    </channel>
</rss>