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

posta 2 anni fa1551 visualizzazioni
2 Risposte
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
con risposta 2 anni fa
  • 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
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande