EC2 Instance is stuck, can't ssh in and abnormal CPU & network utilisation

0

I have 2 very small applications running in docker containers on a t2micro instance. The CPU usage is minimal but since last month I experienced that the applications were not responding due the ec2 instance being stuck.

The Instance reachability check failed and I can't ssh in to the instance, it just hangs.

Shutting down & starting the instance solves the problem but the issue happens in the next 3-7 days.

Does anybody has any idea?

CPU -> https://imgur.com/YXiSeml

Network -> https://imgur.com/dSZZduU

已提問 2 年前檢視次數 1551 次
2 個答案
0

You mention this is a t2.micro when you run into issues have you checked your CPU credit balance via the monitoring tab for the EC2 instance? This sounds like you are consuming credits faster than they are accruing. The graph you linked shows a spike in CPU utilization which more than likely accounts for the credits being consumed.

RoB
已回答 2 年前
  • I checked the logs in cat /var/log/auth.log and everything points that its due an attack.

    • Continuously and several times per second there are authentication attempts from several locations. China, US, Singapur ... They don't apply to the use case of my application since the application does not expect requests from there
    • the requests try to authenticate with default usernames like "test", "root", "ubuntu", "oracle", "postgres", "ansible" It seems the attack comes in a DoS shape ... Currently my instance is publicly reachable, What would you recommend?
0

How about fail2ban to prevent login attempts?

AWS
Yuxiang
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南