Hello,
While Azure AD Proxy with Passthrough Auth can be a secure setup, it doesn't provide the same level of protection as a Web Application Firewall (WAF). A WAF can help protect your application from common web-based attacks such as SQL injection or cross-site scripting (XSS), which the Azure AD Proxy wouldn't be able to do.
This seems like a situation where the WAF is producing false positives because it is incorrectly interpreting your application's legitimate database queries as potential SQL Injection attacks. This is a common challenge when implementing WAFs, as they need to be finely tuned to match the behavior and characteristics of the specific applications they are protecting.
The settings and thresholds of the WAF rules can often be adjusted to reduce the number of false positives. For example, you could potentially lower the sensitivity of the SQL Injection rules, or customize them to better match the patterns of your application's database queries.
If there are specific patterns or types of requests that are consistently being flagged by the WAF but are known to be safe, you could potentially whitelist these patterns so they are not blocked by the WAF. This should be done cautiously, as overuse of whitelisting can undermine the effectiveness of the WAF.
If possible, consider revising the application code to make database queries that are less likely to trigger WAF rules. This could involve using parameterized queries or stored procedures, which are less likely to be seen as potential SQL Injection attacks.
Please note that any changes to your WAF configuration should be made cautiously, as they can potentially expose your application to increased security risks. It's always important to thoroughly test any changes and monitor their impact on both security and application performance.
Boris