
<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>Sat, 04 Apr 2026 02:15:59 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Network flow monitoring is GA, providing end-to-end traffic visibility]]></title>
            <link>https://blog.cloudflare.com/network-flow-monitoring-generally-available/</link>
            <pubDate>Wed, 18 Oct 2023 13:00:53 GMT</pubDate>
            <description><![CDATA[ Network engineers often need better visibility into their network’s traffic when analyzing DDoS attacks or troubleshooting other traffic anomalies. To solve this problem, Cloudflare offers a network flow monitoring product that gives customers end-to-end traffic visibility across their network. ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4EZamNYbSPCC1yBqXXwaZR/d3e36168073dcc8f08b715ab7d4bbe5e/image4-4.png" />
            
            </figure><p>Network engineers often find they need better visibility into their network’s traffic and operations while analyzing DDoS attacks or troubleshooting other traffic anomalies. These engineers typically have some high level metrics about their network traffic, but they struggle to collect essential information on the specific traffic flows that would clarify the issue. To solve this problem, Cloudflare has been piloting a <a href="https://www.cloudflare.com/network-services/solutions/network-monitoring-tools/">cloud network flow monitoring product</a> called <a href="https://www.cloudflare.com/network-services/products/magic-network-monitoring/">Magic Network Monitoring</a> that gives customers end-to-end visibility into all traffic across their network.</p><p>Today, Cloudflare is excited to announce that Magic Network Monitoring (previously called <a href="/flow-based-monitoring-for-magic-transit/">Flow Based Monitoring</a>) is now generally available to all enterprise customers. Over the last year, the Cloudflare engineering team has significantly improved Magic Network Monitoring; we’re excited to offer a network services product that will help our customers identify threats faster, reduce vulnerabilities, and <a href="https://www.cloudflare.com/network-services/solutions/enterprise-network-security/">make their network more secure</a>.</p><p>Magic Network Monitoring is automatically enabled for all Magic Transit and Magic WAN enterprise customers. The product is located at the account level of the Cloudflare dashboard and can be opened by navigating to “Analytics &amp; Logs &gt; Magic Monitoring”. The onboarding process for Magic Network Monitoring is self-serve, and all enterprise customers with access can begin configuring the product today.</p><p>Any enterprise customers without Magic Transit or Magic WAN that are interested in testing Magic Network Monitoring can receive access to the free version (with some <a href="https://developers.cloudflare.com/magic-network-monitoring/magic-network-monitoring-free/">limitations</a> on traffic volume) by submitting a request to their Cloudflare account team or filling out this form to <a href="https://cloudflare.com/network-services/products/magic-network-monitoring/">talk with an expert</a>.</p>
    <div>
      <h3>What is Magic Network Monitoring?</h3>
      <a href="#what-is-magic-network-monitoring">
        
      </a>
    </div>
    <p>Magic Network Monitoring is a cloud network flow monitor. <a href="https://en.wikipedia.org/wiki/Traffic_flow_(computer_networking)">Network traffic flow</a> refers to any stream of packets between one source and one destination with the same Internet protocol and set of ports. Customers can send network flow reports from their routers (or any other network flow generator) to a publicly available endpoint on <a href="https://www.cloudflare.com/learning/cdn/glossary/anycast-network/">Cloudflare’s anycast network</a>, even if the traffic didn’t originally pass through Cloudflare’s network. Cloudflare analyzes the network flow data, then provides customers visibility into key network traffic metrics via an analytics dashboard. These metrics include: traffic volume (in bits or packets) over time, source IPs, destination IPs, ports, traffic protocols, and router IPs. Customers can also configure alerts to identify <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/">DDoS attacks</a> and any other abnormal traffic volume activities.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3CrObnYrLzKlSOjSUS8dH6/c59b39388b98ba4e7492121d5db3bacf/1-1.png" />
            
            </figure><p>Send flow data from your network to Cloudflare for analysis</p>
    <div>
      <h3>Enterprise DDoS attack type detection</h3>
      <a href="#enterprise-ddos-attack-type-detection">
        
      </a>
    </div>
    <p><a href="https://developers.cloudflare.com/magic-transit/on-demand/">Magic Transit On Demand</a> (MTOD) customers will experience significant traffic visibility benefits when using Magic Network Monitoring. <a href="https://www.cloudflare.com/network-services/products/magic-transit/">Magic Transit</a> is a <a href="https://www.cloudflare.com/network-security/">network security solution</a> that offers DDoS protection and traffic acceleration from every Cloudflare data center for on-premise, cloud-hosted, and hybrid networks. Magic Transit On Demand customers can activate Magic Transit for protection when a DDoS attack is detected.</p><p>In general, we noticed that some MTOD customers lacked the network visibility tools to quickly identify DDoS attacks and take the appropriate mitigation action. Now, MTOD customers can use Magic Network Monitoring to analyze their network data and receive an alert if a DDoS attack is detected.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6HcgWfT995D5YTtTjI7t0x/8f5265dc6c920df9aa4de7db814bfc71/2-1.png" />
            
            </figure><p>Cloudflare detects a DDoS attack from the customer’s network flow data</p><p>Once a DDoS attack is detected, Magic Network Monitoring customers can choose to either manually or automatically enable Magic Transit to mitigate any DDoS attacks.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5FlxXObNPK0L8lx2sN0S6S/8a47e805c9ec45f41c1f9d3bf6d84a33/3-1.png" />
            
            </figure><p>Activate Magic Transit for DDoS protection</p>
    <div>
      <h3>Enterprise network monitoring</h3>
      <a href="#enterprise-network-monitoring">
        
      </a>
    </div>
    <p>Cloudflare’s Magic WAN and Cloudflare One customers can also benefit from using Magic Network Monitoring. Today, these customers have excellent visibility into the traffic they send through Cloudflare’s network, but sometimes they may lack visibility into traffic that isn’t sent through Cloudflare. This can include traffic that remains on a local network, or network traffic sent in between cloud environments. Magic WAN and Cloudflare One customers can add Magic Network Monitoring into their suite of product solutions to establish end-to-end network visibility across all traffic on their network.</p>
    <div>
      <h3>A deep dive into network flow and network traffic sampling</h3>
      <a href="#a-deep-dive-into-network-flow-and-network-traffic-sampling">
        
      </a>
    </div>
    <p>Magic Network Monitoring gives customers better visibility into their network traffic by ingesting and analyzing network flow data.</p><p>The process starts when a router (or other network flow generation device) collects <a href="https://en.wikipedia.org/wiki/Sampling_(statistics)">statistical samples</a> of inbound and / or outbound packet data. These samples are collected by examining 1 in every X packets, where X is the sampling rate configured on the router. Typical sampling rates range from 1 in every 1,000 to 1 in every 4,000 packets. The ideal sampling rate depends on the traffic volume, traffic diversity, and the compute / memory power of your router’s hardware. You can read more about the <a href="https://developers.cloudflare.com/magic-network-monitoring/routers/recommended-sampling-rate/">recommended network flow sampling rate</a> in Cloudflare’s MNM Developer Docs.</p><p>The sampled data is packaged into one of two industry standard formats for network flow data: NetFlow or sFlow. In NetFlow, the sampled packet data is grouped by different packet characteristics such as source / destination IP, port, and protocol. Each group of sampled packet data also includes a traffic volume estimate. In sFlow, the entire packet header is selected as the representative sample, and there isn’t any data summarization. As a result, sFlow is a richer data format and includes more details about network traffic than NetFlow data. Once either the NetFlow or sFlow data samples are collected, they’re sent to Magic Network Monitoring for analysis and alerting.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2XoUWHVTlsaVD6wYjekYm6/951cff39344b3912444f239618af64c6/4-1.png" />
            
            </figure>
    <div>
      <h3>Why simple random sampling didn’t work for Magic Network Monitoring</h3>
      <a href="#why-simple-random-sampling-didnt-work-for-magic-network-monitoring">
        
      </a>
    </div>
    <p>Magic Network Monitoring has come a long way from its early access release one year ago. In particular, the Cloudflare engineering team invested significant time in improving the accuracy of the traffic volume estimations in MNM. In the early access version of Magic Network Monitoring, customers were unexpectedly reporting that their network traffic volume estimates were too high and didn’t match the expected value.</p><p>Magic Network Monitoring performs its own sampling of the NetFlow or sFlow data it receives, so it can effectively scale and manage the data ingested across Cloudflare’s global network. Increasing the accuracy of the traffic volume estimations was more difficult than expected, as the NetFlow or sFlow data parsed by MNM is already built on sampled packet data. This introduces multiple distinct layers of data sampling in the product’s analytics.</p><p>The first version of Magic Network Monitoring used <a href="https://en.wikipedia.org/wiki/Simple_random_sample">random sampling</a> where a random subset of network flow data with the same timestamp was selected to represent the traffic volume at that point in time. A characteristic of network flow data is that some samples are more significant than others and represent a greater volume of network traffic. In order to account for this significance, we can associate a <a href="https://en.wikipedia.org/wiki/Weighting">weight</a> with each sample based on the traffic volume it represents. Network flow data weights are always positive numbers, and they follow a <a href="https://en.wikipedia.org/wiki/Long_tail">long tail distribution</a>. These data characteristics caused MNM’s random sampling to incorrectly estimate the traffic volume of a customer’s network. Customers would see false spikes in their traffic volume analytics when an outlying data sample from the long tail was randomly selected to be the representative of all traffic at that point in time.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Tje0Xn9GucCoNamBEyvVE/0d097130617a1c6584efa8679f91c87a/5-1.png" />
            
            </figure>
    <div>
      <h3>Increasing accuracy with VarOpt reservoir sampling</h3>
      <a href="#increasing-accuracy-with-varopt-reservoir-sampling">
        
      </a>
    </div>
    <p>To solve this problem, the Cloudflare engineering team implemented an alternative <a href="https://en.wikipedia.org/wiki/Reservoir_sampling">reservoir sampling</a> technique called <a href="https://arxiv.org/pdf/0803.0473.pdf">VarOpt</a>. VarOpt is designed to collect samples from a stream of data when the length of the data stream is unknown (a perfect application for analyzing incoming network flow data). In the MNM implementation of VarOpt, we start with an empty reservoir of a fixed size that is filled with samples of network flow data. When the reservoir is full, and there is still new incoming network flow data, an old sample is randomly discarded from the reservoir and replaced with a new one.</p><p>After a certain number of samples have been observed, we calculate the traffic volume across all weighted samples in the reservoir, and that is the estimated traffic volume of a customer’s network flow at that point in time. Finally, the reservoir is emptied, and the VarOpt loop is restarted by filling the reservoir with the next set of the latest network flow samples.</p><p>The new VarOpt sampling method significantly increased the accuracy of the traffic volume estimations in Magic Network Monitoring, and solved our customer’s problems. These sampling improvements paved the way for general availability, and we’re excited to make accurate network flow analytics available to everyone.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2NYGpyTodAgtP9K8KycjGZ/fa5e290cdf3286c7efcbbe53954e1540/6-1.png" />
            
            </figure>
    <div>
      <h3>Developer Docs and Discord Community</h3>
      <a href="#developer-docs-and-discord-community">
        
      </a>
    </div>
    <p>There are detailed <a href="https://developers.cloudflare.com/magic-network-monitoring/">Developer Docs for Magic Network Monitoring</a> that explain the product’s features and outlines a step-by-step configuration guide for new customers. As you’re working through the Magic Network Monitoring documentation, please feel free to provide feedback by clicking the “Give Feedback” button in the top right corner of the Developer Docs.</p><p>We’ve also created a channel in Cloudflare’s Discord community built around debugging configuration problems, testing new features, and providing product feedback. You can follow this link to join the <a href="https://discord.gg/cloudflaredev">Cloudflare Discord server</a>.</p>
    <div>
      <h3>Free version</h3>
      <a href="#free-version">
        
      </a>
    </div>
    <p>A <a href="https://developers.cloudflare.com/magic-network-monitoring/magic-network-monitoring-free/">free version of Magic Network Monitoring</a> is available to all Enterprise customers on request to their Cloudflare account team. The free version is designed to enable Enterprise customers to quickly test and evaluate Magic Network Monitoring before purchasing Magic Transit, Magic WAN, or Cloudflare One. Enterprise customers can fully configure Magic Network Monitoring themselves by following the <a href="https://developers.cloudflare.com/magic-network-monitoring/get-started/">step-by-step onboarding guide</a> in the product’s documentation. The free version has some <a href="https://developers.cloudflare.com/magic-network-monitoring/magic-network-monitoring-free/">limitations</a> on the quantity of traffic that can be processed which are further outlined in the product’s documentation.</p><p>The free version of Magic Network Monitoring is also available to all Free, Pro, and Business plan Cloudflare customers via a closed beta. Anyone can request access to the free version by <a href="https://developers.cloudflare.com/magic-network-monitoring/magic-network-monitoring-free/">reading the free version documentation</a> and <a href="https://forms.gle/z93ghpydpKdAFZ7P9">filling out this form</a>. Priority access is granted to anyone that joins <a href="https://discord.com/invite/cloudflaredev">Cloudflare’s Discord server</a> and sends a message in the Magic Network Monitoring Discord channel.</p>
    <div>
      <h3>Next steps that you can take today</h3>
      <a href="#next-steps-that-you-can-take-today">
        
      </a>
    </div>
    <p>Magic Network Monitoring is generally available, and all Magic Transit and Magic WAN customers have been automatically granted access to the product today. You can navigate to the product by going to the account level of the Cloudflare dashboard, then selecting “Analytics &amp; Logs &gt; Magic Monitoring”.</p><p>If you’re an enterprise customer without Magic Transit or Magic WAN, and you want to use Magic Network Monitoring to improve your traffic visibility, you can <a href="https://cloudflare.com/network-services/products/magic-network-monitoring/">talk with an MNM expert today</a>.</p><p>If you’re interested in using Magic Transit and Magic Network Monitoring for DDoS protection, you can <a href="https://www.cloudflare.com/network-services/products/magic-transit/">request a demo of Magic Transit</a>. If you want to use Magic WAN and Magic Network Monitoring together to establish end-to-end network traffic visibility, you can <a href="https://www.cloudflare.com/network-services/products/magic-wan/">talk with a Magic WAN expert</a>.</p> ]]></content:encoded>
            <category><![CDATA[Magic Network Monitoring]]></category>
            <category><![CDATA[Network Services]]></category>
            <category><![CDATA[Magic Transit]]></category>
            <category><![CDATA[Magic WAN]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">5Q496AB243DF9bETeys1Pq</guid>
            <dc:creator>Chris Draper</dc:creator>
            <dc:creator>Chris J Arges</dc:creator>
            <dc:creator>Ana Oliveira</dc:creator>
            <dc:creator>João Santos</dc:creator>
            <dc:creator>Luís Franco</dc:creator>
            <dc:creator>Nadin El-Yabroudi</dc:creator>
            <dc:creator>Dan Geraghty</dc:creator>
        </item>
        <item>
            <title><![CDATA[Packet captures at the edge]]></title>
            <link>https://blog.cloudflare.com/packet-captures-at-edge/</link>
            <pubDate>Thu, 17 Mar 2022 12:59:12 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to announce the general availability of on-demand packet captures from Cloudflare’s global network ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Packet captures are a critical tool used by network and security engineers every day. As more network functions migrate from legacy on-prem hardware to cloud-native services, teams risk losing the visibility they used to get by capturing 100% of traffic funneled through a single device in a datacenter rack. We know having easy access to packet captures across all your network traffic is important for troubleshooting problems and deeply understanding traffic patterns, so today, we’re excited to announce the general availability of on-demand packet captures from Cloudflare’s global network.</p>
    <div>
      <h3>What are packet captures and how are they used?</h3>
      <a href="#what-are-packet-captures-and-how-are-they-used">
        
      </a>
    </div>
    <p>A packet capture is a file that contains all packets that were seen by a particular network box, usually a firewall or router, during a specific time frame. Packet captures are a powerful and commonly used tool for debugging network issues or getting better visibility into attack traffic to tighten security (e.g. by adding firewall rules to block a specific attack pattern).</p><p>A network engineer might use a pcap file in combination with other tools, like <a href="https://www.cloudflare.com/learning/network-layer/what-is-mtr/">mtr</a>, to troubleshoot problems with reachability to their network. For example, if an end user reports intermittent connectivity to a specific application, an engineer can set up a packet capture filtered to the user’s source IP address to record all packets received from their device. They can then analyze that packet capture and compare it to other sources of information (e.g. pcaps from the end user’s side of the network path, traffic logs and analytics) to understand the magnitude and isolate the source of the problem.</p><p>Security engineers can also use packet captures to gain a better understanding of potentially malicious traffic. Let’s say an engineer notices an unexpected spike in traffic that they suspect could be an attempted attack. They can grab a packet capture to record the traffic as it’s hitting their network and analyze it to determine whether the packets are valid. If they’re not, for example, if the packet payload is randomly generated gibberish, the security engineer can create a firewall rule to block traffic that looks like this from entering their network.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6OKUEiSlnlCSXLryTslrWR/2a862de65c9be324e99751a35b0cee69/image1-65.png" />
            
            </figure><p><i>Example of a packet capture from a recent DDoS attack targeted at Cloudflare infrastructure. The contents of this pcap can be used to create a “signature” to block the attack.</i></p>
    <div>
      <h3>Fragmenting traffic creates gaps in visibility</h3>
      <a href="#fragmenting-traffic-creates-gaps-in-visibility">
        
      </a>
    </div>
    <p>Traditionally, users capture packets by logging into their router or firewall and starting a process like <a href="https://www.tcpdump.org/">tcpdump</a>. They’d set up a filter to only match on certain packets and grab the file. But as networks have become more fragmented and users are moving security functions out to the edge, it’s become increasingly challenging to collect packet captures for relevant traffic. Instead of just one device that all traffic flows through (think of a drawbridge in the “<a href="https://www.cloudflare.com/learning/access-management/castle-and-moat-network-security/">castle and moat</a>” analogy) engineers may have to capture packets across many different physical and virtual devices spread across locations. Many of these packets may not allow taking pcaps at all, and then users have to try to  stitch them back together to create a full picture of their network traffic. This is a nearly impossible task today and only getting harder as networks become more fractured and complex.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2oAYhpR8RTzQKGijeIYDbq/a815a486f88dc8a31a5d9bcb0a91df78/image2-56.png" />
            
            </figure>
    <div>
      <h3>On-demand packet captures from the Cloudflare global network</h3>
      <a href="#on-demand-packet-captures-from-the-cloudflare-global-network">
        
      </a>
    </div>
    <p>With Cloudflare, you can regain this visibility. With <a href="https://www.cloudflare.com/magic-transit/">Magic Transit</a> and <a href="https://www.cloudflare.com/magic-wan/">Magic WAN</a>, customers route all their public and private IP traffic through Cloudflare’s network to make it more secure, faster, and more reliable, but also to increase visibility. You can think of Cloudflare like a giant, globally distributed version of the drawbridge in our old analogy: because we act as a single cloud-based router and firewall across all your traffic, we can capture packets across your entire network and deliver them back to you in one place.</p>
    <div>
      <h3>How does it work?</h3>
      <a href="#how-does-it-work">
        
      </a>
    </div>
    <p>Customers can request a packet capture using our <a href="https://developers.cloudflare.com/magic-firewall/how-to/collect-pcaps/">Packet Captures API</a>. To get the packets you’re looking for you can provide a filter with the IP address, ports, and protocol of the packets you want.</p>
            <pre><code>curl -X POST https://api.cloudflare.com/client/v4/accounts/${account_id}/pcaps \
-H 'Content-Type: application/json' \
-H 'X-Auth-Email: user@example.com' \
-H 'X-Auth-Key: 00000000000' \
--data '{
        "filter_v1": {
               "source_address": "1.2.3.4",
               "protocol": 6
        },
        "time_limit": 300,
        "byte_limit": "10mb",
        "packet_limit": 10000,
        "type": "simple",
        "system": "magic-transit"
}'</code></pre>
            <p>Example of a request for packet capture using our API.</p><p>We leverage <a href="https://netfilter.org/projects/nftables/">nftables</a> to apply the filter to the customer’s incoming packets and log them using <a href="https://www.netfilter.org/projects/libnetfilter_log/index.html">nflog</a>:</p>
            <pre><code>table inet pcaps_1 {
    chain pcap_1 {
        ip protocol 6 ip saddr 1.2.3.4 log group 1 comment “packet capture”
    }
}</code></pre>
            <p>Example nftables configuration used to filter log customer packets</p><p>nflog creates a netfilter socket through which logs of a packet are sent from the Linux kernel to user space. In user space, we use tcpdump to read packets off the netfilter socket and generate a packet capture file:</p>
            <pre><code>tcpdump -i nflog:1 -w pcap_1.pcap</code></pre>
            <p>Example tcpdump command to create a packet capture file.</p><p>Usually tcpdump is used by listening to incoming packets on a network interface, but in our case we configure it to read packet logs from an nflog group. tcpdump will convert the packet logs into a packet capture file.</p><p>Once we have a packet capture file, we need to deliver it to customers. Because packet capture files can be large and contain sensitive information (e.g. packet payloads), we send them to customers directly from our machines to a cloud storage service of their choice. This means we never store sensitive data, and it’s easy for customers to manage and store these large files.</p>
    <div>
      <h3>Get started today</h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>On-demand packet captures are now generally available for customers who have purchased the Advanced features of Magic Firewall. The <a href="https://developers.cloudflare.com/magic-firewall/how-to/collect-pcaps/">packet capture API</a> allows customers to capture the first 160 bytes of packets, sampled at a default rate of 1/100. More functionality including full packet captures and on-demand packet capture control in the Cloudflare Dashboard is coming in the following weeks. Contact your account team to stay updated on the latest!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Edge]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Serverless]]></category>
            <guid isPermaLink="false">3lCeST96Ji4kMdmRbpTRav</guid>
            <dc:creator>Annika Garbers</dc:creator>
            <dc:creator>Nadin El-Yabroudi</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing Flan Scan: Cloudflare’s Lightweight Network Vulnerability Scanner]]></title>
            <link>https://blog.cloudflare.com/introducing-flan-scan/</link>
            <pubDate>Thu, 21 Nov 2019 14:00:00 GMT</pubDate>
            <description><![CDATA[ Today, we’re excited to open source Flan Scan, Cloudflare’s in-house lightweight network vulnerability scanner. Flan Scan is a thin wrapper around Nmap that converts this popular open source tool into a vulnerability scanner with the added benefit of easy deployment. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, we’re excited to open source <a href="https://github.com/cloudflare/flan">Flan Scan</a>, Cloudflare’s in-house lightweight network vulnerability scanner. Flan Scan is a thin wrapper around <a href="https://nmap.org/">Nmap</a> that converts this popular open source tool into a vulnerability scanner with the added benefit of easy deployment.</p><p>We created Flan Scan after two unsuccessful attempts at using “industry standard” scanners for our compliance scans. A little over a year ago, we were paying a big vendor for their scanner until we realized it was one of our highest security costs and many of its features were not relevant to our setup. It became clear we were not getting our money’s worth. Soon after, we switched to an open source scanner and took on the task of managing its complicated setup. That made it difficult to deploy to our entire fleet of more than 190 data centers.</p><p>We had a deadline at the end of Q3 to complete an internal scan for our compliance requirements but no tool that met our needs. Given our history with existing scanners, we decided to set off on our own and build a scanner that worked for our setup. To design Flan Scan, we worked closely with our auditors to understand the requirements of such a tool. We needed a scanner that could accurately detect the services on our network and then lookup those services in a database of <a href="https://cve.mitre.org/">CVEs</a> to find vulnerabilities relevant to our services. Additionally, unlike other scanners we had tried, our tool had to be easy to deploy across our entire network.</p><p>We chose Nmap as our base scanner because, unlike other network scanners which sacrifice accuracy for speed, it prioritizes detecting services thereby reducing false positives. We also liked Nmap because of the Nmap Scripting Engine (NSE), which allows scripts to be run against the scan results. We found that the <a href="https://github.com/vulnersCom/nmap-vulners">“vulners” script</a>, available on NSE, mapped the detected services to relevant CVEs from a database, which is exactly what we needed.</p><p>The next step was to make the scanner easy to deploy while ensuring it outputted actionable and valuable results. We added three features to Flan Scan which helped package up Nmap into a user-friendly scanner that can be deployed across a large network.</p><ul><li><p><b>Easy Deployment and Configuration </b><b><b>-</b></b> To create a lightweight scanner with easy configuration, we chose to run Flan Scan inside a Docker container. As a result, Flan Scan can be built and pushed to a Docker registry and maintains the flexibility to be configured at runtime. Flan Scan also includes sample Kubernetes configuration and deployment files with a few placeholders so you can get up and scanning quickly.</p></li><li><p><b>Pushing results to the Cloud </b><b><b>-</b></b> Flan Scan adds support for pushing results to a Google Cloud Storage Bucket or an S3 bucket. All you need to do is set a few environment variables and Flan Scan will do the rest. This makes it possible to run many scans across a large network and collect the results in one central location for processing.</p></li><li><p><b>Actionable Reports</b> - Flan Scan generates actionable reports from Nmap’s output so you can quickly identify vulnerable services on your network, the applicable CVEs, and the IP addresses and ports where these services were found. The reports are useful for engineers following up on the results of the scan as well as auditors looking for evidence of compliance scans.</p></li></ul>
            <figure>
            
            <img src="https://downloads.ctfassets.net/zkvhlag99gkb/2P4YSEYrC1ofUi7vKitDR4/284e76df1c2b00c24e40bc495962595d/New_report_gif.gif" />
            
            </figure><p>Sample run of Flan Scan from start to finish. </p>
    <div>
      <h2>How has Flan Scan improved Cloudflare's network security?</h2>
      <a href="#how-has-flan-scan-improved-cloudflares-network-security">
        
      </a>
    </div>
    <p>By the end of Q3, not only had we completed our compliance scans, we also used Flan Scan to tangibly improve the security of our network. At Cloudflare, we pin the software version of some services in production because it allows us to prioritize upgrades by weighing the operational cost of upgrading against the improvements of the latest version. Flan Scan’s results revealed that our FreeIPA nodes, used to manage Linux users and hosts, were running an outdated version of Apache with several medium severity vulnerabilities. As a result, we prioritized their update. Flan Scan also found a vulnerable instance of PostgreSQL leftover from a performance dashboard that no longer exists.</p><p>Flan Scan is part of a larger effort to expand our vulnerability management program. We recently deployed <a href="https://osquery.io/">osquery</a> to our entire network to perform host-based vulnerability tracking. By complementing osquery’s findings with Flan Scan’s network scans we are working towards comprehensive visibility of the services running at our edge and their vulnerabilities. With two vulnerability trackers in place, we decided to build a tool to manage the increasing number of vulnerability  sources. Our tool sends alerts on new vulnerabilities, filters out false positives, and tracks remediated vulnerabilities. Flan Scan’s valuable security insights were a major impetus for creating this vulnerability tracking tool.</p>
    <div>
      <h2>How does Flan Scan work?</h2>
      <a href="#how-does-flan-scan-work">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6kAAc3ohubexEKfI60A0nS/9101e8229e320c6b53771ad09ab87e0e/FLan-scan-diagram_3x.png" />
            
            </figure><p>The first step of Flan Scan is running an Nmap scan with service detection. Flan Scan's default Nmap scan runs the following scans:</p><ol><li><p><b>ICMP ping scan -</b> Nmap determines which of the IP addresses given are online.</p></li><li><p><b>SYN scan -</b> Nmap scans the 1000 most common ports of the IP addresses which responded to the ICMP ping. Nmap marks ports as open, closed, or filtered.</p></li><li><p><b>Service detection scan -</b> To detect which services are running on open ports Nmap performs TCP handshake and <a href="https://en.wikipedia.org/wiki/Banner_grabbing">banner grabbing</a> scans.</p></li></ol><p>Other types of scanning such as UDP scanning and IPv6 addresses are also possible with Nmap. Flan Scan allows users to run these and any other extended features of Nmap by passing in Nmap flags at runtime.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6jGqNtdhSePb0Iz3JEUCZF/c04a4b36066b7e083be64c5306df5eb4/Screen-Shot-2019-11-11-at-2.15.01-PM.png" />
            
            </figure><p>Sample Nmap output</p><p>Flan Scan adds the "vulners" script tag in its default Nmap command to include in the output a list of vulnerabilities applicable to the services detected. The vulners script works by making API calls to a service run by <a href="https://vulners.com/">vulners.com</a> which returns any known vulnerabilities for the given service.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/476YY2nBlzz4hMVJVfQ98h/f5bf27b240590dfb5ce700258875aa5b/Screen-Shot-2019-11-11-at-2.28.58-PM.png" />
            
            </figure><p>Sample Nmap output with Vulners script</p><p>The next step of Flan Scan uses a Python script to convert the structured XML of Nmap’s output to an actionable report. The reports of the previous scanner we used listed each of the IP addresses scanned and present the vulnerabilities applicable to that location. Since we had multiple IP addresses running the same service, the report would repeat the same list of vulnerabilities under each of these IP addresses. This meant scrolling back and forth on documents hundreds of pages long to obtain a list of all IP addresses with the same vulnerabilities.  The results were impossible to digest.</p><p>Flan Scans results are structured around services. The report enumerates all vulnerable services with a list beneath each one of relevant vulnerabilities and all IP addresses running this service. This structure makes the report shorter and actionable since the services that need to be remediated can be clearly identified. Flan Scan reports are made using <a href="https://www.latex-project.org/">LaTeX</a> because who doesn’t like nicely formatted reports that can be generated with a script? The raw LaTeX file that Flan Scan outputs can be converted to a beautiful PDF by using tools like pdf2latex or TeXShop.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/VR5TpcOccduNyZWRNYN8A/b13b1da0c38657eb8244cd396061799a/Screen-Shot-2019-11-18-at-4.51.06-PM.png" />
            
            </figure><p>Sample Flan Scan report</p>
    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>Cloudflare’s mission is to help build a better Internet for everyone, not just Internet giants who can afford to buy expensive tools. We’re open sourcing Flan Scan because we believe it shouldn’t cost tons of money to have <a href="https://www.cloudflare.com/network-security/">strong network security</a>.</p><p>You can get started running a vulnerability scan on your network in a few minutes by following the instructions on the <a href="https://github.com/cloudflare/flan">README</a>. We welcome contributions and suggestions from the community.</p> ]]></content:encoded>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Python]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">7LprqimW4zLRcwCAGWykIi</guid>
            <dc:creator>Nadin El-Yabroudi</dc:creator>
        </item>
    </channel>
</rss>