<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VPN | TekCookie</title>
	<atom:link href="https://tekcookie.com/category/vpn/feed/" rel="self" type="application/rss+xml" />
	<link>https://tekcookie.com</link>
	<description>Everything about IT</description>
	<lastBuildDate>Wed, 24 Nov 2021 14:36:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/06/cropped-TekCookie-211.png?fit=32%2C17&#038;ssl=1</url>
	<title>VPN | TekCookie</title>
	<link>https://tekcookie.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">174510684</site>	<item>
		<title>Secure your website login using Cloudflare and VPN</title>
		<link>https://tekcookie.com/secure-website-login-using-cloudflare-and-vpn/</link>
					<comments>https://tekcookie.com/secure-website-login-using-cloudflare-and-vpn/#respond</comments>
		
		<dc:creator><![CDATA[jeffythampi]]></dc:creator>
		<pubDate>Sat, 25 Sep 2021 17:21:05 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://tekcookie.com/?p=3415</guid>

					<description><![CDATA[In this article, we will see how to secure the WordPress website login by changing the login URL and by using VPN and Cloudflare firewall. Before we dig into securing the website login, let see some introduction of Cloudflare. What is Cloudflare? As we all know, Cloudflare is one of the best CDN(Content delivery network) [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>In this article, we will see how to secure the WordPress website login by changing the login URL and by using VPN and Cloudflare firewall. </p>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-a720f743     "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Table Of Contents						</div>
																<div class="uagb-toc__list-wrap">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#what-is-cloudflare" class="uagb-toc-link__trigger">What is Cloudflare?</a><li class="uagb-toc__list"><a href="#is-cloudflare-just-a-dns-and-cdn" class="uagb-toc-link__trigger">Is Cloudflare just a DNS and CDN?</a><li class="uagb-toc__list"><a href="#why-cloudflare" class="uagb-toc-link__trigger">Why cloudflare?</a><li class="uagb-toc__list"><a href="#benefits-of-using-cloudflare" class="uagb-toc-link__trigger">Benefits of using Cloudflare</a><li class="uagb-toc__list"><a href="#securing-the-wordpress-website-login-using-cloudflare-and-wireguard-vpn" class="uagb-toc-link__trigger">Securing the WordPress website login using Cloudflare and Wireguard VPN</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#changing-the-wordpress-admin-page-url" class="uagb-toc-link__trigger">Changing the WordPress admin page url</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#a-self-hosted-wireguard-vpn" class="uagb-toc-link__trigger">A self-hosted Wireguard VPN</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#cloudflare-firewall-rules" class="uagb-toc-link__trigger">Cloudflare Firewall Rules</a></li></ul></li><li class="uagb-toc__list"><a href="#conclusion" class="uagb-toc-link__trigger">Conclusion</a></ul></ol>					</div>
									</div>
				</div>
			


<p>Before we dig into securing the website login, let see some introduction of Cloudflare.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">What is Cloudflare?</h2>



<p>As we all know, Cloudflare is one of the best CDN(Content delivery network) and DNS(Domain Name System) out there in the market.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Is Cloudflare just a DNS and CDN?</h2>



<p>Well No! It&#8217;s also an internet reverse proxy service provider. There are many security features that come with Cloudflare.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Why cloudflare?</h2>



<p>When the website domain is configured in Cloudflare DNS with &#8220;proxy&#8221; switched on, it acts as a reverse proxy for the website. All the traffic coming into the website and going out of it will be through the Cloudflare security infrastructure. So we can use it to inspect what type of traffic is coming in and to which URL&#8217;s. The malicious content can be filtered out thereby protecting our website. Cloudflare also do provide free SSL for our website and makes it HTTPS. Behind Cloudflare network, it connects to the real web server by different means such as HTTP or HTTPS (strict or flexible)</p>



<p>Need to know more, Have a look at <a href="https://www.cloudflare.com/" target="_blank" rel="noreferrer noopener">https://www.cloudflare.com/</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Benefits of using Cloudflare</h2>



<ul class="wp-block-list"><li>DDoS protection &#8211; As cloudflare faces the internet, it takes the initial hit, so the website is protected in case of a DDoS attack</li><li>Firewall (3 rules in the free plan)</li><li>Rule based page caching (3 rules in the free plan)</li><li>Ultra fast DNS</li><li>Has a reCaptcha feature to get rid of robots.</li><li>Client certificate authentication</li><li>Caching and mimify(html, css and js)</li><li>And many more…</li></ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Securing the WordPress website login using Cloudflare and Wireguard VPN</h2>



<p>Now let&#8217;s start the configuration</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Changing the WordPress admin page url</h3>



<p>Everyone knows, the login page of WordPress is https://domainname.com/wp-login.php, so anyone can try a random combination of credentials or even do a brute-force attack.<br>As a precaution, we first change the login URL using a WordPress plugin – <a href="https://wordpress.org/plugins/wps-hide-login/" target="_blank" rel="noreferrer noopener">https://wordpress.org/plugins/wps-hide-login/</a><br>The plugin should be installed which will then appear in the admin panel &#8220;Settings &gt; WPS Hide Login&#8221;. Change the URL to something &#8220;not so common&#8221; and save the settings.</p>



<figure class="wp-block-image size-large is-style-default"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="1024" height="293" src="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?resize=1024%2C293&#038;ssl=1" alt="" class="wp-image-4751" srcset="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?resize=1024%2C293&amp;ssl=1 1024w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?resize=300%2C86&amp;ssl=1 300w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?resize=768%2C220&amp;ssl=1 768w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?resize=1080%2C309&amp;ssl=1 1080w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/randomurl-secure-cloudflare.webp?w=1190&amp;ssl=1 1190w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><br>Now the URL of the WordPress login page is changed and when someone tries https://domainname.com/wp-admin they will be redirected to the 404 page or we can set it to any page as required.<br>This gives a certain level of protection as the URL is not a well-known phrase.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">A self-hosted Wireguard VPN</h3>



<p>By self-hosting a VPN(Virtual Private Network) in your cloud VPS, the VPN server will modify the source IP address of the traffic to the VPN server&#8217;s IP address. Connecting to the VPN changes our IP address and this IP can be whitelisted in Cloudflare&#8217;s firewall. So only we have access to the WordPress login page URL. This step is not needed if you own a static IP from your ISP which is not always the case.</p>



<p>Wireguard is a new and lightweight VPN solution that can be easily deployed using a docker container. There is a wireguard docker container from <a href="https://fleet.linuxserver.io/image?name=linuxserver/wireguard" target="_blank" rel="noreferrer noopener">linuxserver.io</a> which can be easily deployed. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Follow <a href="https://tekcookie.com" target="_blank" rel="noreferrer noopener">tekcookie.com</a> for upcoming VPN articles.</p></blockquote>



<p>The VPN can be configured as a split tunnel allowing only the website IP or a tunnel mode VPN tunneling the entire traffic. It&#8217;s better to use split-tunnel mode VPN as it does not take much of the network bandwidth.</p>



<p>For split-tunnel configuration, IPTables of the wireguard server has to be configured to allow only the website traffic</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -d tekcookie.com -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -d tekcookie.com -o eth0 -j MASQUERADE</code></pre>



<p>In the <strong>VPN Client</strong> software, the AllowedIPs parameter should have the public IP address of the website.</p>



<pre class="wp-block-code"><code lang="" class="">AllowedIPs = 132.123.13.123/32, 111.222.212.123/32</code></pre>



<p>If there is more than one IP to the website, it can be added as shown in the sample above. The IP address of the domain is obtained by nslookup to any DNS servers out on the internet.</p>



<p>By this, only the website traffic is tunneled through the VPN and other traffic takes the normal internet.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Cloudflare Firewall Rules</h3>



<p>In the Cloudflare firewall, a rule is added to block all the traffic to the login URL except the traffic having the VPN server&#8217;s IP as the source address.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" decoding="async" width="1024" height="552" src="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/firewallrule-secure-cloudflare.webp?resize=1024%2C552&#038;ssl=1" alt="" class="wp-image-4749" srcset="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/firewallrule-secure-cloudflare.webp?resize=1024%2C552&amp;ssl=1 1024w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/firewallrule-secure-cloudflare.webp?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/firewallrule-secure-cloudflare.webp?resize=768%2C414&amp;ssl=1 768w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/firewallrule-secure-cloudflare.webp?w=1069&amp;ssl=1 1069w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Navigate to Firewall &gt; Firewall Rules and click the &#8220;Create a Firewall rule&#8221; button to create a new rule.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<p>In the rule, custom login page URL is added with the VPN server&#8217;s IP address.</p>



<figure class="wp-block-image size-large is-style-default"><img data-recalc-dims="1" decoding="async" width="1024" height="737" src="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/BlockRule-secure-cloudflare.webp?resize=1024%2C737&#038;ssl=1" alt="" class="wp-image-4750" srcset="https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/BlockRule-secure-cloudflare.webp?resize=1024%2C737&amp;ssl=1 1024w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/BlockRule-secure-cloudflare.webp?resize=300%2C216&amp;ssl=1 300w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/BlockRule-secure-cloudflare.webp?resize=768%2C552&amp;ssl=1 768w, https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/09/BlockRule-secure-cloudflare.webp?w=1069&amp;ssl=1 1069w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<p> This is a &#8220;Block&#8221; rule which blocks all the traffic to https://domainname.com/randomurl if the source IP address does not match the VPN server&#8217;s IP address.</p>



<p>Means, this page is only accessible if the VPN is connected.</p>



<p>Along with the IP address filtering, there are many more filters available such as Country, cookie, user agent, client certificate verified, etc. Just explore it out and frame your own rules for better security.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Conclusion</h2>



<p>This article explains how to secure the WordPress login. But this does not guarantee the overall website security from internet threats. For that, a vulnerability assessment has to be performed to identify the loopholes. The WordPress and the plugins have to be kept updated to protect from the known security issues. There are also many WordPress plugins that help to increase website security.</p>



<p>The sad truth of security is nothing is 100% secure.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Hope you liked this article and thank you for reading.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://tekcookie.com/secure-website-login-using-cloudflare-and-vpn/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3415</post-id>	</item>
	</channel>
</rss>
