Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu usage 100% caused by silence and fs-manager #1088

Closed
barbalex opened this issue Jan 4, 2018 · 13 comments
Closed

cpu usage 100% caused by silence and fs-manager #1088

barbalex opened this issue Jan 4, 2018 · 13 comments

Comments

@barbalex
Copy link

barbalex commented Jan 4, 2018

Expected Behavior

Usually CPU usage should be below 10%.

Current Behavior

CPU usage is at 100% 95% of the time.

On 5 different production servers I have noticed that cpu usage has been at 100% for most of the time during at least the last 30 days.

From running top it seems that most often Silence is the main culprit, using 98% of the cpu. Sometimes fs-manager and Silence both use 49% each. And on one server it seems that fs-manager uses 98%.

There are no active tasks running.

Two of these servers couches contain very low number of docs (a few hundred). The others have about 30'000 docs.

What could cause this behaviour?
How problematic is it?
How can I prevent it?

Your Environment

@garrensmith
Copy link
Member

From the other reports I've seen on the dev mailing list, your couchdb instance has been hacked and someone has installed a bitcoin mining instance on your service.

@barbalex
Copy link
Author

barbalex commented Jan 4, 2018

@garrensmith Yep, you were right. These were crypto miners. I found a mailing list mail from Sinan Gabel explaining how to turn off the miner. Unfortunately I do not know how to link to Sinan's mail so here is the gist:

I needed to remove a cron job created from user couchdb:

sudo -i
su couchdb
crontab -e

// Then remove the line in the cron
// save and reboot

So thanks a lot to you and Sinan Gabel.

Of course I will also have to rebuild my servers now.

My biggest concern now is: How to prevent this from happening again, as these couch instances were not in admin mode.

@barbalex barbalex closed this as completed Jan 4, 2018
@garrensmith
Copy link
Member

garrensmith commented Jan 4, 2018 via email

@barbalex
Copy link
Author

barbalex commented Jan 4, 2018

@garrensmith: thanks a lot for your great help!

@paulocoghi
Copy link

paulocoghi commented Jan 12, 2018

I was also hit by this invasion. I am using CouchDB 1.6.1 from stable PPA https://launchpad.net/~couchdb/+archive/ubuntu/stable

How can I update it to solve this security vulnerability, since there are no updates in the PPA? Or there is an available workaround?

@paulocoghi
Copy link

Found a solution: #787

@barbalex
Copy link
Author

barbalex commented Jan 12, 2018 via email

@paulocoghi
Copy link

In my case the problem reappeared inside minutes.

@barbalex , this happened in which version?

I upgraded to version 2.1.1 after using 1.6.1 and experiencing this problem. I used couchup to migrate data from the old version to the new one.

So far, everything working perfectly. The only detail was that couchup did not migrate the users, and I had to re-create them manually.

@paulocoghi
Copy link

@barbalex , just removing the cron jobs is certainly not enough since the vulnerability remains open if you do not upgrade.

@barbalex
Copy link
Author

@paulocoghi

This was during the short period before I rebuilt the servers. So still with version 1.6.1.

And you may be better off not migrating the users: The "bad guys" added a few users. And also a few db's (with only one document each).

@wotaen
Copy link

wotaen commented Feb 8, 2018

Just for reference if anyone is looking for the process name. It's supsplk in my case. It's stored in /var/tmp/

@dninet
Copy link

dninet commented Mar 12, 2018

I've had the same problem. A Monero miner was installed through a curl request to 192.99.142.232:8220/logo3.jpg which is in turn a bash script. When it starts with 192., doesn't it refer to a local network?

@wohali
Copy link
Member

wohali commented Mar 12, 2018

@AlbertDavid94 No, the private IP space is only 192.168.0.0 - 192.168.255.255. Addresses outside this range are publicly routeable, including 192.99.142.232.

The full set of private IP space blocks is documented in RFC 1918.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants