How to Protect Private Domains With Cloudflare Access

https://hackernoon.imgix.net/images/GKMDC80avThn4WCIH2KxmeCMx9o1-m282blr.png

If you have a private domain sitting on the public internet, chances are anyone can reach it. Search engines index it, curious people poke at it, and bots scan it all day long. The usual fixes are a VPN (complex and annoying to maintain), IP allowlists (break the moment someone works from a coffee shop), or basic auth (everyone shares the same password forever). However, the good thing is that there's another way.

Cloudflare Access

The idea is simple, your DNS record for the environment must be proxied through Cloudflare (the orange cloud), so every request passes through their edge. Then you create a self-hosted Cloudflare Access application pointing to that domain, and attach a policy to it, for example, allowing only emails ending in @mycompany.com or a specific list of addresses.

From that point on, anyone hitting the gated address gets redirected to a login page, with an input...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more