How I Built an Adaptive "Immune System" for Cloud Traffic
Wandile Ndlovu developed an adaptive defense system for cloud traffic that learns normal behavior and detects anomalies in real time. The system uses statistical analysis, sliding windows, and dynamic baselines to identify suspicious activity on a Nextcloud instance. It automatically enforces bans via iptables and provides real-time observability through a custom UI.
- ▪The system uses a time-based sliding window with Python's deque to track requests within the last 60 seconds.
- ▪It establishes a baseline of normal traffic by collecting 30 minutes of data and recalculating mean and standard deviation every minute.
- ▪Anomalies are detected using a Z-score greater than 3.0 or a 5x increase over baseline, with stricter thresholds for high error rates.
- ▪Banned IPs are managed through escalating iptables DROP rules and a backoff schedule ranging from 10 minutes to permanent bans.
- ▪A Flask-based UI provides real-time metrics including request rates, banned IPs, and system health.
DEV.to (Top) files mainly under programming. We currently carry 4,924 of its stories.
Story provenance
Source · retrieval · rights · ranking — open for full record
inspect →
Story provenance
Attribution is not the same as permission. This drawer separates discovery metadata, excerpts, WeSearch-generated summaries, reuse status, and whether the publisher receives the visit. Nothing here claims a legal grant the publisher has not made.
Record
| Original publisher | DEV.to (Top) |
| Canonical URL | https://dev.to/wandile_ndlovu_7dd22d4943/how-i-built-an-adaptive-immune-system-for-cloud-traffic-53b |
| Publication time | Wed, 29 Apr 2026 08:18:42 +0000 |
| Retrieval time | 2026-04-29T08:31:52.291Z |
| Last seen | 2026-04-29T08:31:52.291Z |
| Headline source | Publisher (no WeSearch rewrite) |
| Excerpt source | publisher body |
| Excerpt method | First ~120 words (~800 chars) of extracted publisher body, fair-use limited. |
| Summary | WeSearch · cerebras-chat (WeSearch summarizer) |
| Summary source text | contentText |
| Citation coverage | Summary is a WeSearch-generated derivative; primary citation is the original publisher URL. |
| Cluster | 9ViCac6qy5sw |
| Cluster logic | Grouped by semantic title/content similarity across sources within a rolling window. Same-publisher template collisions are excluded from coverage comparison. |
| Ranking reason | Story pages are not engagement-ranked. Hub feeds use recency, with optional source-diversified chronological ordering (cap consecutive stories per source). No personalized ranking. |
| Publisher visit | Yes — open original |
| Substitutes article? | No — link-out required for full text |
Rights status (four layers)
WeSearch handling by dimension
| Indexing | May the item be indexed (stored, ranked, made findable)? | Allowed |
| Snippet | May a short excerpt of the publisher's text be shown? | Allowed |
| AI summary | May WeSearch generate its own short summary of the article? | Limited |
| Retrieval / RAG | May the content be exposed for third-party retrieval-augmented generation? | Not asserted |
| Model training | May the content be used to train AI models? | Not asserted |
| Commercial reuse | May the content be reused commercially? | Not permitted |
Basis: Derived from the published RSS/Atom feed. Contact: [email protected]. Reviewed: 2026-07-24.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3666948) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Wandile Ndlovu Posted on Apr 29 How I Built an Adaptive "Immune System" for Cloud Traffic #programming #devops #security #cloud Recently, I was tasked with a challenge: Build an automated defense system for a live Nextcloud instance. The goal wasn't just to block "bad guys," but to build a system that actually learns what a normal day looks like and reacts when things get weird.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).