<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chinonso Vivian Ojeri</title>
    <description>The latest articles on DEV Community by Chinonso Vivian Ojeri (@chinonsoviv).</description>
    <link>https://dev.to/chinonsoviv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3903602%2F0a52738b-f74f-423d-bc83-8f37b470274a.jpeg</url>
      <title>DEV Community: Chinonso Vivian Ojeri</title>
      <link>https://dev.to/chinonsoviv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chinonsoviv"/>
    <language>en</language>
    <item>
      <title>How i built a Real-Time Anomaly Detection Engine for Cloud Storage</title>
      <dc:creator>Chinonso Vivian Ojeri</dc:creator>
      <pubDate>Wed, 29 Apr 2026 06:00:56 +0000</pubDate>
      <link>https://dev.to/chinonsoviv/how-i-built-a-real-time-anomaly-detection-engine-for-cloud-storage-2m1f</link>
      <guid>https://dev.to/chinonsoviv/how-i-built-a-real-time-anomaly-detection-engine-for-cloud-storage-2m1f</guid>
      <description>&lt;p&gt;As part of my HNG DevSecOps task, I built a real-time anomaly detection engine to protect a Nextcloud instance from unusual traffic spikes and potential DDoS attacks.&lt;/p&gt;

&lt;p&gt;The goal was simple: monitor incoming traffic in real time, detect suspicious behavior automatically, and respond immediately before the server becomes overwhelmed.&lt;/p&gt;

&lt;p&gt;Instead of relying only on static thresholds, I wanted the system to learn normal traffic behavior and react intelligently when something abnormal happens.&lt;/p&gt;

&lt;p&gt;This project combines Python, Linux networking, statistical analysis, and system-level security automation.&lt;/p&gt;

&lt;p&gt;The “Brain” — Sliding Window Detection&lt;/p&gt;

&lt;p&gt;The first major part of the system is the sliding window.&lt;/p&gt;

&lt;p&gt;I used Python’s deque from the collections module because it is fast and efficient for handling real-time request logs.&lt;/p&gt;

&lt;p&gt;The idea is to maintain a moving 60-second window of traffic activity.&lt;/p&gt;

&lt;p&gt;Every new request gets added to the queue with its timestamp, and old requests outside the 60-second range are automatically removed.&lt;/p&gt;

&lt;p&gt;This allows the system to always know the current request rate without scanning old logs repeatedly.&lt;/p&gt;

&lt;p&gt;Example Logic:&lt;br&gt;
from collections import deque&lt;br&gt;
import time&lt;/p&gt;

&lt;p&gt;request_window = deque()&lt;/p&gt;

&lt;p&gt;def track_request():&lt;br&gt;
    current_time = time.time()&lt;br&gt;
    request_window.append(current_time)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while request_window and current_time - request_window[0] &amp;gt; 60:
    request_window.popleft()

return len(request_window)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This creates the “brain” of the detection engine by constantly calculating live traffic speed.&lt;br&gt;
And a lot more...&lt;/p&gt;

&lt;p&gt;This project taught me how modern security systems combine software engineering with system administration.&lt;/p&gt;

&lt;p&gt;I learned that defense is not just about preventionit is about detection, response, and automation.&lt;/p&gt;

&lt;p&gt;Building this anomaly detection engine showed me how DevSecOps bridges development and infrastructure security.&lt;/p&gt;

&lt;p&gt;Most importantly, it proved that even simple tools like Python and Linux can be used to build strong real-time protection systems when combined with the right design.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>monitoring</category>
      <category>python</category>
      <category>security</category>
    </item>
  </channel>
</rss>
