AWS Builder Center

Building Sentinel: Advisory-First Org-Wide Dependency Security Automation with AWS Serverless

How we built an event-driven, org-wide security automation engine using AWS SAM, Lambda, SQS, and DynamoDB to scan 50+ repositories in under 60 seconds when a zero-day CVE drops.

The Problem: Dependabot is Per-Repo. Security Incidents are Org-Wide.

Imagine you are a security engineer managing 50+ microservices in a growing organization. A critical zero-day vulnerability drops for a widely used npm package like  lodash  (prototype pollution) or  axios .
Every minute that passes increases your attack surface. But today, the workflow looks like this:
  1. You have to manually search through 50+ repositories or wait for tools like Dependabot to eventually scan each repo on their individual schedules.
  1. You don't know your org-wide blast radius in real time.
  1. Once alerts trickle in, developers must manually open, review, and test PRs across dozens of independent repositories.
We realized the fundamental flaw: existing tools are repo-centric, but security threats are advisory-centric.
That's why we built Sentinel — an advisory-first, org-wide dependency security automation platform powered by AWS Serverless.



What We Built: The 4-Phase Pipeline

Sentinel flips the dependency management paradigm. Instead of scanning repos periodically on timers, Sentinel reacts instantly to new CVEs and coordinates an organization-wide response in 4 distinct phases:
  1. Detect (Phase 1): An Amazon EventBridge rule triggers our  Advisor Lambda  every 5 minutes (or via a manual webhook/dashboard trigger) to poll the GitHub Security Advisory Database (GHSA) for new npm advisories.
  1. Decide (Phase 2): When a new advisory is verified, an event is placed into an Amazon SQS queue ( advisory-queue ). Our  Impact Lambda  consumes the message, queries all 50+ repositories across the organization in parallel, and uses  semver.intersects()  to calculate the exact blast radius in under 60 seconds.
  1. Act (Phase 3): For affected repositories, jobs are enqueued to  patch-queue . Our  Patch Lambda  creates a dedicated security branch, bumps  package.json  to the minimum non-vulnerable version, and opens a coordinated remediation Pull Request. It even leverages Amazon Bedrock (Nova Lite) to write plain-language risk summaries in the PR body.
  1. Verify (Phase 4): The repository’s existing CI/CD workflow automatically runs tests against the PR. A real-time React + Vite dashboard tracks status from  Queued  →  Patched  →  Merged .



The Stack

We built Sentinel entirely on the AWS Serverless and Open-Source stack:
  • AWS SAM (Serverless Application Model): Our entire infrastructure is codified in a 598-line  template.yaml  Infrastructure-as-Code file defining all compute, queues, storage, and IAM policies.
  • AWS Lambda (Node.js 20 ESM): Four decoupled, single-responsibility microservices ( advisor ,  impact ,  patch ,  state ) designed for high concurrency and sub-second execution.
  • Amazon SQS & Dead Letter Queues (DLQs): Decouples detection from analysis and patching, providing automatic retries, backoff, and isolation for failed jobs.
  • Amazon DynamoDB: Three fast NoSQL tables ( Advisories ,  Repos , and  Jobs ) maintain state across org-wide remediation runs.
  • Amazon Bedrock (Amazon Nova Lite): Automatically translates dense CVE advisories into developer-friendly explanations inside the generated PRs.
  • Amazon CloudWatch: 7 proactive alarms, custom metric filters, and an operational dashboard for continuous observability.
  • LocalStack & Docker Compose: Enabled 100% offline local development and end-to-end integration testing without incurring cloud costs.



What Fought Back: Engineering Challenges & Gotchas

Building an automated remediation engine across dozens of real-world repositories came with some tough engineering battles:

1. The Blast-Radius Race Condition

When multiple CVEs drop simultaneously, or when testing rapid re-runs, multiple Lambdas can attempt to process the same advisory or write duplicate jobs.
  • The Solution: We utilized DynamoDB conditional expressions ( attribute_not_exists(ghsa_id) ). This ensured that advisory deduplication was atomic and executed at the database layer with zero race conditions.

2. Semver Range Intersections

A repository's  package.json  might specify  ^4.17.15 , while the advisory specifies  <4.17.21 . Simple string matching fails completely here.
  • The Solution: We implemented pure mathematical semver range intersection using  semver.intersects(declaredRange, vulnerableRange) . This ensures zero false positives and avoids opening unnecessary PRs on repos that are already secure.

3. GitHub API Rate Limits & Branch Collisions

Scanning 50+ repositories and creating branches simultaneously easily hits GitHub REST API rate limits and branch namespace conflicts.
  • The Solution: We implemented exponential jittered backoff in our GitHub client and designed idempotent branch naming ( security/{package}-{ghsa_id} ). If an old remediation branch already exists, Sentinel inspects commit trees to avoid merge conflicts.



What We Learned & What's Next

Building Sentinel during the WeMakeDevs Hackathon proved how powerful event-driven architectures are on AWS. Using SQS with Lambda Event Source Mappings eliminated the need for complex distributed state machines or long-running worker servers.
Next on our roadmap:
  • Lockfile Analysis: Extending analysis to transitive dependencies in  package-lock.json .
  • Multi-Ecosystem Support: Expanding beyond npm to PyPI, Go modules, and Maven.
  • Automated Merging: Auto-merging PRs when CI passes on critical severity alerts.
Check out the project and open-source code on GitHub:  https://github.com/ANSUJKMEHER/Sentinel !
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