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

feita há 2 anos1549 visualizações
2 Respostas
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
respondido há 2 anos
  • 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
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas