ThreatLens(Context Aware Network Intrusion Detection with Explainable Threat Intelligence)
create a ppt using this report which contains 10 slides that include aim of the project,problem state,emt,introduction,objective,tech stack,flow chart,architecture,featues and conclusion
ThreatLens(Context Aware Network Intrusion Detection with Explainable Threat Intelligence)
1.
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
“JNANASANGAMA”,MACHHE, BELAGAVI – 590018
A PROJECT PHASE I
SYNOPSIS ON
“ThreatLens”
Context-Aware Network Intrusion Detection
with Explainable Threat Intelligence
Bachelor of Engineering
Computer Science & Engineering
Submitted by:
Soumya Ranjan Nayak 1AJ23CS155
Tarun C 1AJ23CS167
Vyshnavi K R 1AJ23CS174
Veena Shree G 1AJ23CS179
Under the Guidance of
Prof. Varshini M
Assistant professor
Dept. of CSE, Cambridge Institute Of Technology North Campus
Cambridge Institute Of Technology North Campus
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Cambridge Institute Of Technology North Campus
KUNDANA, BENGALURU – 562110, KARNATAKA
2025 – 2026
2.
DECLARATION
We, Tarun(1AJ23CS167), SoumyaRanjan Nayak (1AJ23CS155), Vyshnavi K R(1AJ23CS174),
Veena Shree g(1AJ23CS179) hereby declare that the dissertation“ThreatLens – Context-Aware
Network Intrusion Detection System” has been completed and written by us under the supervision
of Varshini M , Assistant Professor, Department of Computer Science and Engineering, Cambridge
Institute of Technology North Campus, Kundana, Bengaluru, affiliated to Visvesvaraya Technolog-
ical University, Belagavi, during the academic year 2025 – 2026.
We affirm that this dissertation report is original and has not been submitted for the award of any
other degree or diploma in any university or institution.
Place:
Date:
Signature of the Candidates
Soumya Ranjan Nayak
Tarun C
Vyshnavi K.R
Veenashree G
3.
ACKNOWLEDGEMENT
The satisfaction andeuphoria that accompany a successful completion of any task would be incom-
plete without the mention of people who made it possible, success is the epitome of hard work and
perseverance, but steadfast of all is encouraging guidance. So, with gratitude we acknowledge all
those whose guidance and encouragement served as beacon of light and crowned the effort with
success.
We thank our beloved Principal Dr. Prasad Naik Hamsavath, for his constant help and support
throughout.
We are indebted to Management of Cambridge Institute of Technology for providing an environ-
ment which helped us in completing our project.
We sincerely thank, Dr Rajshekhar M Patil, HOD, Department of Computer Science and Engi-
neering, Cambridge Institute of Technology – North Campus who has been the constant driving
force behind the completion of the project.
We express our profound gratitude to our Guide, Prof. Varshini M, Assistant Professor, Department
of Computer Science and Engineering, Cambridge Institute of Technology – North Campus. We
will remember her contribution for ever.
We also extend our sincere appreciation to our Project Coordinator, Prof. Pushpa Reddy, Assistant
Professor, Department of Computer Science and Engineering, for his consistent encouragement, and
valuable academic inputs.
Also, we thank all the teaching and non-teaching staff of Department of Computer Science and
Engineering for the help rendered.
Soumya Ranjan Nayak
Tarun C
Vyshnavi K.R
Veenashree G
Abstract
Network security monitoringhas traditionally been the domain of expert security analysts operating
sophisticated, expensive toolchains. Existing open-source intrusion detection systems such as Snort
and Suricata rely on signature-based detection that fails against novel, zero-day attacks and produces
technical alert codes incomprehensible to non-expert users. Small teams, individual developers, and
resource-constrained organisations are left effectively unprotected.
ThreatLens is a context-aware network intrusion detection system (NIDS) built in the Go pro-
gramming language that addresses these limitations through four core innovations: (1) behavioural
anomaly detection using sliding window traffic analysis that identifies novel attacks without requir-
ing known signatures; (2) an attack pattern classifier that identifies port scans, DDoS amplification,
DNS tunnelling, ARP spoofing, and slow HTTP attacks from raw traffic patterns; (3) live threat in-
telligence enrichment via AbuseIPDB and VirusTotal APIs that contextualises every detected threat
with attacker reputation data; and (4) a human-readable threat narrative engine that explains ev-
ery detection in plain English with recommended remediation steps — a capability absent from all
existing open-source NIDS tools.
The system additionally provides automated iptables firewall response with full audit trail and
rollback, a WebSocket-connected live dashboard, and deploys as a single compiled binary with
zero runtime dependencies. This makes professional-grade network intrusion detection accessible
to any team regardless of security expertise or infrastructure budget.
Keywords: Network Intrusion Detection, Go Programming Language, Behavioural Anomaly De-
tection, Threat Intelligence, Packet Analysis, Firewall Automation, Cybersecurity.
9.
CHAPTER 1- INTRODUCTION
Introductionto Network Security and the Detection Gap
Network security is one of the most critical challenges facing modern software systems. Every
internet-connected server, application, and device is continuously exposed to a hostile global net-
work populated by automated scanners, botnets, exploit frameworks, and targeted attackers. The
consequences of a successful network intrusion range from data theft and ransomware deployment
to complete system compromise and prolonged service outages.
Despite this threat landscape, the tools available to detect and respond to network intrusions remain
deeply inaccessible to the vast majority of developers and system administrators. Professional-
grade security operations require dedicated Security Operations Centres (SOCs), full-time analysts,
expensive commercial tools such as Splunk SIEM or Palo Alto IDS, and deep expertise in net-
work protocols and attack methodologies. For the overwhelming majority of organisations — small
teams, startups, individual developers, and academic institutions — this level of capability is simply
unavailable.
The result is a significant and dangerous gap: organisations that host internet-facing services but
lack the budget or expertise for professional security monitoring are operating effectively blind to
the network threats targeting them daily. Existing open-source tools such as Snort, Suricata, and
Wireshark do exist but fail to bridge this gap because they require expert configuration, produce
cryptic alert codes incomprehensible to non-experts, and lack the contextual enrichment needed to
translate a detection into a concrete understanding of what is happening and what to do about it.
ThreatLens is designed to fill this gap: a network intrusion detection system that combines the per-
formance and concurrency advantages of the Go programming language with behavioural anomaly
detection, live threat intelligence enrichment, and a human-readable threat narrative engine to make
professional-grade network security accessible to any team.
Traditional Network Security Approaches and Their Limitations
Existing approaches to network intrusion detection suffer from several structural limitations that
ThreatLens is specifically designed to address:
1. Signature-Only Detection: Tools such as Snort and Suricata match network traffic against
databases of known attack patterns (signatures). Any novel attack — a zero-day exploit, a
custom malware variant, or a new scanning technique — has no signature and therefore passes
through undetected. This is a fundamental architectural limitation, not a configuration problem.
2. Cryptic Alert Output: Existing tools produce alerts in the form of rule identifiers and protocol
codes (e.g., ET SCAN Nmap Scripting Engine User-Agent Detected). A non-expert user
receiving this alert has no understanding of what it means, what risk it represents, or what action
to take. The alert is effectively useless without significant additional research.
3. Complex Configuration Requirements: Deploying Snort or Suricata in a meaningful config-
10.
uration requires hoursof setup, rule set management, and ongoing maintenance. This places
effective use beyond the reach of teams without dedicated security staff.
4. No Threat Context Enrichment: Existing tools report that a suspicious IP was detected, but
provide no information about who that IP belongs to, whether it is a known malicious actor,
or whether it has been reported by other victims. This context is essential for triage but absent
from all major open-source NIDS.
5. Fragmented Toolchain: Achieving even basic network security requires combining a packet
capturer, a rule engine, a threat intelligence feed, a dashboard, and a firewall manager — five
separate tools with different configuration formats, data models, and failure modes. There is no
unified, single-binary solution for individuals or small teams.
6. No Automated Response with Rollback: Most open-source IDS tools are detection-only. Au-
tomated blocking requires integration with separate firewall management tools. Critically, there
is no standard mechanism for auditing and rolling back automated firewall actions — a danger-
ous gap in production environments.
Role of Go in High-Performance Network Security Tools
The Go programming language (Golang) is uniquely well-suited to network security tooling for
several reasons that directly inform the design of ThreatLens:
1. Native Concurrency: Go’s goroutine model enables handling thousands of concurrent network
connections and packet processing tasks without the thread pool complexity of Java or the call-
back pyramid of Node.js. Each packet stream, each connected dashboard client, and each threat
intelligence lookup can be handled as an independent goroutine.
2. Near-C Performance: Go compiles to native machine code with performance approaching C
and C++ for I/O-intensive tasks such as packet processing. This is essential for a tool that must
process packet streams at line rate without dropping events.
3. Single Binary Deployment: Go programs compile to a single self-contained binary with no
external runtime dependencies. ThreatLens can be deployed to any Linux system by copying a
single file — no Python virtual environment, no JVM, no dependency installation required.
4. Strong Standard Library: Go’s net package provides low-level TCP/UDP access; net/http
provides a production-grade HTTP server for the dashboard; os/exec provides clean subpro-
cess management for iptables integration. These capabilities are available without any exter-
nal dependencies.
5. Memory Safety: Unlike C and C++, Go provides garbage collection and memory safety guar-
antees. This eliminates entire classes of security vulnerabilities (buffer overflows, use-after-free)
that are endemic in network tooling written in C.
6. Industry Validation: Docker, Kubernetes, Terraform, Prometheus, and CockroachDB — the
defining infrastructure tools of modern computing — are all written in Go. This demonstrates
the language’s fitness for exactly the class of systems-level, high-concurrency problems that
ThreatLens addresses.
11.
Need for Human-ReadableThreat Intelligence
The single most important innovation in ThreatLens — and the feature that most clearly differenti-
ates it from all existing open-source alternatives — is its human-readable threat narrative engine.
Every network intrusion detection system in existence today, both commercial and open-source,
communicates detections as technical artifacts: IP addresses, port numbers, protocol identifiers, and
rule codes. This is appropriate for trained security analysts but creates a complete comprehension
barrier for the vast majority of system operators.
When ThreatLens detects a port scan, it does not merely log ALERT: SYN flood from 192.168.1.42
on 847 ports. It generates a structured narrative such as: “A device at 192.168.1.42, previously
reported for abuse on AbuseIPDB with a confidence score of 87%, probed 847 ports on your ma-
chine in 3.2 seconds. This is a classic reconnaissance pattern — the attacker is mapping running
services before selecting an attack vector. Your SSH port (22) and PostgreSQL port (5432) were
both probed and are open. Recommended action: block this IP immediately and consider relocat-
ing SSH to a non-standard port to reduce automated scanner exposure.”
This narrative is useful to a developer with no security training. It explains what happened, why
it is concerning, what specific risks exist on this system, and what action to take. This is the gap
ThreatLens fills.
Aim of the Project
The primary aim of this project is to design, develop, and implement ThreatLens: a context-aware
network intrusion detection system in Go that captures raw network traffic, performs both signature-
based and behavioural anomaly detection, enriches detections with live threat intelligence, generates
human-readable threat narratives, provides automated firewall response with audit trail and rollback,
and presents all information through a WebSocket-connected live web dashboard — deployed as a
single self-contained binary.
Problem Statement
Small teams, individual developers, and resource-constrained organisations operating internet-facing
services lack access to effective, usable network intrusion detection. Existing open-source tools
require expert configuration, produce cryptic output that is incomprehensible without security train-
ing, detect only known attack patterns (missing novel threats), and provide no actionable context or
integrated automated response. There is a critical need for a system that:
1. Captures and analyses raw network traffic at the packet level across all major protocols (TCP,
UDP, DNS, HTTP, ARP).
2. Detects both known attack signatures and novel behavioural anomalies without requiring pre-
configured rule sets.
3. Classifies detected threats into specific attack categories (port scan, DDoS, DNS tunnelling,
12.
ARP spoofing, slowHTTP).
4. Enriches every detection with live attacker reputation data from threat intelligence APIs.
5. Generates plain-English threat narratives with specific risk assessment and remediation recom-
mendations.
6. Provides automated iptables firewall blocking with full audit trail and one-command rollback.
7. Presents all information through an accessible live web dashboard requiring no specialised
knowledge to interpret.
8. Deploys as a single binary on any Linux system with no external dependencies or complex
configuration.
Objectives of the Project
The specific objectives of this project are:
1. To design and implement a raw packet capture and protocol parsing engine in Go using gopacket
and libpcap.
2. To develop a behavioural anomaly detection engine using per-source sliding window traffic
counters to identify novel attacks without signature matching.
3. To implement an attack pattern classifier for port scans, DDoS amplification, DNS tunnelling,
ARP spoofing, and slow HTTP attacks.
4. To integrate live threat intelligence enrichment via AbuseIPDB and VirusTotal APIs for detected
source IPs.
5. To build a human-readable threat narrative engine generating plain-English attack descriptions
with remediation steps.
6. To implement automated iptables firewall rule injection with complete audit trail and rollback
capability.
7. To develop a WebSocket-connected live web dashboard for real-time threat monitoring.
8. To architect the complete system as a single compiled Go binary with zero runtime dependen-
cies.
9. To validate the system through functional testing, performance benchmarking, and comparison
against existing NIDS solutions.
10. To document the complete system design, architecture, implementation, and results for knowl-
edge transfer and future extension.
CHAPTER 2- LITERATURE REVIEW
Overview
This chapter presents a comprehensive review of existing literature on network intrusion detection
systems, behavioural anomaly detection, threat intelligence systems, and Go-based network tooling.
The review examines existing tools, academic research, system architectures, and identifies the spe-
cific gaps that ThreatLens addresses. Literature is organised thematically across intrusion detection
13.
paradigms, threat intelligenceintegration, human factors in security tooling, and the application of
Go in network security.
Network Intrusion Detection Systems
9.1 Signature-Based Detection: Snort and Suricata
Snort, originally developed by Sourcefire (now Cisco) and first released in 1998, remains the most
widely deployed open-source NIDS. Snort operates by matching network packets against a rule
database maintained by the Snort community and commercial rule providers. Each rule specifies
protocol, source and destination addresses and ports, and pattern matching criteria. When a packet
matches a rule, an alert is generated.
Suricata, developed by the Open Information Security Foundation (OISF) and released in 2010,
extends the Snort model with multi-threaded processing, GPU acceleration, and native support for
JSON-format output. Suricata is compatible with Snort rule sets and has largely supplanted Snort
in new enterprise deployments.
Both systems share the fundamental limitation of signature-based detection: they are inherently
reactive. Detection requires that an attack pattern has been previously observed, documented, and
incorporated into a rule set. Novel attacks, custom exploits, and zero-day vulnerabilities have no
corresponding rule and therefore generate no alert. Research by Sommer & Paxson (2010) demon-
strated that signature-based NIDS miss a substantial proportion of novel attacks precisely because
of this dependency on prior knowledge.
9.2 Anomaly-Based Detection
Anomaly-based intrusion detection addresses the fundamental limitation of signature systems by
learning a model of “normal” network behaviour and flagging deviations from that baseline. Den-
ning (1987) proposed the foundational theoretical model for anomaly detection in computer sys-
tems, establishing the conceptual basis that forms the underpinning of ThreatLens’s behavioural
detection engine.
Subsequent work by Lakhina et al. (2004) demonstrated that traffic volume anomalies — sudden
changes in packet rate, flow count, or byte volume — are reliable indicators of scanning, DDoS,
and worm propagation activity. This finding directly informs ThreatLens’s sliding window anomaly
detector, which tracks per-source packet rate and flags statistically significant deviations.
Garcia-Teodoro et al. (2009) provide a comprehensive survey of anomaly detection techniques,
classifying them into statistical methods, machine learning approaches, and knowledge-based sys-
tems. ThreatLens implements a statistical sliding window approach, which the authors identify
as computationally efficient and suitable for high-speed packet processing — consistent with Go’s
performance characteristics.
14.
9.3 Hybrid DetectionApproaches
Recent research has moved toward hybrid systems that combine signature and anomaly detection.
Axelsson (2000) demonstrated that hybrid systems consistently outperform either approach in iso-
lation, detecting more true positives while maintaining manageable false positive rates. ThreatLens
implements a hybrid approach: the attack pattern classifier provides signature-like categorical de-
tection (port scan, ARP spoof), while the sliding window anomaly detector provides statistical de-
tection of novel high-volume attacks.
Threat Intelligence Integration
10.1 IP Reputation Systems
IP reputation systems maintain continuously updated databases of known malicious IP addresses,
derived from honeypot reports, abuse notifications, and security research. AbuseIPDB, the primary
threat intelligence source integrated in ThreatLens, aggregates abuse reports from a global com-
munity of network operators and provides an API returning confidence scores for any queried IP
address.
Research by Ramachandran & Feamster (2006) established that a significant proportion of spam
(and by extension, other network abuse) originates from a relatively stable set of IP ranges, and that
IP reputation data is a highly effective filter. This finding validates the integration of AbuseIPDB
enrichment in ThreatLens’s detection pipeline.
10.2 Threat Intelligence Platforms
VirusTotal, a subsidiary of Google, aggregates analysis from over 70 antivirus engines and URL/domain
scanning services. While primarily a file and URL analysis platform, VirusTotal’s IP address
lookup functionality provides valuable context about historical activity associated with a source
IP. ThreatLens integrates the VirusTotal API to augment AbuseIPDB reputation data with broader
threat context.
Human Factors in Security Operations
11.1 Alert Fatigue and Comprehensibility
A substantial body of research in security operations identifies alert fatigue and alert incomprehen-
sibility as the primary causes of detection failure in practice. Sommer & Paxson (2010) documented
that the majority of IDS alerts in operational deployments are either false positives or, when genuine,
are too cryptic to be actionable without significant analyst investigation.
Julisch (2003) estimated that analysts in operational SOCs spend up to 95% of their time investi-
gating alerts that turn out to be false positives or irrelevant, representing a profound waste of skilled
human time. This research directly motivates ThreatLens’s threat narrative engine: by providing
15.
immediate context andclear remediation guidance, ThreatLens eliminates the investigation burden
for non-expert users.
11.2 Security Tool Accessibility
Botta et al. (2012) conducted a usability study of network security tools, finding that the primary
barrier to adoption among small organisations was not cost but comprehensibility: non-expert users
lacked the security knowledge to interpret tool output and translate it into action. This finding is
central to ThreatLens’s design philosophy and validates the investment in human-readable output
as the project’s primary differentiator.
Go for Network Security Tooling
12.1 Go’s Suitability for Network Applications
The Go programming language was specifically designed at Google to address the challenges of
large-scale network service development. Donovan & Kernighan (2015) provide a comprehensive
treatment of Go’s design, highlighting goroutines and channels as the language’s most distinctive
contribution: a concurrency model that makes writing correct concurrent network code significantly
simpler than thread-based alternatives.
For packet processing specifically, Go’s gopacket library (maintained by Google) provides effi-
cient, type-safe access to raw network packets. The library supports all major protocols including
Ethernet, IP, TCP, UDP, DNS, and ARP, which are the protocol layers most relevant to ThreatLens’s
detection scope.
12.2 Existing Go-Based Security Tools
Several significant security tools have been implemented in Go, validating the language’s fitness for
this domain:
• Nuclei (ProjectDiscovery): A fast, template-based vulnerability scanner processing thousands
of targets per second.
• Subfinder (ProjectDiscovery): A subdomain discovery tool leveraging Go’s concurrency for
parallel DNS resolution.
• Wazero: A production-grade WebAssembly runtime with zero CGO dependencies, demonstrat-
ing Go’s capability for systems-level work.
• Cilium: eBPF-based Kubernetes networking and security, with its control plane written in Go.
ThreatLens builds on this tradition, applying Go’s strengths to the specific problem of real-time
packet analysis with contextual threat intelligence.
16.
Research Gaps Identified
Basedon the comprehensive literature review, the following specific gaps exist in current network
intrusion detection research and tooling:
1. No Human-Readable Narrative Output: No existing open-source NIDS generates plain-
English threat explanations with remediation guidance accessible to non-expert users.
2. Signature-Only Limitation: The dominant open-source tools (Snort, Suricata) remain purely
signature-based, leaving organisations vulnerable to novel attacks.
3. Absent Threat Intelligence Integration: No major open-source NIDS natively integrates real-
time IP reputation enrichment into the detection and alert pipeline.
4. No Unified Single-Binary Solution: All existing open-source solutions require multi-component
installation, configuration, and maintenance.
5. No Integrated Audited Firewall Response: Automated blocking with audit trail and rollback
is absent from open-source tooling.
6. Accessibility Gap: No existing tool targets the non-expert user segment despite this represent-
ing the largest population of unprotected system operators.
Positioning of ThreatLens
ThreatLens directly addresses each identified gap:
1. Human-Readable Narratives: The threat narrative engine generates plain-English attack de-
scriptions, risk assessments, and remediation steps for every detection.
2. Behavioural + Signature Detection: Sliding window anomaly detection combined with attack
pattern classification provides hybrid coverage.
3. Native Threat Intelligence Integration: AbuseIPDB and VirusTotal enrichment is built into
the detection pipeline, not bolted on as a separate tool.
4. Single Binary: Go’s compilation model delivers a zero-dependency single-file deployment.
5. Integrated Audited Response: iptables automation with full audit trail and rollback is a core
system component.
6. Non-Expert Target User: Every design decision prioritises accessibility for developers and
small teams without security backgrounds.
CHAPTER 3- METHODOLOGY
Overview
This chapter presents the detailed methodology employed in the design and implementation of
ThreatLens. The system architecture, working principles, data flow mechanisms, detection algo-
rithms, and implementation approach are explained comprehensively. The chapter describes how
the packet capture engine, detection pipeline, threat intelligence enrichment, narrative engine, fire-
17.
wall automation, andlive dashboard integrate into a cohesive, single-binary network intrusion de-
tection system.
System Architecture
16.1 Overall System Design
ThreatLens follows a layered pipeline architecture consisting of five primary processing stages:
1. Capture Layer: Raw packet capture from the network interface using gopacket and libpcap.
Packets are decoded at Ethernet, IP, TCP, UDP, DNS, and ARP layers.
2. Detection Layer: Two parallel detection engines process decoded packets: (a) the behavioural
anomaly detector using per-source sliding window counters, and (b) the attack pattern classifier
identifying specific attack categories from traffic signatures.
3. Enrichment Layer: Confirmed detections are enriched with live threat intelligence via Abu-
seIPDB and VirusTotal API calls executed concurrently in separate goroutines.
4. Narrative Layer: Enriched detection records are passed to the threat narrative engine, which
generates structured plain-English alert objects containing attack description, risk assessment,
and remediation recommendations.
5. Response and Presentation Layer: Narrative alerts trigger: (a) optional automated iptables
rule injection for high-confidence detections, logged with full audit trail; (b) WebSocket broad-
cast to the live dashboard; (c) local persistence to the embedded database.
The system operates as a continuous streaming pipeline where:
• The packet capture goroutine reads raw frames and pushes decoded packet structs to a buffered
channel.
• The detection goroutines consume from this channel concurrently, maintaining per-source state
in thread-safe sliding window structures.
• Detections trigger goroutine-isolated enrichment calls to external APIs with configurable time-
outs.
• The narrative engine assembles final alert objects from enriched detection records.
• The dashboard server maintains active WebSocket connections and broadcasts alert objects to
all connected clients in real time.
16.2 System Component Overview
Working Principle
17.1 Packet Capture and Decoding
Packet capture follows this processing path:
Step 1: Interface Initialisation
18.
Component Function
capture.go Rawpacket capture using gopacket/libpcap; protocol
decoding
detector.go Sliding window anomaly detection; per-source traffic
state tracking
classifier.go Attack pattern classification (port scan, DDoS, DNS
tunnel, ARP spoof, slow HTTP)
enricher.go Concurrent AbuseIPDB and VirusTotal API enrich-
ment
narrator.go Plain-English threat narrative generation with reme-
diation steps
firewall.go iptables rule injection, audit logging, and rollback
management
dashboard.go HTTP server + WebSocket broadcast for live dash-
board
store.go bbolt embedded database for alert history and blocked
IP registry
main.go CLI entry point via Cobra; goroutine orchestration;
graceful shutdown
Table 1: ThreatLens Source Module Functions
• pcap.OpenLive(iface, 65535, true, pcap.BlockForever) opens the specified network
interface in promiscuous mode.
• A gopacket.PacketSource is created from the pcap handle with Ethernet link type.
• A buffered packet channel (capacity 10,000) is initialised for the detection goroutines.
Step 2: Packet Decoding
• Each captured frame is decoded through the protocol stack: Ethernet → IP → TCP/UDP/ICMP.
• For TCP packets: source/destination IP, port numbers, TCP flags (SYN, ACK, RST, FIN) are
extracted.
• For UDP packets: source/destination IP, port numbers, payload length are extracted.
• For DNS packets: query names, record types, and payload size are extracted.
• For ARP packets: sender MAC, sender IP, target IP are extracted.
Step 3: Channel Dispatch
• Decoded packet metadata structs are pushed to the shared channel.
• Detection goroutines consume packets concurrently from this channel.
• Buffer prevents packet loss during temporary detection processing spikes.
17.2 Behavioural Anomaly Detection
The anomaly detection engine maintains per-source sliding window state:
type SourceState struct {
19.
mu sync.Mutex
packets []time.Time
portsmap[uint16]bool
firstSeen time.Time
windowSize time.Duration
threshold int
}
ON packet received from source IP:
LOCK source state mutex
APPEND current timestamp to packets ring
EVICT timestamps older than windowSize
ADD destination port to ports set
IF len(packets) > threshold:
EMIT volume_anomaly detection event
IF len(ports) > PORT_SCAN_THRESHOLD:
EMIT port_scan detection event
UNLOCK mutex
Key design decisions:
• Per-source state is stored in a sync.Map keyed by source IP, enabling concurrent access from
multiple detection goroutines without a global lock.
• Sliding window eviction uses a sorted timestamp slice with binary search for efficiency.
• Thresholds are configurable via the CLI and config file.
• State is periodically checkpointed to the embedded database for recovery on restart.
17.3 Attack Pattern Classification
The classifier identifies specific attack categories from packet characteristics:
Attack Type Detection Logic
Port Scan Source contacts > N unique destination ports within win-
dow; SYN-only packets (no ACK) dominate
DDoS Amplification Inbound UDP traffic volume spike from > M unique
sources simultaneously within 10-second window
DNS Tunnelling DNS query payload > 100 bytes, or query name entropy >
4.5 bits/character
ARP Spoofing ARP reply where sender IP already mapped to different
MAC in ARP table
Slow HTTP Attack TCP connection to port 80/443 maintained open for > 30
seconds with < 1 byte/second throughput
Table 2: Attack Pattern Classification Logic
20.
17.4 Threat IntelligenceEnrichment
Enrichment is performed asynchronously to avoid blocking the detection pipeline:
• Each detection event spawns an enrichment goroutine with a 5-second context timeout.
• Two concurrent API calls are made: AbuseIPDB /check endpoint and VirusTotal /ip_addresses/{ip}
endpoint.
• Results are awaited via a sync.WaitGroup and merged into the detection record.
• API calls are rate-limited using a token bucket to respect free tier API limits.
• Failed or timed-out API calls are logged and the detection proceeds without enrichment rather
than blocking.
The AbuseIPDB response provides:
• abuseConfidenceScore (0–100): percentage confidence that the IP is malicious.
• totalReports: number of abuse reports submitted by the community.
• usageType: ISP, datacenter, VPN, Tor exit node, residential, etc.
• countryCode: geolocation of the IP.
The VirusTotal response provides:
• last_analysis_stats: counts of malicious, suspicious, and clean verdicts from 70+ engines.
• reputation: community-derived reputation score.
• network: ASN and organisation name of the IP’s network block.
17.5 Threat Narrative Generation
The narrative engine assembles a structured Alert object from the enriched detection record:
type Alert struct {
Timestamp time.Time
SourceIP string
AttackType string
Severity string
WhatHappened string
WhyDangerous string
AssetsAtRisk []string
ThreatContext string
Recommendation string
AutoBlocked bool
RollbackCmd string
}
Narrative text is assembled from structured templates parameterised by attack type, severity, enrich-
21.
ment data, andsystem context. The AssetsAtRisk field is populated by cross-referencing probed
ports against a local service scan result cached at startup.
17.6 Automated Firewall Response
For detections with severity HIGH or CRITICAL and AbuseIPDB confidence > 75:
• iptables -I INPUT 1 -s {ip} -j DROP is executed via os/exec with privilege validation.
• The rule insertion is logged to the audit database with: timestamp, source IP, triggering alert ID,
applied rule, and the exact rollback command (iptables -D INPUT -s {ip} -j DROP).
• The dashboard displays the automated action with a one-click unblock button.
• A CLI command ThreatLens unblock –ip {ip} executes the logged rollback command.
• All automated actions are reversible; no permanent firewall configuration changes are made.
Data Flow Mechanism
The complete data flow from packet capture to dashboard presentation:
1. Network interface → libpcap → gopacket decode → packet channel.
2. Packet channel → anomaly detector (sliding window state update) → detection event (if thresh-
old crossed).
3. Packet channel → pattern classifier (stateless per-packet analysis) → detection event (if pattern
matched).
4. Detection event → enrichment goroutine (AbuseIPDB + VirusTotal API) → enriched detection
record.
5. Enriched record → narrative engine → structured Alert object.
6. Alert object → bbolt database (persist) + WebSocket broadcast (live dashboard) + firewall au-
tomation (if threshold met).
Implementation Approach
19.1 Project Structure
ThreatLens/
|--- cmd/
| ‘--- root.go
|--- internal/
| |--- capture/
| | ‘--- capture.go
| |--- detect/
| | |--- anomaly.go
| | ‘--- classify.go
22.
| |--- enrich/
|| ‘--- enricher.go
| |--- narrate/
| | ‘--- narrator.go
| |--- firewall/
| | ‘--- firewall.go
| |--- dashboard/
| | ‘--- server.go
| ‘--- store/
| ‘--- store.go
|--- web/
| |--- index.html
| ‘--- app.js
|--- config/
| ‘--- config.go
|--- main.go
‘--- go.mod
19.2 Development Phases
Phase 1: Packet Capture Foundation
• Implement capture.go with gopacket integration.
• Verify protocol decoding for TCP, UDP, DNS, ARP.
• Establish packet channel architecture and goroutine lifecycle management.
Phase 2: Detection Engines
• Implement sliding window anomaly detector with per-source state.
• Implement attack pattern classifier for all five attack categories.
• Unit test both engines with synthetic packet streams.
Phase 3: Threat Intelligence Integration
• Implement AbuseIPDB and VirusTotal API clients with rate limiting.
• Implement async enrichment goroutine pattern with context timeout.
• Integration test with real API calls against known malicious IPs.
Phase 4: Narrative Engine and Alert Structure
• Design Alert struct covering all detection and enrichment fields.
• Implement narrative template engine for all five attack categories.
• Validate narrative quality across diverse test detection scenarios.
Phase 5: Firewall Automation
23.
• Implement iptablesrule injection with privilege validation.
• Implement audit logging to bbolt with rollback command storage.
• Test rollback functionality under various firewall states.
Phase 6: Dashboard
• Implement Go HTTP server serving embedded static dashboard files.
• Implement WebSocket hub with goroutine-safe broadcast.
• Implement Chart.js real-time packet rate and alert history charts.
• Test dashboard with simulated alert streams.
Phase 7: Integration and Performance Testing
• End-to-end integration testing of complete detection pipeline.
• Performance benchmarking at simulated traffic loads of 10k, 50k, and 100k packets/second.
• Comparison testing against Snort on identical traffic captures.
Safety and Reliability Considerations
Privilege Management:
• Packet capture requires root/CAP_NET_RAW privilege; validated at startup with a clear error
message if absent.
• iptables automation requires root; firewall module validates privilege independently and logs
all actions.
• The dashboard HTTP server can run without root on ports above 1024.
Graceful Shutdown:
• SIGINT and SIGTERM handlers flush in-flight detections and close the pcap handle cleanly.
• WebSocket connections receive a close frame before server shutdown.
• bbolt database transactions are committed before process exit.
API Failure Resilience:
• All external API calls are wrapped with context timeouts (5 seconds default).
• Failed enrichment calls log the error and allow the detection to proceed without enrichment.
• Rate limiter prevents API quota exhaustion; gracefully degrades to unenriched alerts when limits
are reached.
CHAPTER 4- HARDWARE AND SOFTWARE COMPONENTS
Overview
This chapter provides comprehensive specifications for all software components, libraries, APIs,
and deployment requirements of ThreatLens. As a pure software system, ThreatLens has no cus-
24.
tom hardware components;however, it has well-defined system requirements and integrates with
operating system facilities (iptables, libpcap) that are documented here.
System Requirements
22.1 Hardware Requirements
Parameter Specification
CPU x86_64 or ARM64; minimum 2 cores recommended
RAM Minimum 512MB; 1GB+ recommended for high-
traffic environments
Storage Minimum 1GB for binary, database, and logs
Network Interface Any Linux-supported NIC with libpcap support
Table 3: Hardware Requirements
22.2 Operating System Requirements
Requirement Specification
OS Linux (kernel 4.0+); Ubuntu 20.04+ recommended
libpcap libpcap-dev 1.9+ (packet capture)
iptables iptables 1.8+ (firewall automation; optional)
Privileges CAP_NET_RAW or root for packet capture
Table 4: Operating System Requirements
Programming Language: Go
Parameter Detail
Language Go (Golang)
Version Go 1.22 or later
Compilation Compiles to single static binary; no runtime depen-
dencies
Concurrency Model Goroutines and channels
Memory Management Garbage collected with sub-millisecond pause times
Why Selected Single binary deployment, goroutine concurrency,
near-C packet processing performance, strong stan-
dard library, memory safety
Table 5: Programming Language Specification
External Go Libraries
Go Standard Library Components
The following Go standard library packages are used extensively:
25.
Library Version Purpose
google/gopacketv1.1.19 Raw packet capture, protocol decoding
(Ethernet, IP, TCP, UDP, DNS, ARP)
gorilla/websocket v1.5.1 WebSocket server for live dashboard real-
time push
spf13/cobra v1.8.0 CLI framework for commands, subcom-
mands, and flags
spf13/viper v1.18.0 Configuration file loading (YAML/JSON)
and flag binding
gin-gonic/gin v1.9.1 HTTP router for dashboard REST API
endpoints
etcd-io/bbolt v1.3.8 Embedded key-value database for alert
history and audit log
uber-go/zap v1.26.0 High-performance structured logging
golang.org/x/time latest Token bucket rate limiter for API calls
Table 6: External Go Library Dependencies
Package Usage in ThreatLens
net/http HTTP server for dashboard; REST API handler registration
net IP address parsing; protocol-level utilities
os/exec iptables command execution for firewall automation
sync Mutex, RWMutex, WaitGroup, Once for goroutine coordi-
nation
context Request-scoped timeout and cancellation for API calls
encoding/json JSON marshalling/unmarshalling for API responses and
alert objects
time Sliding window timestamp management; ticker-based peri-
odic tasks
math Shannon entropy calculation for DNS tunnelling detection
embed Embedding dashboard HTML/JS/CSS into the binary at
compile time
crypto/tls TLS configuration for HTTPS dashboard (optional)
Table 7: Go Standard Library Usage
External APIs
26.1 AbuseIPDB API
26.2 VirusTotal API
Frontend Dashboard Technologies
The dashboard frontend is compiled into the Go binary at build time using Go’s embed package,
eliminating the need for a separate static file server or CDN.
26.
Parameter Detail
Provider AbuseIPDB(https://www.abuseipdb.com)
Endpoint Used GET /api/v2/check?ipAddress={ip}&maxAgeInDays=90
Authentication API key via Key HTTP header
Free Tier Limit 1,000 checks per day
Response Fields Used abuseConfidenceScore, totalReports,
usageType, countryCode, isTor
Timeout 5 seconds (configurable)
Table 8: AbuseIPDB API Specification
Parameter Detail
Provider VirusTotal (https://www.virustotal.com)
Endpoint Used GET /api/v3/ip_addresses/{ip}
Authentication API key via x-apikey HTTP header
Free Tier Limit 500 requests per day; 4 requests per minute
Response Fields Used last_analysis_stats, reputation, network,
as_owner
Timeout 5 seconds (configurable)
Table 9: VirusTotal API Specification
Technology Version Usage
HTML5 / CSS3 — Dashboard layout and styling
Vanilla JavaScript ES2020 WebSocket client; DOM manipulation
Chart.js 4.4.0 Real-time packet rate line chart; alert
severity distribution chart
WebSocket API Native browser Live alert stream from Go dashboard
server
Table 10: Frontend Dashboard Technology Stack
Database: SQLITE
Complete Tech Stack Summary
CHAPTER 5- RESULTS AND ANALYSIS
Overview
This chapter presents the implementation results of ThreatLens, including detection accuracy, re-
sponse latency, threat intelligence enrichment effectiveness, dashboard performance, narrative qual-
ity assessment, and comparison against existing NIDS solutions. The system was tested using a
combination of synthetic traffic generation, real network captures, and controlled attack simula-
tions.
27.
Layer Technology WhyThis Choice
Language Go 1.22+ Simple to learn, fast performance, han-
dles multiple tasks at once using gorou-
tines
Packet Capture gopacket + libpcap Standard library for reading raw network
packets in Go
CLI Cobra Easy command-line interface framework
for Go — handles flags and commands
cleanly
Frontend React + CSS Popular, beginner-friendly UI library;
component-based structure makes dash-
board easy to build
Real-Time Comms WebSocket (native
browser API)
Sends live alerts from server to browser
instantly without refreshing the page
Backend Server Go net/http Built into Go — no extra framework
needed to serve the React app and handle
API requests
Database SQLite Simple file-based database, no server
setup required — stores alerts and
blocked IP history
Threat Intel APIs AbuseIPDB + Virus-
Total
Free APIs that tell us if a detected IP has
been reported for malicious activity be-
fore
Firewall Control iptables via os/exec Standard Linux tool to block suspicious
IPs; Go triggers it automatically when a
threat is found
Table 11: ThreatLens Technology Stack
System Implementation
31.1 Build and Deployment
ThreatLens was successfully implemented across all planned modules. The final binary statistics:
• Binary size: 18.4MB (single file, includes embedded dashboard assets).
• Build time: 4.2 seconds on a 4-core development machine.
• External runtime dependencies: zero.
• Startup time from binary execution to first packet processed: 380ms.
• Lines of Go code (excluding tests): approximately 4,200 lines across 9 modules.
The binary was tested on Ubuntu 22.04 LTS (x86_64) and Raspberry Pi OS Bookworm (ARM64),
confirming cross-platform compilation with no changes to source code.
28.
Detection Performance
32.1 PortScan Detection
Port scan detection was validated using nmap in several scanning modes against the test system:
Scan Type Ports Probed Detected? Time to Alert
TCP SYN scan (-sS) 1,000 Yes 1.8s
TCP connect scan (-sT) 1,000 Yes 2.1s
UDP scan (-sU) 500 Yes 4.3s
Service version scan (-sV) 100 Yes 0.9s
Slow scan (–scan-delay
5s)
100 Yes 42s
Table 12: Port Scan Detection Results
All five scan types were detected. The slow scan (5-second inter-probe delay) was detected within
the 60-second sliding window by accumulating the probed port count.
32.2 DDoS Detection
Simulated DDoS traffic was generated using hping3 and a custom Go traffic generator:
• SYN flood from single source: Detected at 4,200 packets/minute (threshold: 5,000). Alert
generated in 12 seconds.
• UDP flood from 50 simulated sources: Detected via multi-source volume anomaly in 8 seconds.
• ICMP flood: Detected in 6 seconds.
• False positive rate on legitimate bursty traffic (web server under load): 0% across 10 load test
runs.
32.3 DNS Tunnelling Detection
DNS tunnelling was simulated using iodine (a real DNS tunnelling tool):
• Active iodine tunnel: Detected in 3.2 seconds via entropy analysis and payload size.
• Shannon entropy of DNS names in tunnel traffic: 4.8 bits/char (threshold: 4.5).
• Average DNS query payload in tunnel: 187 bytes (threshold: 100 bytes).
• False positive rate on legitimate DNS traffic (Google, Cloudflare): 0%.
32.4 ARP Spoofing Detection
ARP spoofing was simulated using arpspoof:
• MAC-IP conflict detection: All spoofing attempts detected within 1 packet of the first spoofed
ARP reply.
• Time to alert from spoof initiation: < 500ms.
29.
• False positiveson DHCP lease renewals: 0% (DHCP renewal creates a new mapping, not a
conflict).
32.5 Slow HTTP Attack Detection
Slow HTTP attacks were simulated using slowhttptest:
• Slowloris mode: Detected in 31 seconds (threshold: 30s with < 1B/s throughput).
• Slow POST mode: Detected in 33 seconds.
• Slow read mode: Detected in 35 seconds.
• False positives on slow legitimate connections: 0% across 5 test sessions.
Packet Processing Performance
ThreatLens was benchmarked using tcpreplay to replay captured traffic at controlled rates:
Packet Rate CPU Usage Memory Usage Packets Dropped
10,000 pkt/s 4% 42MB 0
50,000 pkt/s 18% 68MB 0
100,000 pkt/s 41% 95MB 0
500,000 pkt/s 79% 142MB 0.003%
Table 13: Packet Processing Performance Benchmark
ThreatLens processes up to 500,000 packets per second with less than 0.01% packet loss, which
exceeds the requirements of all but the highest-traffic production environments.
Threat Intelligence Enrichment Results
Enrichment was tested against 200 IPs from a known malicious IP dataset and 200 IPs from a
known-clean whitelist:
Metric Malicious IPs Clean IPs
AbuseIPDB confidence > 50 91.5% 0.5%
VirusTotal malicious verdicts > 0 84% 1%
Average enrichment latency 380ms 380ms
API timeout rate (5s timeout) 0% 0%
Table 14: Threat Intelligence Enrichment Results
Narrative Quality Assessment
Narrative output was evaluated by presenting 50 threat alert narratives to 10 participants with no
security background. Participants rated comprehension on a 1–5 scale:
30.
Comprehension Dimension MeanScore (1–5) “Clear” or better (%)
What happened (attack description) 4.6 94%
What risk I face (impact assess-
ment)
4.4 88%
What action to take (remediation) 4.5 92%
Overall narrative clarity 4.5 91.3%
Table 15: Narrative Quality Assessment Results
Automated Firewall Response Testing
• Total automated blocking events in 48-hour test: 47.
• Correct blocks (confirmed malicious source): 46 (97.9%).
• Incorrect blocks (false positive): 1 (2.1%; a legitimate IP with a prior AbuseIPDB report).
• Rollback success rate: 100% (47/47 rollback commands executed correctly).
• Average time from detection to block rule insertion: 420ms.
• Zero permanent firewall state changes: all rules are traceable to audit log entries.
Dashboard Performance
• Dashboard HTTP server response time: < 5ms for static asset delivery.
• WebSocket alert delivery latency (detection to browser render): < 50ms on local network.
• Maximum concurrent dashboard connections tested: 20 (no performance degradation).
• Browser compatibility: Chrome, Firefox, Safari, Edge (all current versions).
• Dashboard memory footprint (browser tab): 18MB.
Comparison with Existing Tools
ThreatLens is the only tool in the comparison that provides all ten features.
Limitations Observed
1. API Rate Limits: Free tier API limits (1,000/day AbuseIPDB, 500/day VirusTotal) constrain
enrichment throughput in very high-alert environments.
2. Encrypted Traffic: TLS-encrypted HTTPS traffic cannot be deep-inspected without a TLS
interception proxy.
3. False Positives in High-Traffic Environments: Legitimate high-volume services may trigger
volume anomaly alerts. Threshold tuning and whitelisting are available.
4. IPv6 Support: Current implementation fully supports IPv4. Full IPv6 support is planned as a
future extension.
5. Linux-Only: iptables automation is Linux-specific. macOS and Windows support requires
platform-specific implementations.
31.
Feature Snort 3Suricata 7 Wireshark ThreatLens
Signature detection Yes Yes No Yes
Anomaly detection No No No Yes
Threat intel enrichment No No No Yes
Human-readable narra-
tives
No No No Yes
Automated blocking No Yes No Yes
Blocking audit + roll-
back
No No No Yes
Live web dashboard No No No Yes
Single binary deploy-
ment
No No Yes Yes
Expert configuration
required
Yes Yes Moderate No
Novel attack detection No No No Yes
Table 16: Feature Comparison: ThreatLens vs. Existing NIDS
CHAPTER 6- CONCLUSION AND FUTURE SCOPE
Conclusion
40.1 Project Summary
This project successfully designed, developed, and implemented ThreatLens: a context-aware net-
work intrusion detection system in Go that captures raw network traffic at the packet level, performs
hybrid behavioural and pattern-based threat detection, enriches detections with live threat intelli-
gence from AbuseIPDB and VirusTotal, generates human-readable threat narratives with remedi-
ation guidance, provides automated iptables firewall response with full audit trail and rollback,
and presents all information through a WebSocket-connected live web dashboard — deployed as a
single compiled binary with zero runtime dependencies.
ThreatLens directly addresses the critical gap in accessible network security tooling: the absence
of a unified, usable, non-expert-friendly intrusion detection system for small teams and individual
developers.
40.2 Achievement of Objectives
All project objectives outlined in Chapter 1 were successfully achieved:
Objective 1: Raw packet capture and protocol parsing engine in Go.
[Done] Achieved: gopacket/libpcap integration with TCP, UDP, DNS, ARP decoding.
Objective 2: Behavioural anomaly detection with sliding window counters.
[Done] Achieved: Per-source sliding window detector; novel attack detection confirmed.
Objective 3: Attack pattern classifier for five attack categories.
32.
[Done] Achieved: Portscan, DDoS, DNS tunnel, ARP spoof, slow HTTP — all detected.
Objective 4: Live threat intelligence enrichment via AbuseIPDB and VirusTotal.
[Done] Achieved: 91.5% detection accuracy on malicious IPs; 380ms avg enrichment latency.
Objective 5: Human-readable threat narrative engine.
[Done] Achieved: 91.3% participant clarity rating across all narrative dimensions.
Objective 6: Automated iptables firewall response with audit trail and rollback.
[Done] Achieved: 97.9% correct block rate; 100% rollback success rate.
Objective 7: WebSocket-connected live web dashboard.
[Done] Achieved: <50ms alert delivery latency; 20 concurrent connections tested.
Objective 8: Single compiled Go binary with zero runtime dependencies.
[Done] Achieved: 18.4MB binary; confirmed on Ubuntu 22.04 and Raspberry Pi OS.
Objective 9: Functional testing and comparison against existing NIDS.
[Done] Achieved: Comparison table demonstrates ThreatLens uniquely covers all 10 features.
Objective 10: Complete documentation.
[Done] Achieved: Full project report and GitHub README with architecture and deployment
guide.
40.3 Key Achievements
Technical Achievements:
1. First open-source NIDS to integrate real-time threat intelligence enrichment natively into the
detection pipeline.
2. First open-source NIDS to generate plain-English threat narratives with remediation steps.
3. Hybrid detection (anomaly + pattern) closes the zero-day detection gap absent from all major
alternatives.
4. Single-binary deployment in 18.4MB with zero dependencies — the lowest deployment friction
of any comparable tool.
5. 100,000 packets/second processing at 41% CPU on a commodity machine.
Security Achievement:
1. Complete coverage across five major attack categories.
2. Audited automated firewall response with guaranteed rollback — safe for production use.
3. 0% false positive rate on clean traffic for all five attack classifiers.
Accessibility Achievement:
1. 91.3% of non-expert participants could correctly understand and act on threat narratives.
2. Zero configuration required for basic deployment.
3. Sub-2-minute setup from binary download to first alert.
33.
Future Scope
41.1 ImmediateEnhancements
Additional Attack Classifiers:
• ICMP flood detection and SMURF attack classification.
• SSH brute force detection via failed authentication pattern in TCP stream reconstruction.
• HTTPS certificate anomaly detection for TLS-layer threats.
Enhanced IP Whitelisting:
• CIDR range whitelisting for internal network segments.
• Dynamic whitelist updates via dashboard without restart.
• Trusted ASN bypass for known cloud provider IP ranges.
Alert Deduplication and Correlation:
• Suppress repeated alerts from the same source within a configurable window.
• Correlate multiple alert types from the same source into a unified campaign alert.
• Alert scoring: aggregate severity from correlated detections.
41.2 Advanced Features
Machine Learning Integration:
• Train a lightweight anomaly model on captured baseline traffic for per-environment adaptive
thresholds.
• Replace fixed thresholds with model-derived dynamic thresholds per source IP class.
• Export labelled detection data for community model training.
PCAP Export and Forensics:
• Ring-buffer PCAP capture that preserves the 60 seconds of traffic preceding any alert.
• PCAP export from the dashboard for forensic investigation.
• Integration with Wireshark for detailed packet-level inspection of suspicious sessions.
Email and Slack Alerting:
• SMTP integration for critical alert email notifications.
• Slack webhook integration for team-based alert routing.
• Configurable alert routing rules by severity and attack type.
IPv6 Full Support:
• Complete IPv6 packet decoding and detection coverage.
• ip6tables integration for IPv6 firewall automation.
34.
• IPv6 addressenrichment via AbuseIPDB (API already supports IPv6).
41.3 Platform and Ecosystem
Cross-Platform Firewall Support:
• macOS pf integration for firewall automation on macOS.
• Windows Defender Firewall API integration for Windows deployments.
• Abstract firewall interface in Go enabling pluggable platform implementations.
Kubernetes Deployment Mode:
• DaemonSet deployment for per-node packet capture in Kubernetes clusters.
• Network policy integration for Kubernetes-native blocking via Cilium or Calico.
• Centralised alert aggregation from multiple cluster nodes.
REST API for SIEM Integration:
• Standardised alert export in STIX 2.1 format for SIEM ingestion.
• Elasticsearch output plugin for ELK stack integration.
• Webhook support for custom alert routing to any downstream system.
41.4 Commercial Development Path
SaaS Dashboard:
• Cloud-hosted dashboard aggregating alerts from multiple deployed agents.
• Multi-organisation account management for managed security service providers.
• Advanced analytics: attack trends, geographic heatmaps, attacker campaign tracking.
Professional Tier:
• Unlimited threat intelligence API calls via proxied commercial tier.
• Machine learning anomaly models pre-trained on large-scale traffic datasets.
• Professional support and SLA for enterprise deployments.
Recommendations for Deployment
42.1 For Individual Developers
1. Deploy ThreatLens on any internet-facing Linux server. Obtain free AbuseIPDB and VirusTotal
API keys (five-minute process). Run the binary with root privilege on the primary network
interface.
2. Review the dashboard daily and act on HIGH and CRITICAL alerts immediately.
3. Configure the whitelist with your own IP addresses and known trusted CIDR ranges before
enabling automated blocking.
35.
4. Enable automatedblocking only after observing the system for 48 hours in detection-only mode
to assess false positive rate in your environment.
42.2 For Small Engineering Teams
1. Deploy on a dedicated monitoring host with promiscuous mode access to the network segment
to be monitored.
2. Configure Slack webhook integration for team-visible alert routing.
3. Designate a weekly rotation for alert review and firewall audit log review.
4. Export alert data monthly for trend analysis and to brief stakeholders on threat landscape.
Concluding Remarks
ThreatLens demonstrates that the gap in accessible network security tooling is a solvable engineer-
ing problem, not an inherent limitation of the domain. By combining the performance and concur-
rency advantages of Go with thoughtful UX design centered on the non-expert user, it is possible
to build a network intrusion detection system that provides professional-grade detection capability
while remaining fully usable by a developer with no security background.
The human-readable threat narrative engine — the project’s primary innovation — proves that secu-
rity tooling need not choose between technical depth and user accessibility. A well-designed system
can deliver both: deep packet-level analysis and live threat intelligence enrichment communicated
in language that any system operator can understand and act upon.
The broader lesson of this project is that the most impactful security tools of the next decade will not
be the most sophisticated in their detection algorithms, but the most accessible in their output. The
organisations most at risk of network intrusion are not enterprises with dedicated SOCs and expert
analysts — they are the individual developers, startups, and small teams who currently operate with
no intrusion detection whatsoever because existing tools are too complex to be useful. ThreatLens
is designed for them.
*REFERENCES
1. Snort Project. (2024). Snort 3 User Manual. Cisco Systems. [Online]. Available: https://www.snort.org/docu
[Accessed: Jan. 2026].
2. Open Information Security Foundation. (2024). Suricata User Guide 7.0. [Online]. Available:
https://docs.suricata.io. [Accessed: Jan. 2026].
3. Sommer, R., & Paxson, V. (2010). Outside the closed world: On using machine learning for
network intrusion detection. In Proceedings of the 2010 IEEE Symposium on Security and
Privacy, pp. 305–316.
4. Denning, D. E. (1987). An intrusion-detection model. IEEE Transactions on Software Engi-
neering, 13(2), 222–232.
5. Lakhina, A., Crovella, M., & Diot, C. (2004). Diagnosing network-wide traffic anomalies. In
ACM SIGCOMM Computer Communication Review, 34(4), pp. 219–230.
36.
6. Garcia-Teodoro, P.,Diaz-Verdejo, J., Macia-Fernandez, G., & Vazquez, E. (2009). Anomaly-
based network intrusion detection: Techniques, systems and challenges. Computers & Security,
28(1–2), 18–28.
7. Axelsson, S. (2000). Intrusion detection systems: A survey and taxonomy. Technical Report
99-15, Chalmers University of Technology, Sweden.
8. Julisch, K. (2003). Clustering intrusion detection alarms to support root cause analysis. ACM
Transactions on Information and System Security, 6(4), 443–471.
9. Ramachandran, A., & Feamster, N. (2006). Understanding the network-level behavior of spam-
mers. In Proceedings of ACM SIGCOMM, pp. 291–302.
10. Donovan, A. A. A., & Kernighan, B. W. (2015). The Go Programming Language. Addison-
Wesley Professional.
11. Google. (2024). gopacket: A Go library for packet processing. [Online]. Available: https://github.com/google
[Accessed: Jan. 2026].
12. Botta, A., Pescape, A., & Ventre, G. (2012). A tool for the generation of realistic network
workload for emerging networking scenarios. Computer Networks, 56(15), 3531–3547.
13. AbuseIPDB. (2025). AbuseIPDB API v2 Documentation. [Online]. Available: https://docs.abuseipdb.com.
[Accessed: Jan. 2026].
14. VirusTotal. (2025). VirusTotal API v3 Reference. [Online]. Available: https://developers.virustotal.com.
[Accessed: Jan. 2026].
15. The Go Authors. (2024). The Go Programming Language Specification. [Online]. Available:
https://go.dev/ref/spec. [Accessed: Jan. 2026].
16. bbolt Contributors. (2024). bbolt: An embedded key/value database for Go. [Online]. Avail-
able: https://github.com/etcd-io/bbolt. [Accessed: Jan. 2026].
17. ProjectDiscovery. (2025). Nuclei: Fast and customizable vulnerability scanner. [Online].
Available: https://github.com/projectdiscovery/nuclei. [Accessed: Jan. 2026].
18. Spafford, E. H. (1988). The internet worm program: An analysis. ACM SIGCOMM Computer
Communication Review, 19(1), 17–57.