Building a Lightweight Cloud SOC on AWS - Part1

Building a Lightweight Cloud SOC on AWS - Part1

Can we build a lightweight Cloud SOC using AWS-native services without a traditional SIEM? I built a proof of concept using Amazon GuardDuty, AWS CloudTrail, EventBridge, Lambda, DynamoDB, API Gateway, and Cognito for security monitoring, event processing, storage, and authentication. The solution uses a serverless backend with a Flutter Web dashboard hosted on Amazon EC2 using Nginx and HTTPS, providing security insights through a cost-conscious, customizable architecture.

Series: Building a Lightweight Cloud SOC on AWS (2 articles)

  1. 2
    Building a Lightweight Cloud SOC on AWS - Part1 This article
Sr Consultant, Cloud&Network Security
Security monitoring is one of the most important capabilities in a cloud environment. AWS provides powerful native security services, including Amazon GuardDuty, AWS CloudTrail, AWS Security Hub, and Amazon Detective.

However, I wanted to explore a slightly different approach:
 Can we build a lightweight, customizable Security Operations Center (SOC) dashboard using AWS-native services, without deploying a traditional SIEM or managing an expensive analytics cluster?  
To answer that question, I built a proof of concept (PoC) that collects security findings from Amazon GuardDuty and AWS CloudTrail, normalizes them through AWS Lambda, stores them in Amazon DynamoDB, and presents them through a custom Flutter Web dashboard.
The goal was not to replace an enterprise SIEM, but to understand how security telemetry, detection logic, serverless processing, authentication, and visualization can work together.


1. Architecture Overview

The solution uses two independent ingestion pipelines.
Pipeline 1: Amazon GuardDuty
GuardDuty continuously evaluates supported AWS telemetry for suspicious activity. When a finding is generated, Amazon EventBridge routes the event to a Lambda function.
The Lambda normalizes the finding and stores it in DynamoDB.
Pipeline 2: AWS CloudTrail
CloudTrail records AWS management API activity, including IAM changes, access-key creation, and modifications to security configurations.
For this PoC, I used CloudTrail Event history with scheduled polling through the  LookupEvents  API.
This approach avoids creating an additional CloudTrail trail for the initial experiment.
The architecture can be represented as follows:
AWS Account
|
+--------------+--------------+
| |
Amazon GuardDuty AWS CloudTrail
| Event History
| |
Amazon EventBridge Scheduled EventBridge
| |
v v
GuardDuty Ingestion CloudTrail Poller
Lambda Lambda
| |
+--------------+--------------+
|
v
Amazon DynamoDB
Security Findings
|
v
AWS Lambda
Query Backend
|
v
Amazon API Gateway
|
JWT Authorization
|
Amazon Cognito
|
v
Flutter Web Dashboard
|
Amazon EC2
Nginx + HTTPS
The ingestion and query layers operate independently, allowing additional security data sources to be introduced later.

2. AWS Services Used

AWS service
Purpose
Amazon GuardDuty
Managed threat detection
AWS CloudTrail
AWS management API activity and audit history
Amazon EventBridge
GuardDuty event routing and scheduled polling
AWS Lambda
Security-event ingestion, detection, normalization, and query APIs
Amazon DynamoDB
Serverless security-findings database
Amazon API Gateway
HTTPS APIs for the dashboard
Amazon Cognito
User authentication and JWT-based access control
AWS Identity and Access Management (IAM)
Execution roles and least-privilege permissions
Amazon CloudWatch
Lambda execution logs and troubleshooting
Amazon EC2
Hosting the Flutter Web frontend
Amazon VPC
Network environment for the EC2-hosted dashboard
The web application was developed using Flutter Web and served through Nginx over HTTPS.

3. GuardDuty Integration: Native Threat Detection

Amazon GuardDuty provides managed detection capabilities without requiring a custom detection engine for every threat category.

For the PoC, GuardDuty findings are routed using an EventBridge rule.
The processing flow is:
GuardDuty Finding
|
v
EventBridge Rule
|
v
Lambda Ingestion
|
v
Normalize Finding
|
v
DynamoDB
The ingestion function extracts fields such as finding ID, title, severity, account, Region, resource identifiers, timestamps, and workflow status.

These fields are transformed into a common format that can also represent CloudTrail detections.
This normalization is important because GuardDuty and CloudTrail have very different event structures.

Github link for lambda functions use in this POC.

4. CloudTrail Integration: Detecting Security-Sensitive API Activity

One of the most interesting parts of this project was extending the SOC beyond managed GuardDuty findings.
CloudTrail Event history is available by default for recent management events, making it useful for an initial low-cost experiment.
Instead of immediately configuring an S3-based CloudTrail pipeline, I implemented a scheduled Lambda that uses:
cloudtrail.lookup_events()
The function retrieves recent management events, applies custom detection rules, and stores matching events in DynamoDB.

Multi-Region monitoring

During testing, I observed that an IAM  CreateAccessKey  event was available through CloudTrail Event history in  us-east-1 , while my initial implementation monitored only  us-west-2 .
I therefore extended the poller to query both Regions:
SOC_REGIONS = [
"us-west-2",
"us-east-1"
]
This allowed the same Lambda to monitor regional AWS activity and global IAM-related events.
The design can be extended to additional Regions as needed.

Security detections

The CloudTrail detection engine focuses on security-sensitive operations rather than treating every API call as a threat.
Examples include:
CloudTrail event
Security significance
 CreateAccessKey 
New programmatic credentials
 CreateUser 
IAM identity creation
 AttachUserPolicy 
Permission assignment
 PutRolePolicy 
Inline IAM role permission modification
 UpdateAssumeRolePolicy 
IAM role trust relationship modification
 StopLogging 
CloudTrail logging disabled
 DeleteTrail 
CloudTrail trail deleted
 AuthorizeSecurityGroupIngress 
Potentially risky network access
Severity is determined by custom detection logic.
For example, a successful access-key creation performed by the root identity can be classified as CRITICAL.
A key lesson: CloudTrail records activity; it does not automatically assign SOC threat severity to every management event. Detection logic must consider the principal, API operation, outcome, resource, and context.

5. A Real Detection: Root Identity Creating an IAM Access Key

During testing, the CloudTrail poller identified an event with the following characteristics:
{
"eventName": "CreateAccessKey",
"awsRegion": "us-east-1",
"identityType": "Root",
"targetUser": "soc-test",
"errorCode": null
}
The event was classified as:
CRITICAL — Root access key created
This detection illustrates why IAM activity is an important addition to cloud security monitoring.
The root identity has highly privileged access, and using it for routine administration is discouraged. Even when an activity is authorized, it deserves visibility and investigation.
The detection was stored in DynamoDB and subsequently displayed in the custom dashboard.

6. DynamoDB as a Lightweight Findings Store

Rather than introducing a dedicated search cluster, I used Amazon DynamoDB.
Each normalized finding is stored with a partition key and sort key.
Example:
PK = ACCOUNT#<account-id>#REGION#us-east-1

SK = FINDING#<unique-finding-id>
A global secondary index supports severity-oriented queries:
GSI1PK = SEVERITY#CRITICAL

GSI1SK = <event-time>#<finding-id>
The implementation uses conditional writes to avoid repeatedly inserting the same CloudTrail event during overlapping polling windows.
DynamoDB offered several advantages for this PoC:
  • No database servers to manage.
  • On-demand capacity.
  • Simple integration with Lambda.
  • Flexible storage for normalized findings.
  • Straightforward retrieval for a small dashboard.
There are also trade-offs. DynamoDB is not a full-text search engine, and table scans are not an ideal long-term strategy for a large security-events dataset.
For production-scale deployments, I would introduce account-scoped indexes, materialized summary counters, retention policies, and potentially a dedicated analytics layer.

7. Securing the Dashboard with Amazon Cognito

Security dashboards contain sensitive operational information, so authentication was a core requirement.

I integrated Amazon Cognito with Flutter Web using the OAuth 2.0 Authorization Code flow with PKCE.
The authentication process is:
User opens dashboard
|
v
Cognito Hosted Login
|
v
Authorization Code + PKCE
|
v
Access Token
|
v
API Gateway JWT Authorizer
|
v
Lambda Query Backend
|
v
DynamoDB Findings
API Gateway validates the JWT before allowing access to protected endpoints such as  /summary  and  /findings .
The Flutter application uses HTTPS and does not embed AWS access keys or secret keys.
This separates frontend authentication from backend AWS permissions.

8. Dashboard Insights: Turning Events into Security Visibility

The dashboard was designed to provide an immediate overview of the current security posture represented by the stored findings.
It includes severity metrics, affected-resource counts, findings by source, and expandable investigation details.

Security overview

In the latest PoC snapshot, the dashboard displayed:
Metric
Findings
Total findings
10
CRITICAL
1
HIGH
6
MEDIUM
0
LOW
3
INFORMATIONAL
0
Affected resources
6
These are demonstration results from the PoC, not measurements of an enterprise environment.

Findings by source

One useful enhancement was adding source-level visibility.
Detection source
Findings
AWS CloudTrail
7
Amazon GuardDuty
3
This helps answer two different operational questions:
What suspicious activity has GuardDuty identified?
And:
What security-sensitive AWS administrative operations have occurred?
GuardDuty provides managed threat detections, while CloudTrail-based custom rules add visibility into administrative changes and identity operations.
Combining both sources creates a more useful security monitoring view than relying on either source alone.

Investigation details

Each finding can be expanded to display its description and normalized JSON fields.

For CloudTrail findings, these can include the principal, API action, Region, source IP address, target resource, and event timestamp.
This gives analysts a starting point for investigation without immediately switching between multiple AWS consoles.

9. Lessons Learned During Development

Several practical lessons emerged from this implementation.
First, CloudTrail is regional from an API-query perspective. Monitoring only one Region can miss relevant activity, particularly IAM events available in  us-east-1 .
Second, detection rules need tuning. My initial logic generated too many HIGH findings from routine root API activity. Refining the rules significantly improved the signal-to-noise ratio.
Third, data normalization is essential. GuardDuty and CloudTrail have different schemas, but a common findings model enables shared dashboards and workflows.
Fourth, DynamoDB access patterns must be planned carefully. Initially, the summary API queried only one regional partition. After introducing multi-Region ingestion, the API also needed to retrieve findings across Regions.
Finally, authentication should be part of the architecture from the beginning. Cognito and API Gateway JWT authorization provided a clear separation between the user interface and protected backend APIs.

10. Cost Considerations

The architecture was designed with cost awareness in mind.
CloudTrail Event history avoids the need for a new trail during this initial PoC, while Lambda, EventBridge, and DynamoDB provide usage-based pricing.
However, the solution is not entirely free.
Potential costs include Lambda invocations, DynamoDB reads and writes, CloudWatch Logs, API Gateway requests, EC2 hosting, and associated networking resources.
The cost profile will depend on polling frequency, event volume, retention, dashboard traffic, and infrastructure configuration.
A future enhancement could move the static Flutter frontend to Amazon S3 and Amazon CloudFront, reducing the need to operate an EC2 web server.

11. What Comes Next?

This project is an initial foundation for a more capable cloud security operations platform.
Potential enhancements include finding lifecycle management, analyst notes, source and Region filtering, IAM activity correlation, notifications, and automated response workflows.
Additional AWS services such as AWS Security Hub, AWS Config, Amazon Detective, and Amazon Bedrock could extend the platform with richer security context and investigation capabilities.
These are future possibilities, not components of the current implementation.
For larger environments, I would also consider event-driven CloudTrail delivery, centralized multi-account ingestion, stronger data retention controls, and more scalable query patterns.

Conclusion

This proof of concept demonstrates how AWS-native security services and serverless backend components can be combined to build a lightweight cloud security monitoring platform.
Amazon GuardDuty and AWS CloudTrail provide security telemetry, while Amazon EventBridge, AWS Lambda, and Amazon DynamoDB support event processing and findings storage. Amazon API Gateway and Amazon Cognito secure the backend APIs, and a Flutter Web dashboard hosted on Amazon EC2 provides an accessible investigation interface.
Although the current solution uses EC2 for frontend hosting, the backend is serverless. A future enhancement could move the static Flutter Web application to Amazon S3 and Amazon CloudFront, eliminating the need to manage a frontend web server.
The key takeaway is that building a practical Cloud SOC does not necessarily require a traditional SIEM platform. AWS-native services, custom detection logic, and a lightweight dashboard can provide a useful foundation for security visibility and investigation and a Cloud SOC is not just about collecting security events. It is about transforming those events into meaningful, prioritized, and actionable security insights.
This project is a starting point for exploring how serverless architectures can support practical cloud security operations.



Series: Building a Lightweight Cloud SOC on AWS (2 articles)

  1. 2
    Building a Lightweight Cloud SOC on AWS - Part1 This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article