← Back to projects

AWS Cloud Security Detection Pipeline

A serverless, event-driven pipeline on AWS that monitors an account's activity logs and automatically flags suspicious or high-risk behavior — analyzing new logs the moment they land, with no server to run.

PythonAWS LambdaAmazon S3CloudTrailIAMEvent-driven serverless

01 Overview

Cloud accounts generate an enormous volume of activity logs, and the signal that matters — someone using the root account, an IAM policy quietly widening, a bucket going public — is buried in thousands of routine events. This pipeline solves the "nobody is reading the logs" problem: it ingests AWS CloudTrail activity, runs a set of security detection rules against every event automatically, and writes structured reports flagging what a reviewer should actually look at, ranked by severity.

02 Architecture

The system is fully event-driven — no server polling or running on a schedule. Each stage triggers the next:

01
AWS CloudTrailRecords all account activity as structured log events.
02
Amazon S3Stores the CloudTrail log files as they are delivered.
03
S3 event triggerA new log file landing in the bucket invokes the Lambda automatically.
04
AWS Lambda (Python)Parses the JSON CloudTrail events and runs the six detection rules against them.
05
Severity scoring + reportsFindings are assigned severity levels and written out as structured security reports.

03 Technologies & why

04 Implementation

The Lambda parses raw CloudTrail JSON and evaluates each event against six rule-based checks spanning four categories — authentication, IAM, privilege escalation, and public-resource exposure:

Detection ruleset
IDRuleSeverity
R-01Repeated failed console login attempts from the same sourceMedium
R-02Root account usageHigh
R-03Unusual / high-risk API activityMedium
R-04IAM permission or policy changes tied to potential privilege escalationHigh
R-05Overly permissive IAM policiesMedium
R-06S3 buckets or resources configured with public accessHigh

Each matched event is tagged with a severity level and collected into a structured report, so the output is triaged rather than a flat dump. The pipeline has been run against a dataset of 10,000+ CloudTrail events.

05 Challenges

Fill in before sharingWrite 2–3 real problems you hit — parsing edge cases in CloudTrail JSON, telling legitimate root usage from suspicious, tuning "high-risk API activity," IAM permissions on the Lambda itself, or handling large log files within Lambda limits. Only what actually happened.

06 Solutions

Fill in before sharingFor each challenge above, one or two sentences on how you solved it. Specific and honest — "I did X because Y."

07 Results

10,000+
CloudTrail events analyzed
6
detection rules
4
threat categories

The pipeline analyzes 10,000+ CloudTrail events through six rule-based checks across authentication, IAM, privilege-escalation, and public-resource-exposure categories, producing severity-ranked reports. Because it's fully event-driven, new logs are analyzed automatically with no manual step.

08 Limitations

Fill in before sharingHonesty reads as maturity. Likely: rule-based (not behavioral/ML) so novel attacks outside the six rules slip through; single-account scope; no alerting layer yet; detections run per-log-file rather than correlating across time. State the real ones.

09 Future improvements

Fill in before sharingYour roadmap — SNS/email alerting on high-severity findings, anomaly detection beyond static rules, forwarding to a SIEM, multi-account support, or a small dashboard. Tie each to a limitation above.

10 Source

The full source is on GitHub.