localhost is an abstraction, it's a non-routable-outside-your-machine network...except it's not. It's nothing more than normal TCP traffic except with a message to the OS and other programs that whatever is on that local computer network, you don't want it routed outside the local computer. There's absolutely nothing stopping anything with access to localhost from routing it anywhere that process wants. Does not even…
The fact that the production db has the same username/password as the development one is perhaps more troubling.
We deleted the production database by accident
21–30 of 456 posts
Re: We deleted the production database by accident
#22localhost is an abstraction, it's a non-routable-outside-your-machine network...except it's not. It's nothing more than normal TCP traffic except with a message to the OS and other programs that whatever is on that local computer network, you don't want it routed outside the local computer. There's absolutely nothing stopping anything with access to localhost from routing it anywhere that process wants. Does not even…
The fact that the production db has the same username/password as the development one is perhaps more troubling.
Re: We deleted the production database by accident
#23>Note that host is hardcoded to localhost. This means it should never connect to any machine other than the developer machine. We’re too tired to figure it out right now. The gremlins won this time. Obviously, somehow the script ran on the database host. some practices I've followed in the past to keep this kind of thing from happening: * A script that deletes all the data can never be deployed to production. * scrip…
I have a little metadata table in production that has a field that says “this is a production database”. The delete-everything script reads that flag via a SQL query that will error out of it’s set in the same transaction as the deletion. To prevent the flag from getting cleared in production, the production software stack will refuse to run if the “production” flag is not set.
Re: We deleted the production database by accident
#24VPN to production and same hostname for dev and prod?
Re: We deleted the production database by accident
#25>Note that host is hardcoded to localhost. This means it should never connect to any machine other than the developer machine. We’re too tired to figure it out right now. The gremlins won this time. Obviously, somehow the script ran on the database host. some practices I've followed in the past to keep this kind of thing from happening: * A script that deletes all the data can never be deployed to production. * scrip…
More likely, I'd suspect, is something like an SSH tunnel with port forwarding was running, perhaps as part of another script.
Re: We deleted the production database by accident
#26Lost seven hours of data? Daily backup with no transaction log backup? Whoa.
Re: We deleted the production database by accident
#27Earlier quoted context omitted.
The fact that the production db has the same username/password as the development one is perhaps more troubling.
It likely doesn't... it probably reads it from the environment or a config role, and since it was in production it had the production credentials.
Re: We deleted the production database by accident
#28Wow. But then again it's not like programmers handle dangerous infrastructure like trucks, military rockets or nuclear power plants. Those are reserved for adults
Re: We deleted the production database by accident
#29This is my greatest fear when it comes to terraform: > terraform destroy (And either a confirmation or a flag) and everything is deleted. I know you can add some locks but still :/
I like to use the lifecycle feature for suuuper core things that will never be deleted (VPC, r53 zone, etc) and eventually when I start targeting multiple DCs w/ lots of infra I'll eventually move to many state roots (or use tools like Terragrunt, which make things mildly scary again).
Re: We deleted the production database by accident
#30> Computers are just too complex and there are days when the complexity gremlins win. Wow. But then again it's not like programmers handle dangerous infrastructure like trucks, military rockets or nuclear power plants. Those are reserved for adults