How are so many sites OK with using cloudflare when they are basically a MITM?
Regardless of whether or not you provide your own SSL certificates, cloudflare still uses their own between their servers and client browsers. So any SSL encrypted traffic is unencrypted at their end before being re-encrypted with your certificate. How can such an entity be trusted?
A lot of people in this thread have never been ddosed and it shows. You don't need to host a super popular thing to get ddosed.
When you host game servers there are gonna be salty 16 years old that go to a free stresser and hit you with 1gbps.
And you might think "well yeah but it's not like cloudflare's free plan protects that much".
It does, believe me. I've done tests with people who have access to botnets and without cloudflare with 1gbps our connection was dead. With cloudflare it didn't go down and reported more than 50gbps on the cloudflare dashboard.
Also another thing is that a lot of these people are 16 year old script kiddies, and not seeing your IP directly discourages them.
If you want then to cache your content to reduce the load of your servers, they have to decrypt the traffic. This is how a reverse proxy works.
And, well, you have to trust them before contract their services. The same way people trust vpns to route their traffic. If I was from some 3 letter agency and want to spy on potential illegal content, I would tap into a vpn server.
A MITM is a Man-in-the-Middle Attack, someone whom you dont trust or dont know has hijacked your network connection to either read, remove or modify data from your network packets and then proxy-send it to your initial intended target
Cloudflare is a proxy server, a person you TRUST and designated to passthrough first to scan and check for network security before it redirects and pass your packets through to your intended target, like a gatekeeper
What, you gonna call all your gatekeepers, your bouncers, your proxy servers a MITM?
Get some reading comprehension. He said MITM and not MITM Attack. He's referring to Cloudflare as a middle man.
What OP is trying to say is why everyone is okay with using Cloudflare when it basically is a middle man where your traffic/requests go through and could potentially be sniffed at.
No, I read it properly, a MITM generally refers to MITM Attack and vice versa in cybersecurity, it is down to the individual to clarify if they meant otherwise and clearly, this case he is referencing to BEING A MITM for malicious purposes
What is it you're afraid cloudflare is doing? This is a company trusted by tons of corporations who have legit secrets to protect. Why would they care about intercepting your traffic? To what end?
Cyber attacks are goal-oriented and based on attack cost, basically how much effort for how much reward. Is your selfhost traffic super valuable? So valuable that someone would hack cloudflare to get it?
In reality, other than commodity malware that your security suite should easily pick up, there isn't much threat in my opinion.
The question was a more general one, and not specific to my personal data needs.
The existence of such a ubiquitous centralised service that actually IS a MITM, whether they are malicious or not, seems curious to me.
As they say, if the product is free, then you are the product. If people accept, but recognise, a loss of privacy when using free services from Google and meta, for example, knowing that the data they provide is used for personalised ads, then how come CF's free tier isn't viewed with the same level of scrutiny?
Yes, you’re right that there’s a certain amount of trust you need to have in CF… but what are you trusting it to do? And if they fail, what are the consequences?
Honest question - even if you are sending your Vaultwarden traffic over CF, and they are watching or attacking, you have to trust that the e2e encryption of Vaultwarden is what’s keeping you safe, right? Not the SSL certs. Does the auth mechanism rely on the SSL certs not to be compromised? I would hope not.
The concern isn't that CF is reading your data. It's that 3-letter agencies can read your data at will, since they always make these deals with large companies to have open-hose access to all the data. There was a scandal that Facebook had a special access page for those people.
You might think you're innocent, and you're a good person, so nothing to worry about. This is the old "I have nothing to hide", but this isn't how the world works. People who want to get you can pull strings to get anything they want from government institutions. After all, government is just people. It's not a benevolent being.
Now all this is unlikely, granted. But the task of a good security setup isn't to make it impossible to hack you, but it's to make it hard enough and costly. I'm quite sure there's a zero-day somewhere that can hack my bare-bones Linux servers, but good luck breaking the 10 layers of security I have before even reaching these servers to find something remotely valuable about me. I don't need to make concessions in that regard. You don't have to trust anyone.
My take is: Any data worth your while shouldn’t just rely on HTTPs anyway. You should have more layers of encryption. That’s how majority of the companies do it.
And for people who do not even know this, are better off using CF as MITM.
CF is not using „their own“! The certificates the client see must be provided and authorized by the provider of the service. Or put in other words: CF is acting as the hosting provider to the outside, to the clients.
The rest of journey is „inside“ the domain of the provider of the service. It is totally normal that traffic has some journey to go and often it never touches the premises of the provider or even a server owned by the provider.
The important thing that all the part which from a customer‘s view is „internal to the provider of the service“ (behind the CF address) is responsibility of the provider of the service, no matter what 3rd party services they use.
I'm either reading this wrong or there's a disconnect in knowledge. If you have your own SSL cert and do the termination of that on your end, CF cannot do any MITM without an error on the user's end.
However, if your just setting up an a record or whatever to your server that isn't doing ssl termination, then yes they are mitm
Cloudflares Web Application Firewall or 'WAF' is a reverse proxy that sits in front of your server issuing it's own certs valid for your domain (cloudflare is a CA, and has control over your DNS to get others to issue certs for them). They then provide caching alongside DDOS protection, geoblocking, various customizable firewall settings, as well as just masking your servers ip with their own. This is their primary service aside from just basic DNS/registrar services.
Cloudflare’s default setup is to proxy your traffic but that’s easily disabled with a click of the admin’s mouse. Of course disabling their proxy service exposes the origin IP’s, server certs, etc. but the point is that you use Cloudflare services the way you want to; it’s not a Boolean “cloudflare or no Cloudflare”.
Half of the people don't remotely understand the issue. The other half is aware that what's in behind isn't trustworthy anyways if it's "in da cloud" and just went all YOLO-mode.
Because it’s not always about the encryption. I use Cloudflare tunnels because they are a good way of exposing sites to the internet without exposing my IP or opening ports, which means I don’t have to worry as much about DDoS or other attacks and therefore I don’t need to spend as much effort defending against them.
Even Cloudflare decides to inspect my traffic (and seriously why would they care about a tiny hobbyist website) it’s not like it gives them full access to everything, there are other controls you can use depending what your site is for.
Honestly what I don’t understand is why some on this sub have such strong objections to Cloudflare. Like I get they are a terrible company in a lot of ways, but name a tech company that isn’t?
Even Cloudflare decides to inspect my traffic (and seriously why would they care about a tiny hobbyist website)
The good old "eh what do i care i dont have anything to hide" approach to security and privacy. Excellent!
"If you have nothing to hide then you dont have to worry!"
I wont respond further in this thread because i already know how these discussions go.
Like I get they are a terrible company in a lot of ways, but name a tech company that isn’t?
Why would anyone argue that other companies are saints? Are you aware you are in /r/selfhosting here? The whole point is to regain control of your own data, be in charge of who stores what, where and how.
But if you don’t trust Cloudflare, who do you trust, and why? Do you trust your ISP? Do you trust Intel or AMD? The people who manufacture your router or other networking kit? People’s trust boundaries exist at different levels. If you are happy with your own, fine, but you don’t get to tell other people that they are doing it wrong just because their boundaries are different.
Honestly what I don’t understand is why some on this sub have such strong objections to Cloudflare.
I am concerned about them being a technical SPOF for much of the internet, and there is the possibility that some hitherto unknown long-term persistent data gathering infiltration is able to sweep up a massive amount of information. And maybe they will turn malicious? Who can say? There's plenty of precedent. How long between when it happens and when we find out?
You don't need to use CF tunnels to get DDoS protection and to hide your IP. If you are using CF tunnels without being undee a CG-NAT then you are getting MITM'd for nothing.
You have a very narrow view of why certain technologies should or should not be used. I'm not behind CG-NAT but there is still plenty of value to Cloudflare tunnels for me. Even behind my IP I have a fairly complex network environment but CF tunnels make it easy for me to stand up a connection from a cluster, make it resilient and highly available, and automatically handle failure modes to keep the service up to the world. They also give me a transferable configuration that allows me to quickly move my apps to the cloud or to other hosting if I need to.
So no, I'm not "mindlessly" using them, and I'm not using them just for security or just for DDoS protection. I've actually put quite a lot of thought into my architecture and why I used certain technologies, thank you very much.
I use Cloudflare tunnels because they are a good way of exposing sites to the internet without exposing my IP
What difference does that make? I only ever heard one realistic reason for hiding your IP, which was a guy living in a suburban neighborhood with static IPs where the IP indicated his house almost exactly.
If you have a dynamic IP it will get recycled. If you get a static IP it will eventually get mapped to your precise location, Google & other big data spend a lot of time doing exactly that.
or opening ports [...] or other attacks
If your services are accessible from the internet they are accessible... doesn't matter that you don't open ports in your local LAN, there's still an ingress pathway, and encrypting the tunnel doesn't mean your apps can't get hacked.
I don’t have to worry as much about DDoS
How many DDoS's have you been through? Lol. CF will drop your tunnel like a hot potato if you were ever targeted by a DDoS. If you think your $0/month plan is getting the same DDoS protection as the paid accounts you're being super naive. Let me translate this page for you: your DDoS mitigation for $0/mo amounts to "basically nothing". Any real mitigation starts with the $200/mo plan.
Because it's everyones MITM. I trust them with security because it's the only thing they focus on, I focus on making my stuff stop randomly shutting down. If absolutely everyone is using it, I don't care too much if an issue appears- nobody cares about my tiny little thing when Discord goes through Cloudflare
Because it's "everyone's MITM" it would make it a perfect spot for state actors to tap into in order to surveil pretty much everything without anyone being able to notice.
Hell, just the server logs (timestamps, IP addresses and exact URLs) would be unbelievably valuable.
I'd be really surprised if someone wasn't taking advantage of that.
Which is to say if you selfhost because you want more control and privacy, you probably want to avoid services like that.
ThePirateBay, the most notorious site in the world, uses Cloudflare. This isn't China. Wiretapping is illegal in most circumstances, and that's essentially what it would be doing.
Hell, just the server logs (timestamps, IP addresses and exact URLs) would be unbelievably valuable.
People say that, but the actual data would be so vast and with so little actual usability, that the dilution of it still results in largely garbage data. Its only when you have a particular focus and have the ability to filter to that focus that the data becomes very valuable.
Even banks and card processors, who have direct, legal, and completely open access to data as critical as where every one of their customers spends money struggle to do more than harvest aggregated usage patterns. The idea that data volumes, at a couple more orders of magnitude and notably more generalized will be easily processed and harvested ends up being pretty silly.
Depends what you’re putting on there. If it’s some blog that’s out there for the world to see, and if you’d like to have more traffic checking it out, then privacy isn’t your goal. Now your personal data, yeah that’s different. I have that stuff segregated.
Because it's "everyone's MITM" it would make it a perfect spot for state actors to tap into in order to surveil pretty much everything without anyone being able to notice.
People go out of their way to de-Google their phones but them are ok with this situation.
people selfhost for many different reasons. you may self host so you can degoogle, but I selfhost so I can put Kubernetes/mqtt/zigbee/flask etc etc etc on my resume
In regard to enterprises, they don’t give a rats ass about any potential intellectual property theft. That risk has been written off. What matters is compliance and security.
Not having DDOS protection in place can potentially have legal consequences and can be very costly. DDOS protection is either investing millions of dollars in equipment or offloading that responsibility to a company like Cloudflare.
In the case of overt IP theft, the contract is the mitigating factor.
However in the case of convert IP theft through systematic, transparent surveillance of traffic (what OP is alluding to), it's something that you cannot really mitigate apart from just not being digitally present. Cloudflare is a player there, but so is any ISP and nation state who is curious enough. To be on the internet, you have to accept the risk that systematic surveillance can impact your intellectual property.
In some cases, your mitigating factor is the law. But it's really difficult to prove that Cloudflare might be sniffing your data and using the IP unlawfully and it's downright impossible to prove that the NSA or foreign intelligence is using your IP.
i think you are completely wrong here. big corporations do cost assessments of security vs costs of security breaches. if security is more expensive than data breach, they will accept the breach.
Because it's easier and cheaper than setting up your own SSL tunnel securely.
From a non hobbyists point of view, you're paying for them to handle the messy business of maintaining a secure endpoint on the Internet. The sheer amount of bot crap you get hitting your servers as a result of an open SSL port is crazy. Also you are paying for their services as a CDN, which can significantly improve latency and reduce bandwidth bills.
Most self hosters won't benefit from a CDN (the volume and global distribution of traffic is too small for it to make much of a difference) or a global internal transit network.
Of course you definitely can set up your own SSL terminating proxy (where you own the box/process that unencrypted traffic goes through), it's just a lot more money and effort to do well than most would be willing to dedicate to it. But if you're not ok with your traffic going through a third party maybe it's worth it.
Just the mechanics of setting up SSL termination is a faff. Not only do you need to set up SSL properly on your app servers, you also have to do the same on your terminating proxy - and keep the certs renewed, disable insecure configurations, patch your SSL implementation. For many, the convenience of this all being someone else's problem is worth it compared to the privacy implications.
They think it's not a problem for them. Because they think that:
they have nothing to hide
they don't think CF (or TLAs who have access) will use it against them. (Possible examples: Ukrainian sites, Russian sites who disagree with goverment on at least some things)
they think alternatives are worse - it's...rather difficult to make CF censor you.
they only use CF's DNS services and not other things
It's just easier this way
This reminds me of current situation with "AI": There is OpenAI/Anthropic with their APIs (requests are sent via HTTPS but OpenAI/Anthropic are not only need to have access to do their work - they also censor it). There are paid-for alternatives who either host proxies for OpenAI/Anthropic/others (like OpenRouter.ai) or host local models for others (hosting require significant resources which will be unusused if you don't query often). There are means to host locally at home if you can. Some people prefer not to use local hosting even when they can do so.
I mean, we trust Root Certification Authorities, which are basically self-proclamed-as-trusted entities. At least CF became widespread and is community-trusted :)
A certificate authority doesn't have a copy of your private key, you send them a certificate signing request. The private key never leaves your system. That's the whole point of public key encryption.
It's not entirely true what you said.
I use cloudflare -> my Proxyserver -> my machines behind the Proxyserver
My Proxyserver has my own certificates loaded and terminates the SSL/TLS connection from cloudflare
Even if the data is passing through cloudflare cdn uses the cloudflare certificates my data is encrypted first using my own certificates from the Proxyserver
When I visit one of the sites I manage, that goes through CF (my personal ones don't), I see that the certificate that the browser sees is one provided by CF and not the one that I create using LetsEncrypt.
CF provides different encryption modes. So if it's "Full" you'll need a valid SSL cert on your server, which CF will use end-to-end. If it's "Flexible" (IIRC), then you don't need a cert on your server, in which case CF will use their own cert for encryption.
Even if the data is passing through cloudflare cdn uses the cloudflare certificates my data is encrypted first using my own certificates from the Proxyserver
This is false, connect to your website, check the certificate, it will be Cloudlfare's. I assume either you have not checked, or are a Business customer paying quite some money yearly to Cloudflare.
Cloudflare decrypts inbound traffic, then re-encrypts it before sending it to you, unless you pay a decent amount of money so that they serve your certificate.
Don't even get me started... I just made a huge comment about the clown-nature of this thought-process.
I think it all boils down to experience. Some people need time to understand how to make their systems secure (including myself). It took me years of experience to learn how to raise all defenses to ensure security in all my self-hosts.
Beyond what everyone else has said here about it being practically an industry standard now with insane levels of trust, it also foists a lot of the responsibility for security/uptime onto an external company with a good track record. That's great in the eyes of product management and likely the legal department too.
The sites I expose to Cloudflare were already being publicly hosted for my friends. Anything actually private or sensitive I run via private DNS and Wireguard internally.
OP, what you're describing is not the "big scary MITM" attack vector. It's how TLS/Reverse proxies work. Whether you are using Cloudflare or hosting your own reverse proxy somewhere with full control, it's still terminating TLS at the endpoint and passing back traffic in the clear to the backend.
Some people like Cloudflare for whatever reasons, and that's okay. I host my own reverse proxy out on a VPS and it works just fine.
You'll find that not all of the seflhosted community is super-focused on privacy as say r/privacy is.
Maybe it's my fault for posting this in selfhosted. My question was of a more generic nature about security and privacy in general. You're right, r/privacy might be a better sub for this conversation.
In my case my reverse proxy (nginx) runs on the same machine as my backend. In fact nginx also serves all static data with the backend only serving api requests.
Don’t forget, for selfhosters, the value proposition of free is always pretty strong. I have tiers of data and not everything needs to be super private at all times.
Also...shouldn't we talking more about self-hosting rather than privacy and efficiency issues? I think the topic is a moot point - either you feel that Cloudflare is 'trustworthy'...or you don't.
IMHO, it's sorta like using Google's Gmail for business purposes. Read the fine print - they can do whatever they want with your data, despite their privacy statements. Same goes with Cloudflare. You're using *their* services on *their servers.
They have to lookout for themselves and the risks involved.
That's not end to end encryption, it's two seprate ssl connections both terminated at cloudflare. One from client to cloudflare, one from cloudflare to your server. Cloudflare is still a MITM inspecting your traffic in that scenario.
They do however let you disable their proxy(WAF) service, acting as pure DNS so clients connect directly to your IP instead of theirs. But they can at any point toggle that back on and intercept your traffic, nothing really stopping them except morals and T&Cs, but that's not exactly bullet proof. T&Cs can be rewritten and corporations with Morals? Right.....
It comes down to the same line of reasoning that most people are "OK" with using cloud, be it aws, google, oracle, microsoft etc ..
Out of laziness and lack of expertise, basically sysadmins are dead.
Otherwise it's always a bad idea to offload anything on a third-party specially without transparency (pinky promise)
Same issue however exists wirh domain name registerers, etc, hence even such a thing as ens.domains are much more trustworthy, and it's much harder to exploit.