- Newest
- Most votes
- Most comments
You are correct, AWS WAF JA4 rules are a good fit for this use use. However, the short answer is No, you should not blindly download and block JA4 signatures from online databases, as doing so may cause unwanted false positives where legitimate users are blocked. A JA4 fingerprint is not a unique user ID. It is a fingerprint of a client's TLS stack. Millions of legitimate web browsers (for example, a specific build of Chrome on Windows) share the same JA4 fingerprint, blocking such a fingerprint because it was in an online database would cause business impact to your legitimate users.
Standard tools or API clients might share a fingerprint with malicious actors, in fact, malicious actors try to imitate tools and JA4 fingerprints used by legitimate clients to increase their chances of not being blocked . Blocking that JA4 signature blocks legitimate clients.
AWS WAF has a web ACL capacity units (WCU) maximum limit of 5,000 (the amount of rules that you can add to a web ACL based on complexity). If you add all the JA4 fingerprints from online databases, you will quickly reach the WCU limit.
I recommend using online databases for gaining contextual intelligence, like identifying what client is connecting to your environment. Analyze your AWS WAF logs to identify if that client is acting maliciously and take appropriate action using AWS WAF rules.
AWS Best Practices for using JA4 fingerprints
Instead of treating JA4 fingerprints as standalone identifiers, AWS architecture guidelines recommend using a strategy that combines JA4 fingerprints with behavior.
- Identify and verify the JA4 fingerprint - AWS WAF Logs are your best friend
- Enable AWS WAF Logging - https://docs.aws.amazon.com/waf/latest/developerguide/logging.html
- Use CloudWatch Insights or Athena to query the logs to gain insights into the behavior of different JA4 fingerprints - https://repost.aws/knowledge-center/waf-analyze-logs-stored-cloudwatch
- Classify the JA4 fingerprints depending on the number of requests per period, how many origin IPs are associated with the fingerprints (e.g. possible bot, real browser/tool etc)
- Cross reference online JA4 fingerprint databases to identify the application associated with the fingerprint
- Build your own JA4 fingerprint database and block those requests classified and verified as malicious. This way, you have context on why you are blocking the JA4 fingerprint as you have observed its malicious behavior in the logs.
- Use JA4 as an Aggregation Key for Rate Limiting - Modern bots rotate through thousands of IPs to bypass IP-based rate limiting. Continuously rotating the underlying TLS software stack of all the bots is a more complex and intensive operation for the malicious actor.
Example: Configure an AWS WAF rate-based rule using CUSTOM_KEYS. Aggregate requests based on the JA4Fingerprint. If a single JA4 fingerprint signature ends 2,000 requests in 5 minutes, block or challenge the origin of that fingerprint, regardless of how many IPs it rotates through. The 2,000 requests threshold must have been determined by analyzing what is normal behavior in AWS WAF logs.
- Combine JA4 with Scope-Down Statements - Evaluate a JA4 fingerprint with context. Always pair it with a "Scope-Down" criteria in AWS WAF to isolate suspicious requests.
Example: Only match a suspicious JA4 fingerprint if the request is also hitting a sensitive API endpoint (like /login or /checkout). Analyzing the AWS WAF logs will provide you this context.
-
Challenge Instead of Blocking - Instead of returning a hard 403 Forbidden response, configure your custom WAF rule to trigger an AWS WAF CAPTCHA or a Challenge. This allows legitimate users sharing the JA4 fingerprint to solve the puzzle, while stopping automated scripts that cannot respond to the CAPTCHA or Challenge.
-
Add AWS WAF Bot Control Managed rules to your web ACL for additional protection against bots. Note that these have additional charges https://aws.amazon.com/waf/pricing/
The main takeaway is that using AWS WAF logs, you can build a database of malicious JA4 fingerprints that you can confidently block. For requests with unknown JA4 fingerprints, you can create rules that label the requests and then aggressively rate-limit them. Use the online databases to validate what you are observing in your environment via the AWS WAF logs, but do not use these as a source of truth.
Simply retrieving JA4 signatures from an online database and blocking them carries the risk of collateral blocking (false positives) affecting legitimate users; furthermore, public databases have limitations regarding data freshness, so this approach is not recommended as an AWS best practice. The appropriate strategy is to position JA4 as part of a defense-in-depth approach—using the Bot Control managed rule group as the foundation while utilizing JA4 supplementarily, such as for rate-limiting aggregation keys or as a filtering criterion combined with other conditions.
answered a month ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 6 months ago
