Score:0

AWS Billing for EC2 Data Transfer in Free Tier

cu flag

I am new to AWS. I recently created a Free Tier account to install WordPress.

I followed instructions like this to install: https://www.wpbeginner.com/wp-tutorials/how-to-install-wordpress-on-amazon-web-services/

Just created a t2.micro EC2 instance under free tier. But I am getting billed $0.010 per GB - regional data transfer - in/out/between EC2 AZs or using elastic IPs or ELB. I use only one zone.

Cost Details Here

I use only one region. Checked VPCs, Subnets. No Elastic IPs or Load Balancers. What should I do?

EDIT: VPC Logs: https://drive.google.com/file/d/1U-6PevU64LLU5JmvCm3UaoJcWNapiWcm/view?usp=sharing

I am getting billed for: APS3-DataTransfer-Regional-Bytes. About 52GB is billed. In VPC Flow Logs, 172.31.41.188 is the assigned IPv4 Server Address. I have stopped the instance now.

Some metrics from CloudWatch: enter image description here

Score:0
ng flag

Based on your comment to another answer, AWS Cost Explorer has indicated the billing item is APS3-DataTransfer-Regional-Bytes.

Data transfer within an AWS Region

Data transfer between Availability Zones in the same AWS Region have a UsageType of Region-DataTransfer-Regional-Bytes. For example, the USE2-DataTransfer-Regional-Bytes usage type identifies charges for data transfer between Availability Zones in the US East (Ohio) Region.

https://docs.aws.amazon.com/cur/latest/userguide/cur-data-transfers-charges.html

According to the above documentation, APS3 is indicative of the region where the charge is coming from.

The following link seems to suggest that this might be S3 (not because S3 is in the code) in Asia Pacific (Mumbai) region.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/aws-usage-report-understand.html

Your account is most likely compromised and if you change to that region in the AWS console you will likely find an S3 bucket which is being used to host malicious, or other nefarious data.

However, I wasn’t able to confirm if this might be Asia Pacific Southeast 3 (Jakarta) region as well.

UPDATE

Thank you for the additional info and flow logs. If we filter your flow logs by Action=Accept and sort by Bytes then we quickly see some additional details: enter image description here

We see this flow log shows a large amount of traffic between your instance's private IP address, and the public IP address 13.233.254.23 which is also owned by Amazon. I also see port 16411 involved in this communication, which is typically reserved for streaming services in Apple's Game Center, but it can certainly be used for any other reason. Amazon seems to be treating this traffic as intra-region traffic suggesting that the IP address 13.233.254.23 (Asia) is in the same region as your instance on 172.31.41.188.

Because port 16411 is always on the external IP address 13.233.254.23, and your EC2 instance is using random ports for the other end of the connection, we can say that your EC2 instance is originating these requests outbound, and based on other details, the connections are resulting in large amount of traffic both inbound and outbound. Based on all the information you have provided, it would appear likely that this server might be streaming video/audio content from an Apple server.

Regardless if we are correct about the usage of port 16411 it is still clear that this type of traffic is unusual for a server only running Wordpress. In addition, I see active SSH sessions (port 22) to at least two public IP addresses. I could accept that one of them is your own, but I question why there is a second from a different IP address.

All of this indicates that your server is not just a WordPress server. It is either compromised and being used nefariously, or you have services installed on this server which are not just serving webpages. The fact that it happens to be communicating predominantly with another AWS owned IP address in the region is probably insignificant, and a red herring on your billing statement. But intra-region traffic is not included in the free tier.

Devanarayanan avatar
cu flag
Asia Pacific Southeast 3 (Jakarta) region is disabled. APS3 is Asia Pacific (Mumbai). I can't see any S3 Buckets. In Billing Dashboard too, there are only 4 Active Services. I can see that there are 7 KMS Requests. Is that related to compromised account.
Appleoddity avatar
ng flag
KMS is key management service. It’s usually used when there is encryption involved, such as for an encrypted S3 bucket, or encrypted EBS volume. Somehow we’re missing the details we’re looking for here. Honestly, your best option is to contact AWS support. You’ll probably have an answer within a couple of hours.
Appleoddity avatar
ng flag
@Devanarayanan see my update...
Devanarayanan avatar
cu flag
I think you meant SSH from this IP 122.170.6.116. Just checked its not mine. Its showing as Airtel and marked as spam/dangerous. Other IP belongs to KeralaVision, which is mine. Just contacted AWS Support. They have forwared to Security Team. I hope they respond soon. Also about the KMS, I haven't setup any encryption manually and I see that the volumes my instances use are decrypted.
Appleoddity avatar
ng flag
@Devanarayanan - yes, it appears to be a malicious IP that is responsible for a lot of brute force password cracking... https://www.abuseipdb.com/check/122.170.6.116 EC2 instances come by default with SSH password access disabled. You have to use a AWS generated certificate usually associated with the `ec2-user` account. So an IP address successfully brute forcing your server would suggest you enabled other user accounts with weak passwords which were able to login through SSH. Or, it's possible your own personal computer is compromised which is leaking info to attackers.
Devanarayanan avatar
cu flag
I use the Certificate to login into SSH. There are no other users in my AWS. Its a new account. I used Windows Terminal to login into SSH. I also used the certificate in FileZilla to connect to FTP. Others aren't using my PC, so I think I will have to scan it for infections.
Devanarayanan avatar
cu flag
How can I find out where the leak occurred? https://superuser.com/questions/1767412/securing-ssh-keys-ssh-hacked
Score:0
gp flag
Tim

The $0.19 line item could be bandwidth out to the internet, or between AWS availability zones. The bill isn't precise enough to tell you. You could try the "aws cost explorer" service, which lets you drill down some more. It can take 24 hours to activate on a new account, or from when first accessed. Give that a shot, then edit your question to show any more detailed information you find. In cost explorer change "group by" to "usage type" to get more useful information.

19GB is a fair bit of data for a new Wordpress website to use. I run a website with five Wordpress websites and a reviews website, plus a few other things, in December I used < 5GB of bandwidth. I would be looking in CloudWatch at bandwidth graphs to see when it's happening. You could also use VPC Flow Logs, but they're extremely verbose and difficult to read. It could be that your server / software was compromised as soon as it was set up - AWS Inspector can help work that out, and AWS Guard Duty can help as well.

As of late 2021, all AWS users get 100GB of free egress bandwidth across all services, plus 1TB egress from CloudFront (blog link). The CF pricing page says bandwidth from EC2 / S3 / ALB to CloudFront is free, so you'd be best off using CloudFront for the 1TB bandwidth allowance.

Here's a cost explorer graph from my account, slightly cut off.

Cost Explorer

Devanarayanan avatar
cu flag
Cost Explorer hasn't fully loaded. This is a new account. Now the usage has gone up to 52GB
Devanarayanan avatar
cu flag
Checked the Cost Explorer. Its billed for APS3-DataTransfer-Regional-Bytes
Devanarayanan avatar
cu flag
"The amount of data transferred from Amazon S3 to AWS resources within the same AWS Region". Got this definition, but can't understand where.
Appleoddity avatar
ng flag
@Devanarayanan make sure you are looking for resources in the right region. At the top of the AWS UI you can select your region. If you have selected Ohio for instance, you will not see resources in Virginia. Try to confirm where the resources are that you are being billed for. You may not realize you have something in another region. And I repeat, this type of inquiry can be sent to AWS through their support portal and they can assist.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.