I'm using AWS WAF with an Application Load Balancer to filter incoming HTTP requests to my api server for security.
My api server expects files to be uploaded as .tar archive compressed with lz4.
Is there a way to configure AWS WAF to inspect the contents of .tar.lz4 files in POST requests, or must this be handled at the application server level?
This would have to be handled on the application level, or architecturally you can of course offload this to any file processing service internal or external to your application.
AWS WAF allows you to create custom rules to a certain extent, you can inspect all kinds of attributes of incoming and outgoing traffic, but this level of processing is way beyond its capabilities (or that of about any WAF). You can't write arbitrary code to extend the AWS WAF this way. It would also consume an insane amount of web ACL capacity units (WCUs).
What you can do instead is