AWS Managed WAF Ruleset-Size Restrictions_Body Issue

0

We have 2 identical prod environments in AWS and the end-user send the exact same payload in those environments. However, one works fine, the other is blocked by AWS Managed WAF Ruleset-Size Restrictions_Body. How this behavior could be possible?

  • https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-baseline.html It could be due to the configuration of the AWS Managed WAF Ruleset's "Size Restrictions_Body" rule. check the configuration, Identify the resource type being used in each production environment. If the resource type has a lower default body size limit (8 KB), you can increase the limit in your web ACL configuration up to the maximum of 64 KB. Alternatively, you can create a custom rule that overrides the "Size Restrictions_Body" rule and allows the specific payload size that you need.

1 Answer
0

The behavior you're experiencing where one production environment is blocked by the AWS Managed WAF Ruleset-Size Restrictions_Body, while the other identical environment is not, could be due to a few possible reasons:

  1. Payload Size Differences: Even though the end-user is sending the same payload, there might be some subtle differences in the way the payload is processed or transmitted in the two environments. This could result in a slight variation in the payload size, which could trigger the AWS Managed WAF Ruleset-Size Restrictions_Body in one environment but not the other.

  2. WAF Configuration Differences: The two production environments might have slightly different WAF configurations, even if they are considered "identical." For example, the WAF might be configured with different rule sets or settings in the two environments, resulting in different behaviors.

  3. Timing and Traffic Patterns: The timing of the requests and the overall traffic patterns in the two environments might be different, even if the payloads are the same. The AWS Managed WAF Ruleset-Size Restrictions_Body rule might be more sensitive to certain traffic patterns or request volumes, leading to the blocking behavior in one environment but not the other.

  4. Proxy or Load Balancer Settings: If you have a proxy or load balancer in front of the application, the settings or configuration of these components might be different between the two environments, leading to the observed behavior.

To troubleshoot this issue, you can try the following steps:

  1. Analyze the Payload: Carefully compare the payloads being sent in the two environments to identify any subtle differences, even if they appear to be the same.

  2. Examine the WAF Configuration: Review the WAF configuration in both environments to ensure they are indeed identical. Look for any differences in the applied rule sets, settings, or other configurations.

  3. Monitor Traffic Patterns: Analyze the traffic patterns and request volumes in the two environments to see if there are any significant differences that could be triggering the WAF behavior.

  4. Inspect Proxy or Load Balancer Settings: If you have proxy or load balancer components in your architecture, ensure that the settings and configurations are also identical between the two environments.

  5. Test with Different Payloads: Try sending different payloads, both smaller and larger than the one that's being blocked, to see if the behavior is consistent.

By thoroughly investigating these potential factors, you should be able to identify the root cause of the discrepancy between the two "identical" production environments and address the issue accordingly.

AWS
JonQ
answered 10 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions