Vijay Mandanka
Vijay Mandanka

Reputation: 141

AWS Load Balancer 403 Forbidden When Account Name Starts with "Call T" on Test Server

We have an API hosted on an EC2 instance behind an AWS Load Balancer. The API works fine except when the AccountName field starts with "Call T". When we send a request with this pattern, we get a 403 Forbidden error.

Things We Checked:

Questions:

Upvotes: 2

Views: 59

Answers (1)

Chetan Sanghani
Chetan Sanghani

Reputation: 2111

Please try below things

Enable ALB Access Logs:

In AWS Console, go to EC2 > Load Balancers > Your Load Balancer > Attributes. Enable Access Logs and specify an S3 bucket. Check logs for 403 entries to see if the request reaches the backend.

Bypass Load Balancer:

Temporarily access the API directly on the EC2 instance using its private IP. This helps determine if the issue is with the ALB or the application itself.

Test Encoding:

In Postman or cURL, URL encode "Call T" as %43%61%6C%6C%20%54. This checks if encoding resolves potential pattern matching issues.

Change Header Position:

Move "AccountName" to a URL parameter (?AccountName=Call T) instead of in the request body. This tests if the ALB is inspecting the request body.

Upvotes: 0

Related Questions