
Weekend Agent Challenge: Sentinel — My Morning Cloud Security Brief
Sentinel automatically audits your AWS account, summarizes risks with Amazon Bedrock, and enables secure, human-approved remediation.
Vision & What the Agent Does
Almost nobody audits their own AWS account as often as they should. A bucket gets made public "just for a minute," a security group ends up open to
0.0.0.0/0 , an access key quietly turns 200 days old. Nothing tells me, until something goes wrong. The best moment to catch these is before I've had coffee, not after an incident.Sentinel is a personal, always-on agent that audits my AWS account while I sleep and has a prioritized security brief waiting in my inbox every morning. I never open a console to run it.
- What triggers it: an Amazon EventBridge Scheduler rule fires at 07:00 every day — no human, no button.
- What it does on its own: it wakes a Lambda that runs a battery of read-only posture checks across IAM, networking, S3, and encryption (missing MFA, keys older than 90 days, security groups open to the world, buckets not blocking public access, unencrypted volumes, and more). It sends the raw findings to Amazon Bedrock, which ranks them by severity and writes a calm, plain-English summary of what to fix first and why.
- How it reports back: Amazon SES emails me the brief. Findings that are safe to automate include an "Apply fix" button; I click it, get a confirmation page describing exactly what will change, confirm, and a separate, tightly-scoped function runs that one fix, enabling S3 Block Public Access, revoking an open ingress rule, or deactivating an aging key. Nothing changes without my explicit approval, one fix at a time. A public dashboard also visualizes the agent's activity.
It's triggered entirely by a schedule, does real work unattended, and hands me a result: a personal security analyst that runs itself.

How I Built It?
I started from the trigger and worked outward: EventBridge Scheduler fires a scanner Lambda (TypeScript, bundled with esbuild) on a daily cron. The scanner runs four independent check modules, each isolated so one missing permission degrades to a warning instead of sinking the whole run.
My key decisions were all about security, because a scheduled function that can touch my whole account is itself a target:
- Two roles, least privilege. The scanner is strictly read-only; it physically cannot change anything. Only a second Lambda can write, and its IAM policy allows exactly the three actions the supported fixes need.
- Signed, single-use approval links. Each "Apply fix" link carries an HMAC-SHA256 token that encodes the finding, resource, and an expiry; the signing key is stored in the SSM Parameter Store as a SecureString. A forged link fails signature verification; a replayed link fails a DynamoDB conditional write, so each fix runs at most once.
- GET confirms, POST executes. Email clients pre-fetch links, so a scanner could trigger a fix that ran on click. GET only renders a confirmation page; the fix runs on POST.
- Prompt-injection boundary. Resource names are attacker-influenceable, so the model writes only the human summary, never links or actions.
Challenges I overcame: esbuild's minified CommonJS output silently dropped the exported Lambda handler once the AWS SDK was bundled, so Lambda couldn't find it; I switched the bundle to ESM (
.mjs ), which Node 20 runs natively. External DNS forced a two-step ACM/ terraform apply . And because the dashboard is public, I made it run on sample data; a security dashboard should never expose an account's real vulnerabilities.
AWS Services Used / Architecture Overview
Trigger: Amazon EventBridge Scheduler (daily cron) invokes the scanner Lambda.
Services: AWS Lambda (read-only scanner, write-scoped remediator, read API) · Amazon Bedrock (writes the brief) · Amazon SES (delivers it) · Amazon API Gateway (fronts the approval/read functions) · Amazon DynamoDB (single-use nonce store) · AWS Systems Manager Parameter Store (HMAC secret) · Amazon S3 + CloudFront + ACM (public dashboard) · IAM + CloudWatch Logs.
The flow: EventBridge → Scanner Lambda → (read-only scans) → Bedrock → SES → my inbox. The remediation path is email link → API Gateway → approval Lambda → one scoped fix, guarded by the DynamoDB nonce and SSM secret. Everything is defined in Terraform, split into
api , scanner , and dashboard modules.


What I Learned?
Two things stuck. First, the schedule is the feature — moving from "a script I run" to "a thing that runs itself and hands me a result" changed how useful it felt far more than any single check did. Second, an agent that can act needs its own threat model: the moment I gave automation write access, I'd built something that could be abused, so the real engineering was making approval unforgeable, un-replayable, and immune to link pre-fetching. I also used the Bedrock Converse API for the first time and appreciated how model-agnostic it is — swapping Nova for another model is a one-line change. And I got a lot more comfortable with modular Terraform and
moved {} blocks for refactoring live infrastructure safely.Link to App & Repo
- Live dashboard: https://sentinel.omarfathy.dev
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article