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

asked 2 years ago1530 views
2 Answers
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
answered 2 years ago
  • 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
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions