38 points · by goodwink · 13y ago · 55 comments
That is a bit ridiculous that they retained your password. Still though, logging in after rebuilding and configuring your system would have been a sane move.
Probably not strictly related (it would seem the attack in question was via a compromised (on whoever's end) ssh password), but in any case good practice: always regenerate ssh keys after installation from a base image. Some OS images may contain pregenerated keypairs (private key is usually at ~/.ssh/id_rsa ), which should always be regenerated. (This bit is most probably not actually related to the issue at hand, but IAC should not be forgotten.)
(No affiliation with DO here, just hate to see any company unfairly attacked...)
Edit: Disclosure, I met one of the co-founders at SXSW. Seem like cool dudes.
Yes, I know my setup was very flawed. It was a test machine and in the midst of having automated config scripts written for it which were being tested. This is why the machine was vulnerable to the attack, but this does not diminish the importance of the underlying compromise it exposes in DigitialOcean's setup.
The point of the article is that someone is able to gain access to DigitalOcean password reset emails or a database of root passwords which shouldn't exist, but seems to given that they set your root password back to a previously reset value after you rebuild your server from the base OS image.
"Your root password will be emailed to you"
-- start --
Me
Just seen this at the bottom of the "Create a droplet" page. You're kidding right?
Them
The root password is sent via email because it is the easiest and fastest way to get a user online and running a virtual server.
We strongly recommend updating the root password after you login for the first time.
We also have SSH keys support so you can add your SSH key to the server during creation in which case no email is sent and instead the SSH keys are added under the root user for more secure access.
Thanks,
Me
Just added an SSH key and you're quite right, I retract my blunt reaction.
I must say however that I still think emailing them is a fairly terrible idea and I'm surprised your not worried about being found liable for a subsequent server hack.
That aside, thank you for your swift response and for pointing out I can use my SSH key. I look forward to using DO more
-- end --
N.B. I actually received their response twice from different agents suggesting it was a canned response
Frankly I don't even think passwords should be an option, as on AWS (not that they're perfect)
Heuristics like "keys are better than passwords" or "don't email passwords" are good heuristics, but they shouldn't become absolute rules.
Onerous security policies can make things worse as people work around them behind your back. You can require certificates but there's nothing you can do to make sure that people don't put their keys in their dropbox for "safety" because they don't want to get yelled at for losing their keys when a machine crashes.
People shop for VPSs partially based on convenience of management. If you make your system secure but inconvenient, you can lose the people who would would most benefit from a "good enough to stop the automated SSH bot" policy.
Those are the first few things you should be checking when setting up a new server (disable password logins and only allow keys).
shocker.
(It's very likely worse to do your own unless you have the resources to do it right. Hosting companies have scale. Not defending DigitalOcean here, just challenging your assertion.)
It took 5 support letters to get my account unblocked, and the solution was to block SMTP ports...
I didn't have anything installed !!! Clear Ubuntu image
Once a system is compromised by a root exploit what makes you think that any information that this system is giving is true?
While it may be likely seen the circumstances it is by no way certain. For all we know it may have been a bruteforce attempt which, once in, got disguised as a known-root-password attack.
As long as people are going to think that a compromised system is actually giving true information about what happened we'll be in big trouble.
Or OP tells us that SSH login and SSH login attemps are logged automatically on another server which hasn't been compromised and then it's a different story...
Once you're in that fairly secure state, fail2ban is completely pointless and serves only to reduce noise in your log. Which you should stop caring about. I'm serious. fail2ban is a complete waste of resources and will peg a core tailing your SSH log because it's a resource-intensive piece of software that serves no valuable purpose. If you're worried about the resources of writing a log, redirect the log off the box and prevent your local logger from writing to disk -- which you should be doing for security reasons anyway, as discussed in another comment elsewhere in this thread (how do you trust a box's logs once compromised?).
While you're at it, don't move SSH to a separate port. There are interactivity QoS defaults in most networks that expect SSH to be on 22, and the clever bots will find your "cleverly hidden" daemon anyway. And wait until I tell you that in the event of your "cleverly hidden" port 2222 SSH daemon crashing, one of your local users can put up a trojan SSH daemon in its place without your permission (which is why SSH is on 22 in the first place).
Just deal with the log noise. We all do on edge boxes exposed to the Internet.
What if a botnet is used to do the brute-force, does fail2ban lock everybody out, effectively making fail2ban a tool that can be used for Denial of Service?
All I'd have to do now is to hammer your system with SSH attempts from my botnet and you can't log in anymore...