3 ms·
ELI5: Way back in the early 2000s I was a young mid level developer and we had a SQL Server backed solution. There was a wide spread attack on Sql Server insta
by scarface74 6y ago
ELI5:
Way back in the early 2000s I was a young mid level developer and we had a SQL Server backed solution. There was a wide spread attack on Sql Server installations that didn’t change the default blank SA password. We were one of the companies that didn’t.
But, even then I knew not to have a publicly accessible database server. We just didn’t give the server a public IP address. Nothing fancy. We weren’t affected but I immediately changed the password.
Fast forward to 2018. The company I worked for was just starting to ramp up an in-house development staff led by a new CTO. Everything had been outsourced to a foreign agency. They had a publicly accessible ElasticSearch cluster. I wasn’t on the team responsible for it, but I know that the architect on the team knew better. Even though he didn’t setup the original cluster, he knew it was insecure and just didn’t prioritize recreating it inside our VPC.
Of course we got hacked and someone deleted everything in it. Then they decided to go ahead and recreate it inside the VPC. Luckily we didn’t use ES as a primary store and we were just offline all day while we ran the process to repopulate the cluster from our Mysql database.
Why do people keep making the same mistake? I was definitely not any world class software architect at 25 years old, but even I knew to be cautious about giving servers public IP addresses unnecessarily.
- asciimov 6y ago> Why do people keep making the same mistake? Because there are always new developers showing up that haven't been taught. (Eternal September if you will) The real solution would be: 1. We are past the point were our practice needs professional licensure. We need standards, a governing body, and ethics. 2. Those above items need to be taught to new developers. How long has security been an after thought to CS degree programs? I know I never touched it in an academic setting. We didn't even have a class that covered it. You wanted to learn about it you had to seek it out. 3. Vendors to do the right thing and stop offering default passwords. That isn't going to happen, so we have to force them to, either trough legislation or through other means.
- scarface74 6y agoBut I bet a new college grad can reverse a binary tree on the whiteboard and do “leetCode hard” problems in their sleep....
- lmm 6y agoBecause you're completely wrong; what you're advocating is nothing more than security by obscurity. An address is just an address; it tells you where something is. If you don't have a firewall in place, then any attacker who cares enough to actually route a packet to your internal servers can access them. If you do have a firewall in place, then an attacker gains nothing from knowing the address of a server they can't send any packets to. Private networks add a huge amount of complexity with its own security holes (they're easy to scan once you're inside them, a lot of operating systems treat them as somehow "safer" than the public internet...). They do more harm than good.
- scarface74 6y agoYou realize you can’t get to a private IP address over the Internet right? It’s kind of how that whole TCP/IP thing works. You know a “private IP address” isn’t one that’s not known it’s one that not routable over the public internet. RFC 1918 was written in 1993
- lmm 6y ago> You realize you can’t get to a private IP address over the Internet right? Of course you can - most end users have private IP addresses these days, yet they somehow manage to communicate with people on the internet. A private IP address is of course not routable directly on the Internet. But routers route, and can certainly route a packet from the public internet to an RFC 1918 private address. If the routers on the edge of your RFC1918 network do not have firewalls in place, then they will happily route packets to your internal servers and you're no better off (against a serious attacker; a script kiddie might ignore you as too much effort, sure) than if you used public addresses. If those routers do have firewalls in place, then you're also no better off than if you used public addresses.
- scarface74 6y agoIn the case of the attack in question - how would they have initiated a command to erase the ElasticSearch cluster from the Internet? Any NAT would be stateful and the communication would have had to be initiated from the cluster. Not having a public IP address is not about “obscuring” the IP address. It’s not like so said why didn’t they have ES listening on a non standard port.