Prompt
How to build monitoring and alerting around blocked web attacks
Latest observation
To build monitoring and alerting around blocked web attacks, focus on three things:
- Collect the right signals
- Detect meaningful patterns
- Route alerts with enough context to act quickly
Here’s a practical approach.
1) Define what “blocked web attacks” means in your environment
Start by identifying where attacks are blocked:
- WAF / CDN security layer
Example: Cloudflare, AWS WAF, Azure WAF, Fastly, Akamai - Reverse proxy / load balancer
Example: NGINX, ALB, Envoy - Application layer defenses
Example: auth throttling, CSRF validation, input validation, bot protection - IDS/IPS or edge firewall
- Application logs showing rejected requests
For each layer, capture:
- timestamp
- source IP / ASN / geo
- destination app / hostname / path
- rule ID / signature / policy name
- action taken: blocked, challenged, rate-limited, dropped
- request method, status code, user agent, referer
- request size / body size
- request count over time
- correlation ID / trace ID
2) Centralize logs and events
Send all security-relevant events to a central system:
- SIEM: Splunk, QRadar, Sentinel, Elastic Security
- Log platform: ELK/OpenSearch, Datadog, Grafana Loki
- Cloud-native: CloudWatch, Azure Monitor, GCP Logging
Normalize the fields so you can query across sources. A consistent schema helps a lot:
event_typeactionsrc_ipgeo_countryhosturi_pathrule_nameseverityrequest_id
3) Build baseline metrics
Before alerting aggressively, learn normal behavior.
Track:
- total blocked requests per minute/hour/day
- blocked requests by rule ID
- blocked requests by source IP
- blocked requests by path
- blocked requests by country/ASN
- blocked requests by host/service
- challenge/deny ratio
- top user agents
- top attackers by volume
Create dashboards for:
- Volume trends
- Top attack types
- Top targeted endpoints
- Geo/ASN distribution
- Rule effectiveness
- False positive trends
4) Alert on anomalies, not just raw counts
Raw count alerts are noisy. Better alerts use thresholds plus context.
Good alert patterns
- Spike in blocked traffic
- “Blocked requests > 5x baseline over 10 minutes”
- Single IP attack burst
- “One IP generated > 200 blocked requests in 5 minutes”
- Distributed attack
- “Blocked requests from > 50 unique IPs to same path”
- New attack vector
- “New WAF rule triggered on production login endpoint”
- Geo/ASN abnormality
- “Blocked traffic from a country never seen before”
- Rate-limit abuse
- “Many blocked requests followed by successful login attempts”
- Sensitive endpoint targeting
- Alerts for
/login,/admin,/api/auth,/wp-login.php, etc.
- Alerts for
5) Use severity tiers
Not every blocked attack should page someone.
Example:
- Info
- occasional blocked SQLi/XSS attempts
- Warning
- repeated attack from one IP or a small cluster
- High
- spike against production app, sensitive path, or widespread distributed probing
- Critical
- blocking rate surges with signs of service impact, bypass attempts, or successful exploitation after blocks
Route:
- Info → dashboard / ticket
- Warning → Slack / Teams
- High/Critical → pager/on-call
6) Add enrichment to alerts
Every alert should answer: “What happened, where, and how bad is it?”
Enrich with:
- threat intelligence reputation
- ASN / cloud provider / hosting provider
- known bot score
- geo location
- asset criticality
- service owner/team
- whether traffic is authenticated or anonymous
- whether the rule is known to be noisy
This reduces investigation time.
7) Correlate blocks with other signals
Blocked traffic becomes much more valuable when correlated with:
- 4xx/5xx spikes
- auth failures
- login attempts
- WAF bypass attempts
- cache misses
- CPU/load spikes
- latency increases
- unusual user sessions
- IDS alerts
- vulnerability scan findings
This helps distinguish:
- benign scanning
- internet background noise
- targeted recon
- active attack
- operational issues or false positives
8) Design useful alert logic
Here are some concrete rules:
Example: burst detection
- Trigger if
blocked_requests > baseline_mean + 3*stddev - Or
blocked_requests > 3x average for same hour/day
Example: repeated source
- Trigger if one source IP has:
> 100 blocked requests in 10 minutes- or hits
> 10 distinct endpoints
Example: distributed probing
- Trigger if:
> 25 unique IPs- targeting the same URI
- within 15 minutes
Example: sensitive endpoint attack
- Trigger if blocked requests target:
/admin/login/api/auth/*/wp-login.php/xmlrpc.php
Example: rule novelty
- Trigger if a new WAF rule ID appears in production
- Or if a rule suddenly jumps by 10x versus its normal rate
9) Minimize false positives
Blocked attacks can create alert fatigue.
Ways to reduce noise:
- exclude known scanners/internal testers
- whitelist trusted IP ranges
- suppress alerts for low-volume background scanning
- group by incident instead of by event
- alert only when multiple signals align
- compare against historical baseline for that time/day
- tune noisy WAF rules
10) Create response playbooks
For each alert type, define what to do.
Examples:
- confirm attack type and affected endpoint
- identify top source IPs / ASNs
- check whether any requests were successful
- inspect WAF rule hits and request samples
- block or rate-limit at edge if needed
- notify app owner if false positives are likely
- open incident if service impact is suspected
Include:
- who owns the service
- how to verify false positives
- how to temporarily relax a rule
- how to preserve evidence
11) Log enough request detail for investigation
For blocked requests, store:
- request headers
- URI and query string
- request body hash or sample
- matched rule
- response/action
- trace ID
- TLS fingerprint if available
- JA3/JA4 or bot score if your tooling supports it
Be careful with sensitive data:
- redact passwords, tokens, session IDs, PII
- restrict access to full payloads
- keep only hashes/samples where possible
12) Build dashboards for different audiences
Security operations
- alert volume
- top attack sources
- top signatures
- unresolved incidents
- attack trends over time
Application owners
- targeted endpoints
- false positives
- impact on auth flows
- region-based anomalies
Executives
- attack volume trend
- blocked vs allowed requests
- incidents affecting service
- high-level risk posture
13) Example alert matrix
| Condition | Severity | Action |
|---|---|---|
| Low-volume blocked probes | Info | dashboard only |
| Repeated blocked requests from one IP | Warning | Slack |
| Blocked spike on sensitive endpoint | High | pager |
| Distributed attack across many IPs | High | pager |
| Blocks + successful auth anomalies | Critical | incident response |
| New WAF rule causing many blocks | High | app/security review |
14) Sample metrics to track
blocked_requests_totalblocked_requests_by_ruleblocked_requests_by_source_ipblocked_requests_by_uriblocked_requests_by_countryblocked_requests_by_asnunique_attackersunique_targeted_endpointsblock_rate = blocked / total_requestsfalse_positive_ratemean_time_to_acknowledgemean_time_to_resolve
15) Recommended implementation stack
If you want a simple starting point:
- Ingest logs from WAF/reverse proxy/app
- Store in Elastic/OpenSearch or a SIEM
- Visualize in Grafana/Kibana
- Alert via SIEM rules, Prometheus/Alertmanager, or native cloud alerts
- Enrich with geo/IP reputation and asset metadata
- Route alerts to Slack/Teams/PagerDuty/Jira
16) Start with a few high-value alerts
If you’re beginning from scratch, implement these first:
- Spike in blocked traffic above baseline
- Repeated blocks from a single source
- Distributed attack on a sensitive endpoint
- New rule firing in production
- Blocked traffic correlated with login failures or 5xx spikes
These catch a lot of important activity without too much noise.
If you want, I can also provide:
- a sample SIEM query set
- a Prometheus/Grafana dashboard design
- or a concrete alert rule pack for Cloudflare/AWS WAF/NGINX.