AWS – Extending EBS Block linked to EC2 Instance

Say you are working on an EC2 instance with an EBS block provisioned.
But later you find that the storage already provisioned is insufficient. You might need to increase the volume size.

It’s pretty straight-forward on the AWS console. With the click of a button you can tell AWS to increase your EBS size.

Post this change,
Though AWS takes a few mins to extend this volume, this does not reflect on the EC2 instance.

Manual commands need to be run, to extend an existing EBS volume from the small to the newsly assigned bigger size.

Here’s the steps that got it working for me after connecting to the particular EC2 instance related to the volume.



1. df -hT -> Confirm existing storage size

2. lsblk -> display all information of the volumes.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

nvme1n1 259:0 0 30G 0 disk /data nvme0n1 259:1 0 16G 0 disk

└─nvme0n1p1 259:2 0 8G 0 part /

└─nvme0n1p128 259:3 0 1M 0 part

3. sudo growpart /dev/nvme0n1 1

4. sudo resize2fs /dev/nvme0
sudo resize2fs /dev/nvme0n1

This results in the EC2 instance now having access to the whole upgraded EBS volume.

Signing out,
VJ

3 Sneaky Cyber Security Threats to watch out for in 2022.

3 Cyber Security Threats to watch out for in 2022.

2022 seems to be an interesting time in the Cyber Security landscape as the number of cyber crimes are increasing at an alarming rate. Three sneaky threats to watch out for are :-

Magecart Attack

Magecart is a type of data skimming that is used by attackers to capture sensitive information. Attackers are termed as ‘Threat Actors’ in the Cyber Security domain and, from here on in this article, we will refer to them in the same way.

In Magecart Attacks, threat actors capture sensitive information like email addresses, passwords, credit card information through malicious code they implant in websites. They sell this stolen data in the dark web. These attacks mostly happen on consumer facing browser/apps.

Credential Stuffing Attack

In this type of attack, threat actors use a list of compromised user-credentials to breach multiple systems. Many users reuse usernames and passwords across multiple platforms and their accounts can potentially be compromised with this method. The attacks are usually carried out with the help of a well automated system of software bots. Statistically about 0.1% of breached credentials result in a successful login on a new service. Sadly even now, many users keep the same password on multiple platforms, thereby making them plum victims to these sophisticated threat actors.

Password Spraying Attack

Password spraying, as the name goes, ‘sprays’ a single password across multiple usernames on a platform to get unauthorized access into it. Contrary to brute-force attacks that try out multiple passwords on a single username, this attack uses a password only once with a username before moving on to the next username. Hence, this neatly avoids an account from being locked-out due to multiple login attempts. Thus the threat actor remains undetected by the system and continues to be on the prowl, searching for vulnerable accounts.

AWS Elastic IP Pricing: A tricky affair

Elastic IP Pricing is tricky 🙂 Contrary to their pay-as-you-go model, AWS Elastic IP charges are a pay-as-you-don’t-use model.

As observed on AWS documentation, when either of these conditions are met, then Elastic IP Addresses are NOT CHARGED :-

  • The Elastic IP address is associated with an EC2 instance.
  • The instance associated with the Elastic IP address is running.
  • The instance has only one Elastic IP address attached to it.
  • The Elastic IP address is associated with an attached network interface, such as a Network Load Balancer or NAT gateway.

To summarise, basically this means Elastic IPs are only charged if they are idle or not attached to any AWS resource. So just ensure that every Elastic IP you provision is being actively used 🙂

Problem Solved!

Signing Out,
VJ


This article was previously published on Medium.