惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
CloudTrail - Root failed login alarm
Luis Eduardo Lunar Guevara · 2026-06-23 · via DEV Community

Típica pregunta de examen, muy fácil de memorizar y màs fácil si llegas a reconocer el patrón del caso de uso:

Digital Café Luna wants to notify the security operations team if the AWS account root user makes more than three failed console login attempts within 10 minutes. The security team wants to generate a threshold-based alarm from CloudTrail log data and notify an SNS topic.

Which solution will meet these requirements?

A. Configure AWS Config to detect failed root user login attempts and send notifications to an SNS topic.
B. Configure CloudTrail to send logs to CloudWatch Logs, create a metric filter for failed root user console login attempts, create a CloudWatch alarm with a threshold greater than 3 within 10 minutes, and notify an SNS topic.
C. Configure Amazon GuardDuty to detect failed root user login attempts and send findings directly to an SNS topic.
D. Configure IAM Access Analyzer to detect failed root user authentication attempts and trigger an EventBridge rule.

✅ Correct answer: B

La pregunta tiene varias claves que nos ayuda a identificar la respuesta:

  • Se quiere detectar más de tres intentos fallidos.
  • La venta de evaluación es de 10 minutos.
  • La alarma se dispara desde CloudTrail logs.
  • La notificación debe llegar por AWS SNS.

El patrón sale prácticamente solo:

CloudTrail → CloudWatch Logs → Metric Filter → CloudWatch Alarm → SNS

CloudTrail registra los eventos de inicio de sesión en la consola,luego esos eventos llegan a CloudWatch Logs, estando allí, podemos crear un metric filter para buscar los intentos fallidos de login, convertirlos en una métrica, crear una alarma y notificar a través de AWS SNS. Y se acabó.

¿Por qué las otras son incorrectas?

A: AWS Config no es la mejor opción para estos casos, AWS Config es mejor para evaluar configuración y compliance de recursos.
C: GuardDuty no tiene que ver ni de cerca con este patrón, es mejor para detectar actividad sospechosa y generar findings.
D: IAM Access Analyzer tampoco llega a esta fiesta, su foco esanalizar accesos y políticas entre otras cositas.

Vamos a darle.

Antes OJO TÉCNICO en un ambiente real, este patrón se alimenta desde CloudTrail enviando eventos hacia CloudWatch Logs, solo para efectos de este lab no vamos a intentar fallar el login real del root user, mejor simulamos eventos con una estructura parecida a CloudTrail dentro de un log group de laboratorio. Así validamos la lógica sin tocar ni poner en riesgo tu cuenta cuenta root y MENOS LA MÍA!!! jaja.

Primero nos ubicamos en nuestra región de lab: us-east-1 (N. Virginia), este tipo de pregunta pertenece a los temas de monitoreo, detección y respuesta de la certificación AWS Certified Security – Specialty (SCS-C03).

Nuevamente, como nos estamos especializando, lo haremos en lo posible vía CLI.


Paso 1 — Preparamos las variables del lab

REGION="us-east-1"
LAB_ID="scs-root-login-alarm"

LOG_GROUP="/aws/lab/${LAB_ID}"
LOG_STREAM="simulated-cloudtrail-events"

SNS_TOPIC_NAME="${LAB_ID}-topic"


Paso 2 — Creamos el SNS topic

Debemos notificar a un SNS topic, así que vamos a crear uno.

SNS_TOPIC_ARN=$(aws sns create-topic \
  --region "$REGION" \
  --name "$SNS_TOPIC_NAME" \
  --query "TopicArn" \
  --output text)

Y luego validamos.

echo "SNS_TOPIC_ARN=$SNS_TOPIC_ARN"

Vamos a validar efectivamente que el topic existe.

aws sns get-topic-attributes \
  --region "$REGION" \
  --topic-arn "$SNS_TOPIC_ARN" \
  --query "Attributes.{TopicArn:TopicArn,DisplayName:DisplayName}" \
  --output table

La salida debe darte una tabla con 2 columnas, DisplayName y TopicArn, si es asi vamos bien.

Ahora probemos una notificación por email.

aws sns subscribe \
  --region "$REGION" \
  --topic-arn "$SNS_TOPIC_ARN" \
  --protocol email \
  --notification-endpoint "tu-correo@example.com"

Revisa el email que debió habernos llegado y confirmamos la suscripción, si no lo hacemos solo tendríamos el topic pero nunca recibiriamos la alarma por email.

Y validemos si la suscripción esta Ok

aws sns list-subscriptions-by-topic \
  --region "$REGION" \
  --topic-arn "$SNS_TOPIC_ARN" \
  --output table

Si todo esta Ok deberíamos tener como salida una tabla con todas nuestras suscripciones.


Paso 3 — Creamos el log group y log stream de laboratorio

Como te comentaba arriba, en un ambiente real, CloudTrail enviaría los eventos hacia CloudWatch Logs. Para este lab vamos a crear un log group propio y vamos a insertar eventos simulados con una estructura parecida a CloudTrail, esto nos permitirá validar la lógica sin tocar nuestro root user.

Vamos a crear el grupo, es como el contenedor principal donde viven los logs.

aws logs create-log-group \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP"

Ahora creamos el stream, es la secuencia de los eventos dentro del log group.

aws logs describe-log-groups \
  --region "$REGION" \
  --log-group-name-prefix "$LOG_GROUP" \
  --query "logGroups[*].{LogGroupName:logGroupName,CreationTime:creationTime}" \
  --output table

aws logs describe-log-streams \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --log-stream-name-prefix "$LOG_STREAM" \
  --query "logStreams[*].{LogStreamName:logStreamName,StoredBytes:storedBytes}" \
  --output table

Hasta aquí tenemos la linea base del lab, SNS topic para la notificación, los log group y los log stream donde vamos a insertar los eventos simulados.


Paso 4 — Creamos el metric filter

Ahora vamos a crear el metric filter. Aquí tomamos el patrón dentro de CloudWatch Logs y lo convertimos en una métrica. En nuestro caso, queremos contar eventos que representen un login fallido del root user.

Entonces, primero definamos las variables de la métrica:

FILTER_NAME="${LAB_ID}-filter"
METRIC_NAMESPACE="DigitalCafeLuna/Security"
METRIC_NAME="RootFailedConsoleLoginCount"

Ahora creamos el metric filter:

aws logs put-metric-filter \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --filter-name "$FILTER_NAME" \
  --filter-pattern '{ ($.eventSource = "signin.amazonaws.com") && ($.eventName = "ConsoleLogin") && ($.userIdentity.type = "Root") && ($.responseElements.ConsoleLogin = "Failure") }' \
  --metric-transformations \
      metricName="$METRIC_NAME",metricNamespace="$METRIC_NAMESPACE",metricValue=1

Validemos que quedó creado:

aws logs describe-metric-filters \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --filter-name-prefix "$FILTER_NAME" \
  --query "metricFilters[*].{FilterName:filterName,Pattern:filterPattern,MetricName:metricTransformations[0].metricName,Namespace:metricTransformations[0].metricNamespace}" \
  --output table

Si vamos bien, deberíamos ver el nombre del filtro, el patrón y la métrica asociada.


Paso 5 — Creamos la CloudWatch Alarm

Ahora que podemos convertir los eventos en métrica ,necesitamos una alarma que la evalúe.

La pregunta dice:

more than three failed console login attempts within 10 minutes

Eso se traduce en:

  • Ventana de evaluación: 10 minutos.
  • Period: 600 segundos.
  • Umbral: 3.
  • Condición: GreaterThanThreshold.
  • Acción: notificar al SNS topic.

Vamos a definir una variable con el nombre de la alarma.

ALARM_NAME="${LAB_ID}-cw-alarm"
echo "$ALARM_NAME"

Y ahora la creamos.

aws cloudwatch put-metric-alarm \
  --region "$REGION" \
  --alarm-name "$ALARM_NAME" \
  --namespace "$METRIC_NAMESPACE" \
  --metric-name "$METRIC_NAME" \
  --statistic Sum \
  --period 600 \
  --evaluation-periods 1 \
  --threshold 3 \
  --comparison-operator GreaterThanThreshold \
  --treat-missing-data notBreaching \
  --alarm-actions "$SNS_TOPIC_ARN"

Y como hemos venido haciendo en todos los labs, TODO hay que validarlo y la alarma no será la excepción.

aws cloudwatch describe-alarms \
  --region "$REGION" \
  --alarm-names "$ALARM_NAME" \
  --query "MetricAlarms[0].{AlarmName:AlarmName,State:StateValue,Threshold:Threshold,Comparison:ComparisonOperator,Period:Period,EvaluationPeriods:EvaluationPeriods,MetricName:MetricName,Namespace:Namespace}" \
  --output table


Paso 6 — Insertamos eventos simulados

Ahora vamos a insertar los eventos simulados en el log stream como hemos mencionados antes. No vamos a intentar fallar el login real del root user, vamos a crear cuatro eventos con estructura parecida a CloudTrail para validar que la métrica funciona.

cat > /tmp/root-failed-login-events.json <<EOF
[
  {
    "timestamp": $(date +%s000),
    "message": "{\"eventSource\":\"signin.amazonaws.com\",\"eventName\":\"ConsoleLogin\",\"userIdentity\":{\"type\":\"Root\"},\"responseElements\":{\"ConsoleLogin\":\"Failure\"}}"
  },
  {
    "timestamp": $(date +%s000),
    "message": "{\"eventSource\":\"signin.amazonaws.com\",\"eventName\":\"ConsoleLogin\",\"userIdentity\":{\"type\":\"Root\"},\"responseElements\":{\"ConsoleLogin\":\"Failure\"}}"
  },
  {
    "timestamp": $(date +%s000),
    "message": "{\"eventSource\":\"signin.amazonaws.com\",\"eventName\":\"ConsoleLogin\",\"userIdentity\":{\"type\":\"Root\"},\"responseElements\":{\"ConsoleLogin\":\"Failure\"}}"
  },
  {
    "timestamp": $(date +%s000),
    "message": "{\"eventSource\":\"signin.amazonaws.com\",\"eventName\":\"ConsoleLogin\",\"userIdentity\":{\"type\":\"Root\"},\"responseElements\":{\"ConsoleLogin\":\"Failure\"}}"
  }
]
EOF

aws logs put-log-events \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --log-stream-name "$LOG_STREAM" \
  --log-events file:///tmp/root-failed-login-events.json

Validemos qué eventos hay en el stream.

aws logs get-log-events \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --log-stream-name "$LOG_STREAM" \
  --limit 5 \
  --query "events[*].message" \
  --output text

Esperemos un rato para probar la alarma, anda y tómate un café, revisa el teléfono pero tranquilo que esto se puede tardar un ratito.

Validamos.

aws cloudwatch describe-alarms \
  --region "$REGION" \
  --alarm-names "$ALARM_NAME" \
  --query "MetricAlarms[0].{AlarmName:AlarmName,State:StateValue,Reason:StateReason}" \
  --output table


7 — Validamos la métrica y la alarma

En el paso anterior insertamos cuatro eventos simulados, ahora vamos a validar si CloudWatch recibió la métrica generada por el metric filter.

Calculamos una ventana de tiempo reciente como referencia.

START_TIME=$(date -u -d '15 minutes ago' +"%Y-%m-%dT%H:%M:%SZ")
END_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

echo "START_TIME=$START_TIME"
echo "END_TIME=$END_TIME"

Ahora si a consultar la métrica, deberíamos ver un datapoint con una suma cercana a 4, si todavía no aparece, puede es normal, CloudWatch puede tardar unos minutos

aws cloudwatch get-metric-statistics \
  --region "$REGION" \
  --namespace "$METRIC_NAMESPACE" \
  --metric-name "$METRIC_NAME" \
  --start-time "$START_TIME" \
  --end-time "$END_TIME" \
  --period 600 \
  --statistics Sum \
  --output table

Luego validamos nuevamente la alarma.

aws cloudwatch describe-alarms \
  --region "$REGION" \
  --alarm-names "$ALARM_NAME" \
  --query "MetricAlarms[0].{AlarmName:AlarmName,State:StateValue,Reason:StateReason}" \
  --output table

Si aparece ALARM, la lógica quedó validada:

  • Insertamos eventos simulados;
  • El metric filter hizo match;
  • La métrica subió;
  • La alarma evaluó más de 3 eventos en 10 minutos;
  • SNS quedó como acción de notificación.

Nuevamente no tocamos el login real del root user, pero sí comprobamos el patrón que la pregunta quiere evaluar: eventos tipo CloudTrail, metric filter, métrica, alarma y notificación.

Ojo: los comandos anteriores usan date -d, que funciona bien en CloudShell y Linux. Si estás en macOS local, usa esta variante:

Ahora activemos:

START_TIME=$(date -u -v-15M +"%Y-%m-%dT%H:%M:%SZ")
END_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

Y listo debió habernos llegado el email con la alarma, ¿te llego?


Primero eliminamos la alarma:

aws cloudwatch delete-alarms \
  --region "$REGION" \
  --alarm-names "$ALARM_NAME"

Eliminamos el metric filter:

aws logs delete-metric-filter \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP" \
  --filter-name "$FILTER_NAME"

Eliminamos el log group:

aws logs delete-log-group \
  --region "$REGION" \
  --log-group-name "$LOG_GROUP"

Eliminamos el SNS topic:

aws sns delete-topic \
  --region "$REGION" \
  --topic-arn "$SNS_TOPIC_ARN"

Mosca!!! No fue que se me olvidó. Al eliminar el SNS topic, también dejamos sin uso cualquier suscripción asociada al topic. No hace falta complicar el clean up con el manejo individual de suscripciones.


Cierre

Y se acabó el lab.

Si crees que este documento te ayuda, compártelo. Hay muchos compañeros con necesidad de practicar y aprender. Normalmente en los cursos no te dan este detalle, y no hablemos de cursos de plataforma, el tiempo no es su fortaleza.
Pero aquí tienes un ejercicio que puede servir para cuestionar, analizar cada línea y aprender para luego compartir.

Hasta una próxima y espero que les haya gustado.