We built a hybrid SIEM that combines Sigma rules with 4 ML classifiers and blocks attackers at the gateway. This article maps each layer to an AWS managed service, lists what stays custom, and gives a test plan that fits inside the AWS free trials.
Student
Context #
We are building a hybrid SIEM as a student startup in Istanbul. It combines rule-based detection with machine learning and responds by blocking IP addresses at the network gateway. The testbed is an 8-host lab on Raspberry Pis, a 10G switch and a gateway router. The lab is enough to generate and label traffic. It is not enough for customers with many endpoints and cloud workloads.
Before we move any part of the system, we mapped each layer to an AWS managed service and marked what we still build ourselves. This article is that map, plus the test plan we use to check it.
The system today #
| Layer | Lab implementation |
|---|---|
| Collection | Host and network logs from 8 lab hosts, stored on 1 central server |
| Rule detection | Rule engine with Sigma rules mapped to MITRE ATT&CK |
| ML detection | 4 classifiers (Logistic Regression, SGD, SVM, LightGBM) trained under 1 protocol |
| Scoring | Hybrid risk score that combines rule hits and model output |
| Response | IP blocking at the gateway |
| Interface | Flask dashboard |
The AWS mapping #
| Layer | AWS service | What it gives us |
|---|---|---|
| Collection and storage | Amazon Security Lake | Normalizes AWS logs and findings to OCSF and stores them as Parquet in our own S3 bucket. Lab hosts join as a custom source. |
| Rule detection | Amazon OpenSearch Service, Security Analytics | Over 2,200 prepackaged Sigma rules, custom rule import, MITRE ATT&CK mapping. Needs OpenSearch 2.5 or later. |
| Managed threat detection | Amazon GuardDuty | A new layer with no lab equivalent. Extended Threat Detection correlates weak signals into attack sequence findings at no extra cost. |
| ML detection | Amazon SageMaker AI | Built-in Linear Learner covers our 2 linear models, built-in LightGBM covers the third. SVM runs as a script in the scikit-learn container. |
| Response | Amazon EventBridge and AWS Lambda | GuardDuty emits 1 event per finding. Lambda updates an AWS WAF IP set, a network ACL or an AWS Network Firewall rule group. |
| Interface | OpenSearch Dashboards | Findings, alerts and rules in one view. Replaces the Flask dashboard for analysts. |
Three decisions from the mapping #
-
OCSF comes first. Every later layer reads normalized events. Security Lake accepts custom sources only as OCSF 1.3 or earlier, in Parquet, with its partitioning rules. We write and validate the converter for our lab logs before anything else.
-
GuardDuty severity is an input, not the verdict. We feed GuardDuty findings into our hybrid risk score next to Sigma hits and model output. The score stays our own code, because it is the part we tune per site.
-
The block path stays small. The lab blocks at 1 gateway. On AWS the equivalent is 1 Lambda function behind 1 EventBridge rule. We start with a WAF IP set for web-facing targets and move to Network Firewall only when we need stateful inspection, since Network Firewall bills per endpoint-hour.
The block path #
EventBridge rule for High and Critical GuardDuty findings:
{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": { "severity": [{ "numeric": [">=", 7] }] }
}
Lambda function that adds the remote IPs from a finding to a WAF IP set:
import boto3
waf = boto3.client("wafv2")
IP_SET = {"Name": "blocked-ips", "Scope": "REGIONAL", "Id": "<ip-set-id>"}
def remote_ips(finding):
action = finding.get("service", {}).get("action", {})
details = [action.get("networkConnectionAction", {}).get("remoteIpDetails", {})]
details += [p.get("remoteIpDetails", {})
for p in action.get("portProbeAction", {}).get("portProbeDetails", [])]
return {f"{d['ipAddressV4']}/32" for d in details if d.get("ipAddressV4")}
def handler(event, context):
new = remote_ips(event["detail"])
if not new:
return
current = waf.get_ip_set(**IP_SET)
addresses = set(current["IPSet"]["Addresses"]) | new
waf.update_ip_set(**IP_SET, Addresses=sorted(addresses),
LockToken=current["LockToken"])
Before production we add 2 controls: an allowlist so the function never blocks our own addresses, and an expiry so each block lifts after a fixed time.
Test plan inside the free trials #
GuardDuty gives new accounts 30 days at no cost per Region. Security Lake gives 15 days from the moment it is enabled. We fit the test into the shorter window, in 1 sandbox account and 1 Region.
| Days | Step |
|---|---|
| 1 | Enable GuardDuty and Security Lake |
| 2 to 5 | Write the OCSF converter for lab logs and register it as a custom source |
| 6 to 10 | Connect OpenSearch Security Analytics, load our Sigma rules, run them on the same events as the lab engine |
| 11 to 14 | Deploy the EventBridge rule and Lambda function, generate GuardDuty sample findings, measure the block path |
| 15 | Read the cost estimates on the usage pages, then delete the OpenSearch domain and any firewall resources |
OpenSearch Service is not part of either trial, so we run the smallest domain that supports Security Analytics and delete it on day 15.
What we measure #
-
Rule agreement: share of lab Sigma matches that Security Analytics also flags on the same events, in %.
-
Block latency: time from GuardDuty finding to IP set update, in seconds.
-
Noise: false positives per day per detector.
-
Cost: estimated monthly cost for 8 hosts, from the trial usage pages.
Summary #
The mapping keeps 2 parts of our system custom: the OCSF converter for on-premises logs and the hybrid risk score. Every other layer runs on a managed AWS service. We will publish the 4 measured values after the test window.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
recommendations