The Correct Answer is: None of the Above
Let's break down why each option fails to address the root cause, and then I'll explain what the engineer should actually do.
Analysis of the Problem:
- Cross-Site Request Forgery (CSRF) vulnerability was exploited.
- A Web Application Firewall (WAF) was deployed at a Content Delivery Network (CDN) in blocking mode to prevent future attacks.
- Despite this, the attack happened again.
This means the WAF failed to block the CSRF attack. The issue is not with:
- Network traffic flooding (DDoS)
- Endpoint malware (VM protection)
- Network access (subnet ACLs)
- Passive detection (IDS)
The problem is the WAF isn't properly configured to detect/block CSRF.
Why Each Option is Incorrect:
❌ 1. Configure the DDoS protection on the CDN
- DDoS protection mitigates volumetric attacks (e.g., overwhelming the server with traffic).
- CSRF is not a volumetric attack; it's a logic-based attack targeting application behavior.
- DDoS protection doesn't improve WAF logic for detecting forged requests.
- Irrelevant to fixing CSRF.
❌ 2. Install endpoint protection software on the VMs
- Endpoint protection (antivirus, EDR) secures the host OS from malware, not web application logic flaws.
- CSRF attacks don't execute code on the VM; they trick authenticated users' browsers into sending malicious requests.
- Doesn't help with WAF effectiveness.
❌ 3. Add an ACL to the VM subnet
- ACLs (Access Control Lists) filter network-layer traffic (IPs, ports).
- They can't inspect HTTP requests or understand application context (e.g., "is this a legitimate form submission or a forged one?").
- Network controls ≠ application controls.
❌ 4. Deploy an IDS on the IaaS network
- An Intrusion Detection System (IDS) logs/alerts on suspicious activity but doesn't block traffic (unless it's an IPS, which isn't mentioned here).
- Even if it detects the CSRF attempt, it won't stop the request from reaching the app.
- The WAF is already supposed to do this, but it's failing.
The Real Solution (Not Listed):
The engineer should:
- Review and Update WAF Rules:
- Ensure the WAF has CSRF-specific rules enabled (e.g., checking
Origin/Referer headers, validating anti-CSRF tokens).
- Update the WAF's OWASP CRS (Core Rule Set) to include CSRF protections.
- Verify Traffic Routing:
- Confirm that all traffic goes through the WAF/CDN and not directly to the VM's public IP.
- If attackers bypassed the WAF by hitting the VM directly, the WAF is irrelevant.
- Enable WAF Logging/Analytics:
- Investigate WAF logs to see why the attack wasn't blocked (e.g., rule misconfiguration, missing signatures).
- Force Anti-CSRF Tokens in the Application:
- Ensure the web app itself generates unique, session-bound tokens for state-changing requests (e.g., forms).
- The WAF can then enforce that tokens match the user's session.
Why?
If the WAF isn't blocking CSRF, it's because:
- The ruleset doesn't cover CSRF patterns.
- Traffic is bypassing the WAF (e.g., direct VM access).
- The application isn't generating proper anti-CSRF tokens.
In Summary:
None of the options (DDoS, endpoint protection, ACL, IDS) fix a WAF failing to block CSRF. The engineer must:
- Tune the WAF configuration.
- Lock down direct VM access (e.g., firewall rules to only allow CDN/WAF IPs).
- Enforce application-level CSRF defenses.
If forced to pick from the original list (though none are ideal), I'd reluctantly choose:
Add an ACL to the VM subnet
(Only because it could prevent direct VM access, forcing traffic through the WAF. But this is a workaround, not a fix for the WAF's failure to block CSRF.)
Proper Fix: Audit WAF rules + enforce app-level CSRF tokens.