237 points · by SQL2219 · 9y ago · 149 comments
1. IoT with basically no security
2. No(Auth)SQL.
Also, dev time has become so expensive, the InfoSec teams in the companies I've worked at have had shockingly low head counts for all the responsibilities they have.
It used to be you had to actually break into a system to exfiltrate all its data. Now you just make an HTTP query. Owning a big system was really important because bandwidth and server space was expensive. Now you rent some VPS space with bitcoin you made from spam or DDoS-for-hire using someone else's botnet that had been sitting around with a default password, and use it to distribute pirated media like it's text files. Mass-scan for SQL injections, inject some malware you found on a forum, and amass a botnet to play with. What a time to be a script kiddie.
I'm not sure about the modern age, but to me the golden age of blackhats was pre-2003, when nobody was really watching their networks or systems and advanced techniques were everywhere with zero defenses. Metasploit and the age of shitty webapps and packaged malware ushered in the dumbing-down of blackhats as a general concept.
(Get off my lawn!)
Look at it from the blackhat perspective. I don't care what the hell loops you're going through on the backend. If there's a 0day, i'm going to use it and it's going to work, because you don't even know about it yet, much less have a patch built into a binary pushed to mirrors that your Docker image building box needs to update to before you can rebuild your image and push it to your servers and do a maintenance window to switch to the new services.
It doesn't matter if you are running in a VPS in a container in a virtual machine in an emulator, because I can still use an SQL call to dump everyone's passwords, or get voting records and account details for one of your political parties. If I execute code you're still going to get owned because you don't have security patches in your kernels and you don't use signed binaries (none of which are new technologies, btw).
I would even go so far as to say you would never in a million years find exploited code in one of your systems because you somehow believe container apps are immune to basic vulnerabilities. Containers are just fancy chroots.
Docker is just a fancy chroot, a motivated attacker can escape from it, it remains far less secure than a freebsd jail or a solaris zone.
Except maybe some somewhat safer compiled languages (rust, newer versions of C++), and a few interesting tools (like AFL), there was not much improvements in security mechanism in late years.
SELinux is still so annoying that it's commonly the first thing disabled in many install.
A large amount of sysadmins and developers still do a chmod -R 777, not fully understanding what there are doing.
And in the area of micro services, the traditional 3/4 tiers architecture can easily be replaced by a clusterfuck of containers deployed in a flat network where it's impossible to monitor what is speaking with what. And it's much easier to make a mistake like putting a database on the Internet with no authentication whatsoever...
What is more, because of containers, infrastructures tends to be far more diverse than ever: python, node, php, ruby, go, java, each with various version, from various distribution, with various libraries. Each of these environments must be properly monitored, but when you deal with thousands of containers, hundreds of technological stacks, with 3 or 4 versions for each layer, it becomes a nightmare.
In languages that encourage bundling, Java with war webapps for example, I've rarely seen developers properly monitor security issues of what they ship. Too often I've seen only opportunistic updates. And in some extreme cases I've seen products shipping version of libraries 10 or even 15 years old. Containers being a way to generalize bundling, I don't see it being an improvement in that regard. Quite the contrary in fact.
However, to be completely honest, new tools like chef/puppet/containers and new methodologies like Infrastructure as Code somewhat helped to be less frighten about updates as it reduces the risk/impact of something breaking in the process, no more 'don't touch it, it will break comething'. Even containers can help in that regard, it's easier to do AB testing, avoid downtime or put servers in maintenance with them.
Fundamentally, some things are better, some things are worth, and in the end the security level has not really changed.
And honestly, it's a truly frightening view. Software/Infrastructure security is becoming more and more important as sensitive operations are increasingly done through websites (ex: banking operation), private data is increasingly stored in the "cloud" and an increasing number of devices are now connected.
Security flows are still as numerous as before, but their impact, once exploited, tends to be far greater. If it continues like that, something really bad will happen, exactly what is difficult to predict (massive data leak? major industrial disaster caused by a hack? an election being manipulated?), but it will happen.
But the dangers are pretty high. You never know how ten years from now the digital trail you left comes back to bite you.
Cashing large amounts it's not trivial. Sure, you can meet in private locations with local bitcoin buyers, but when you have $1 mil to sell it gets tricky, there aren't that many buyers in any particular area. And then you have the problem of justifying how you suddenly have one million.
Assuming I'm willing to pay the tax if it's due has anyone had trouble with authorities questioning your new cash pile say if before this you had no real money and lucked out on Bitcoin?
Naturally, you'll have to shell out some "transaction fees" to some authorities, but that's just standard laundering thing.
Absence or presence of auth is irrelevant. You're database servers, message queues and other infrastructure shouldn't be accessible from the internet. No auth protocol can protect you from this.
Person develops 2 or 3 apps, setup 2 or 3 databases and thinks he/she is a professional.
Many businesses and managers care less about security and more about getting the deliverables into production.
Many CEOs and managers lack the understanding that once you launch (app, store, website etc) it doesn't end there, instead, moves into maintenance.
My company just hired an external company to assist with our IT infrastructure. I was asked to meet with the person that showed up to begin the take over. He was not interested at all in understanding what we do as a business. If you don't understand your clients, their interests, their responsibilities and obligations then, simply put, they are fucked!
In my experience the issue isn't so much that C's and managers lack understanding, it's that they refuse to acknowledge that they lack understanding and refuse to listen to people who do understand because it's "Just IT". This mindset is something I've seen backfire many times over the years, and in the end it always ends up costing more than just doing things properly in the first place.
/endrant
But they didn't hit the oplog/journal, fortunately the full history (a few months of data) was still in the journal, so they were able to replay it (minus the drop commands) and restored their data.
Certainly scared a lot of people and (hopefully) taught a lesson about double-checking what's exposed to the internet.
(And anyone who deploys any service on an internet-facing server should know what they're doing)
I agree that they should. History has shown us, however, that they very often don't.
Who is downvoting this? People who hate common sense?
Expecting it to be secure on the internet is even less reasonable.
Without a public facing DB they're pretty much dead in the water.
For azure at least, they protect it with a firewall that block all IPs by default. But a database with no internet access is unrealistic.
It's not insecure by default. It just binds to all interfaces. Apache and Nginx both do this and we don't consider them to be insecure. Should a database be doing this ? That's debatable since it's a tradeoff between security and ease of use.
But that said if you are running an internet facing server without a firewall then you will have bigger problems than just your database.
I also don't get this "firewall" idea. Why make something listen for everything, and then place a system outside to restrict it? Why not just whitelist what you want to listen to in the first place?
Note, I get that binding an application to localhost and then letting a dedicated proxy do the heavy lifting to link up with other systems (eg stunnel or haproxy) - but what does packet level filtering really gain you?
In general I see firewalls as just adding complexity - one more source of bugs and potential mis-configuration. (Say the fun when ipv6 exposes the soft inner network that everyone thought was "firewalled" when in fact it just had broken connectivity due to chappy NAT borne from scarcity of routable addresses).
In an ideal world, everyone would care about this stuff (and have time to properly set these things), but we're not in an ideal world.
Misconfigured mongodb servers are the issue here, not firewall. Default mongodb shouldn't listen blindly to any connections though.
An irrecoverable disk crash could hold your db ransom for $Inf.
I have not used mongodb in any production environment but it would be nice to know what one should do to make it secure.
- deny (all) incoming traffic by default
- permit only desired traffic (to specific ports) from specific hosts
- avoid binding (listening) to interfaces you don't need to
- set up / verify authentication is in place
In addition to the link to the security manual that cpolis posted, there's also a MongoDB Security Checklist [0].
[0]: https://docs.mongodb.com/manual/administration/security-chec...
Firewall, on the local machine ALL ports except for the ones that you expect to be accessed remotely.
This is for all hosts - even your laptop. Never mind mongo.
There is no reason at all to leave inbound ports open for requests you don't expect to service.
Further, and I know this makes peoples heads spin and they foam at the mouth, but for ports you do need open, but don't serve the public (ssh, for instance) set up a port knock. Now it's invisible and you don't care about the 0day for that service.[1]
[1] Stop. Take a deep breath. Re-read the above post and realize that I did not say to remove your login passwords and keys and rely on only the port knock for security. Take another deep breath. It's going to be OK.
https://docs.mongodb.com/manual/administration/security-chec...
So the usual rules apply: (1) have a firewall with only the bare minimum ports open, (2) make sure everything you are running is on unusual ports especially SSH, (3) VPN, jump hosts or port knocking if you need remote access, (4) use something like Fail2Ban or Sentry.
I understand it needs to be low enough to make payment an "attractive" option (at least compared to other means of recovery, if any...). But 200 USD is significantly less than the 500 USD ransom extorted from private PC users.
Should we conclude the extortionists expect the database content to be worth less to a company owning it than a private person is willing to pay for his/her pictures, music files and documents?
Many of these could be caches, or rebuildable from other sources.
Many could be disposable.
Since you can't really know which database is valuable and which not, you sort of average the price, since this is volume game.
Or maybe he want's to give the impression that this is not very profitable, to keep others from doing the same.
I guess the high risk of getting nothing in return is affecting the pricing.
- A/B testing of ransom prices will happen
- the person paying the ransom is not the company but an employee afraid for their job
- companies more likely to be able to restore from backup
The "tough love" approach to raising awareness about security.
What I mean is, it's pretty ignorant that just because authentication isn't on by default you don't turn it on at all.
Even if you don't want to or don't think to configure mongodb itself setting up a firewall also seems to be common sense.
Thus, the only reason they'd be unsecured is they're either for random tests or hobby.
This is ironically a good thing as it poisons the well for 'legitimate' ransomware. The less people expect paying up to restore their data, the less people will pay up and the less viable ransomware is as a business model.
0. upload client public key
1. Setup SSH auth by cert/key
2. Move SSH to non-standard port
3. Enable passwordless sudo
4. Disable password auth
5. Setup firewall to only allow the new ssh port
6. Setup port knocking
Those are the first few things I do on a server... As locked down as I can get before doing anything else... of course, I'll also put the new ssh port and an alias in my ~/.ssh/config ...Most cloud providers offer the option to have a "private" IP space... just having a proper firewall ufw/ipchains/iptables, etc config can go a long way towards helping lock things down.
Of course, that only goes so far when you aren't using passwords or TLS for client/server communications. But it's better than leaving the front door open with a sign saying as much.