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

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
W
WeLiveSecurity
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
A
Arctic Wolf
NISL@THU
NISL@THU
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
M
MIT News - Artificial intelligence
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
G
GRAHAM CLULEY
O
OpenAI News
S
Schneier on Security
Google Online Security Blog
Google Online Security Blog
Vercel News
Vercel News
宝玉的分享
宝玉的分享
Attack and Defense Labs
Attack and Defense Labs
T
The Blog of Author Tim Ferriss
量子位
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
P
Privacy & Cybersecurity Law Blog
S
SegmentFault 最新的问题
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 热门话题
博客园_首页
F
Full Disclosure
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Docker
U
Unit 42
A
About on SuperTechFans
博客园 - 司徒正美
Hacker News - Newest:
Hacker News - Newest: "LLM"
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog

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
SCS-Lab1 — CloudTrail: Trail + S3 + KMS + Log Validation
Luis Eduardo Lunar Guevara · 2026-05-26 · via DEV Community

Región: us-east-1

Duración estimada: 35–55 minutos

Costo-riesgo: Medio

Certificación: AWS Certified Security - Specialty (SCS-C03)

Dominio: Detection

Tarea 1.2: Design and implement logging solutions

Caso de uso

Digital Cafe Luna ya superó sus primeros tropiezos operativos. La aplicación que apoya facturación e inventario funciona mejor, el negocio va creciendo y ahora más personas interactúan en la plataforma. Robert, compañero de estudio de Camilo, también está colaborando con algunos ajustes técnicos.

Un día, la Sra. Blanca nota un comportamiento extraño en el aplicativo y hace la pregunta incómoda:

“¿Quién cambió qué y cuándo?”

Camilo duda. No sabe si el cambio lo hizo él, Robert o algún proceso de la cuenta. Ahí entiende algo clave: no basta con tener recursos funcionando, se necesita trazabilidad para investigar cambios, responder con evidencia y proteger los registros que cuentan la historia de lo ocurrido.

Sin auditoría, investigar se vuelve opinión.

En este laboratorio vamos a construir un baseline de auditoría en una sola cuenta AWS usando AWS CloudTrail, Amazon S3, AWS KMS y log file validation. No es una estrategia multi-account todavía; es la base para registrar actividad, almacenar logs, cifrarlos y validar su integridad.

¿Qué vamos a construir?

En este laboratorio vas a crear:

  • Un CloudTrail Trail multi-region.
  • Un bucket S3 dedicado para logs.
  • Bloqueo de acceso público y versioning en S3.
  • Una KMS key administrada por el cliente.
  • Una key policy para permitir uso desde CloudTrail.
  • Log file validation.
  • Una prueba controlada para buscar evidencia en CloudTrail.
  • Cleanup completo.

Diagrama SCS-Lab1 — CloudTrail: Trail + S3 + KMS + Log Validation

Figura 1 — CloudTrail registra actividad, entrega logs en S3, los protege con KMS y habilita validación de integridad.

Nota de alcance

Este laboratorio se ejecuta en una sola cuenta AWS. Más adelante puede evolucionar hacia un Organization Trail, pero aquí nos enfocamos en el fundamento: crear el trail, enviar logs a S3, cifrarlos y validar integridad.

Convención de nombres

Recurso Nombre
CloudTrail Trail scs-lab1-trail
S3 Bucket scs-lab1-cloudtrail-logs-<tu-alias>-<4digitos>
KMS Key Alias alias/scs-lab1-cloudtrail
S3 Prefix cloudtrail/

Nota práctica: el bucket de S3 debe tener un nombre único globalmente, por eso usamos <tu-alias>-<4digitos>.

Requisitos previos

  • Cuenta AWS con permisos para CloudTrail, S3 y KMS.
  • Región us-east-1.
  • Acceso a AWS Console y CloudShell o AWS CLI local.
  • Un sufijo único para el bucket. Ejemplo: camilo-4721.
  • Entender que este lab es single account.

Ojo: este laboratorio toca KMS. Si tu cuenta tiene políticas restrictivas, lo más común es fallar por permisos en la key policy.


Paso 1 — Crear el bucket S3 para los logs

CloudTrail necesita un destino para entregar logs. Usaremos un bucket dedicado, con acceso público bloqueado y versioning habilitado.

Crear el bucket desde la consola

En AWS Console:

  • Ve a S3 → Buckets.
  • Selecciona Create bucket.
  • Usa el nombre scs-lab1-cloudtrail-logs-<tu-alias>-<4digitos>.
  • Región: us-east-1.
  • Deja Block Public Access habilitado.
  • En Bucket Versioning, selecciona Enable.
  • Crea el bucket.

CLI opcional

REGION="us-east-1"
LAB_ID="scs-lab1"
ALIAS="camilo"
SUFFIX="4721"

BUCKET="${LAB_ID}-cloudtrail-logs-${ALIAS}-${SUFFIX}"

aws s3api create-bucket \
  --region "$REGION" \
  --bucket "$BUCKET"

aws s3api put-public-access-block \
  --region "$REGION" \
  --bucket "$BUCKET" \
  --public-access-block-configuration \
  BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

aws s3api put-bucket-versioning \
  --region "$REGION" \
  --bucket "$BUCKET" \
  --versioning-configuration Status=Enabled

aws s3api put-bucket-tagging \
  --region "$REGION" \
  --bucket "$BUCKET" \
  --tagging "TagSet=[{Key=Name,Value=${LAB_ID}-cloudtrail-logs},{Key=Lab,Value=${LAB_ID}}]"

aws s3api get-bucket-versioning \
  --region "$REGION" \
  --bucket "$BUCKET"

aws s3api get-public-access-block \
  --region "$REGION" \
  --bucket "$BUCKET"

Checkpoint

Valida que:

  • El bucket existe en us-east-1.
  • Block Public Access está activo.
  • Bucket Versioning está en Enabled.
  • El bucket tiene el tag Lab=scs-lab1.

Paso 2 — Crear la KMS key

Ahora crearemos una KMS key administrada por el cliente para cifrar los logs de CloudTrail con SSE-KMS.

Crear la KMS key desde la consola

En AWS Console:

  • Ve a KMS → Customer managed keys.
  • Selecciona Create key.
  • Tipo: Symmetric.
  • Uso: Encrypt and decrypt.
  • Alias: alias/scs-lab1-cloudtrail.
  • En Key administrators, selecciona tu usuario o rol administrador.
  • En Key users, agrega también tu usuario o rol administrador.
  • Crea la key.

Agregar permiso para CloudTrail

En la key:

  • Entra a Key policy.
  • Selecciona Edit.
  • Agrega este statement sin eliminar los permisos administrativos existentes.
{
  "Sid": "AllowCloudTrailToUseTheKey",
  "Effect": "Allow",
  "Principal": {
    "Service": "cloudtrail.amazonaws.com"
  },
  "Action": [
    "kms:GenerateDataKey*",
    "kms:Encrypt",
    "kms:Decrypt",
    "kms:DescribeKey"
  ],
  "Resource": "*"
}

Ojo: el principal debe ser cloudtrail.amazonaws.com como Service principal.

CLI opcional para validar

REGION="us-east-1"

aws kms describe-key \
  --region "$REGION" \
  --key-id "alias/scs-lab1-cloudtrail" \
  --query "{KeyId:KeyMetadata.KeyId,Arn:KeyMetadata.Arn,State:KeyMetadata.KeyState,Usage:KeyMetadata.KeyUsage}" \
  --output table

aws kms list-aliases \
  --region "$REGION" \
  --query "Aliases[?AliasName=='alias/scs-lab1-cloudtrail'].[AliasName,TargetKeyId]" \
  --output table

Checkpoint

Valida que:

  • La key está en estado Enabled.
  • El alias existe.
  • Tu usuario o rol conserva permisos.
  • La key policy permite uso desde CloudTrail.

Paso 3 — Crear el CloudTrail Trail multi-region

Ahora vamos a crear el trail para registrar actividad de la cuenta y conservar evidencia en S3.

Crear el trail desde la consola

En AWS Console:

  • Ve a CloudTrail → Trails.
  • Selecciona Create trail.
  • Nombre: scs-lab1-trail.
  • En Storage location, selecciona Use existing S3 bucket.
  • Elige el bucket del lab.
  • Si usas prefijo, coloca cloudtrail.
  • Habilita Log file SSE-KMS encryption.
  • Selecciona alias/scs-lab1-cloudtrail.
  • Habilita Log file validation.
  • Asegúrate de que sea multi-region.

En eventos:

  • Management events: habilitado.
  • Read: habilitado.
  • Write: habilitado.
  • Data events: deshabilitado.
  • Insights events: deshabilitado.
  • Network activity events: deshabilitado.

CLI opcional para validar

REGION="us-east-1"

aws cloudtrail describe-trails --region "$REGION" \
  --query "trailList[?Name=='scs-lab1-trail'].[Name,S3BucketName,IsMultiRegionTrail,KmsKeyId,LogFileValidationEnabled]" \
  --output table

aws cloudtrail get-trail-status --region "$REGION" \
  --name "scs-lab1-trail" \
  --query "{IsLogging:IsLogging,LatestDeliveryTime:LatestDeliveryTime,LatestDigestDeliveryTime:LatestDigestDeliveryTime,LatestDeliveryError:LatestDeliveryError}" \
  --output table

Checkpoint

Valida que:

  • IsMultiRegionTrail aparece como true.
  • LogFileValidationEnabled aparece como true.
  • IsLogging aparece como true.
  • LatestDeliveryError está vacío o sin errores relevantes.

Paso 4 — Generar un evento y confirmar entrega

Crear CloudTrail no basta. Hay que validar que registra eventos y entrega logs en S3.

Acción en AWS → CloudTrail → S3 bucket → Evidencia disponible

Generar un evento desde la consola

Puedes crear una access key temporal solo como evento de prueba:

  • Ve a IAM → Users.
  • Selecciona tu usuario.
  • Entra a Security credentials.
  • En Access keys, selecciona Create access key.
  • Crea la key solo para generar el evento.
  • No la uses para nada productivo.

Ojo: elimina esta access key en el cleanup.

También puedes usar un cambio menor, como agregar un tag no crítico.

Validar entrega por CLI

REGION="us-east-1"

aws cloudtrail get-trail-status --region "$REGION" \
  --name "scs-lab1-trail" \
  --query "{IsLogging:IsLogging,LatestDeliveryTime:LatestDeliveryTime,LatestDeliveryError:LatestDeliveryError}" \
  --output table

Ajusta BUCKET con tu bucket real:

REGION="us-east-1"
BUCKET="scs-lab1-cloudtrail-logs-camilo-4721"
ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"

aws s3 ls "s3://$BUCKET/cloudtrail/AWSLogs/$ACCOUNT_ID/" \
  --recursive \
  --human-readable \
  --summarize | tail -n 20

Si no usaste prefijo:

aws s3 ls "s3://$BUCKET/AWSLogs/$ACCOUNT_ID/" \
  --recursive \
  --human-readable \
  --summarize | tail -n 20


Paso 5 — Verificar cifrado y log file validation

Ahora validamos que los logs estén cifrados con SSE-KMS y que CloudTrail genere archivos digest para integridad.

Validar desde la consola

En AWS Console:

  • Ve a CloudTrail → Trails.
  • Abre scs-lab1-trail.
  • Valida:
    • Log file SSE-KMS encryption: Enabled.
    • AWS KMS key: alias/scs-lab1-cloudtrail.
    • Log file validation: Enabled.

Confirmar por CLI

REGION="us-east-1"

aws cloudtrail describe-trails --region "$REGION" \
  --query "trailList[?Name=='scs-lab1-trail'].[Name,IsMultiRegionTrail,LogFileValidationEnabled,KmsKeyId,S3BucketName,S3KeyPrefix]" \
  --output table

Verifica objetos digest:

BUCKET="scs-lab1-cloudtrail-logs-camilo-4721"
ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"

aws s3 ls "s3://$BUCKET/cloudtrail/AWSLogs/$ACCOUNT_ID/CloudTrail-Digest/" \
  --recursive | tail -n 10

Verifica cifrado en un objeto real:

BUCKET="scs-lab1-cloudtrail-logs-camilo-4721"
ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"

OBJ_KEY=$(aws s3api list-objects-v2 \
  --bucket "$BUCKET" \
  --prefix "cloudtrail/AWSLogs/$ACCOUNT_ID/CloudTrail/" \
  --query "reverse(sort_by(Contents,&LastModified))[0].Key" \
  --output text)

echo "$OBJ_KEY"

aws s3api head-object \
  --bucket "$BUCKET" \
  --key "$OBJ_KEY" \
  --query "{SSE:ServerSideEncryption,KMSKey:SSEKMSKeyId}" \
  --output table

Salida esperada:

SSE     aws:kms
KMSKey  arn:aws:kms:...


Paso 6 — Buscar el cambio en CloudTrail

Ahora usamos CloudTrail para responder con evidencia:

“¿Quién cambió qué y cuándo?”

Buscar desde la consola

En AWS Console:

  • Ve a CloudTrail → Event history.
  • En Lookup attributes, filtra según la acción.
  • Si creaste una access key, busca:
    • Event name: CreateAccessKey.
    • Event name: DeleteAccessKey, si ya la eliminaste.
  • Abre el evento y revisa:
    • Event name
    • Event time
    • User name / ARN
    • Source IP address
    • AWS Region
    • User agent

Buscar por CLI

REGION="us-east-1"

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

aws cloudtrail lookup-events --region "$REGION" \
  --start-time "$START_TIME" \
  --max-results 10 \
  --query "Events[].{Time:EventTime,Name:EventName,User:Username,EventId:EventId}" \
  --output table

Por evento específico:

REGION="us-east-1"

aws cloudtrail lookup-events --region "$REGION" \
  --lookup-attributes AttributeKey=EventName,AttributeValue=CreateAccessKey \
  --max-results 5 \
  --query "Events[].{Time:EventTime,Name:EventName,User:Username,EventId:EventId}" \
  --output table

Detalle del evento:

REGION="us-east-1"

aws cloudtrail lookup-events --region "$REGION" \
  --lookup-attributes AttributeKey=EventName,AttributeValue=CreateAccessKey \
  --max-results 1 \
  --query "Events[0].CloudTrailEvent" \
  --output text

Ojo: si estás en Mac y date -d no funciona, ejecuta esa parte desde CloudShell o ajusta el cálculo de tiempo.


Clean up completo — SCS-Lab1

Elimina los recursos para evitar costos y mantener la cuenta limpia.

Recursos a eliminar

  • CloudTrail Trail: scs-lab1-trail
  • S3 Bucket: scs-lab1-cloudtrail-logs-<tu-alias>-<4digitos>
  • KMS Key: alias/scs-lab1-cloudtrail
  • Access key temporal: si la creaste

Orden recomendado

  • Elimina la access key temporal.
  • Elimina el CloudTrail Trail.
  • Vacía y elimina el S3 Bucket.
  • Agenda la eliminación de la KMS Key.

Desde la consola

  • En CloudTrail → Trails, elimina scs-lab1-trail.
  • En S3 → Buckets, vacía y elimina el bucket del lab.
  • En KMS → Customer managed keys, selecciona la key y usa Schedule key deletion.

Ojo: si versioning está habilitado, revisa versiones y delete markers antes de eliminar el bucket.

CLI opcional para validar cleanup

REGION="us-east-1"

aws cloudtrail describe-trails --region "$REGION" \
  --query "trailList[?Name=='scs-lab1-trail'].[Name]" \
  --output table

BUCKET="scs-lab1-cloudtrail-logs-camilo-4721"

if aws s3api head-bucket --bucket "$BUCKET" 2>/dev/null; then
  echo "Bucket aún existe: $BUCKET"
else
  echo "Bucket eliminado o no accesible: $BUCKET"
fi

REGION="us-east-1"

aws kms describe-key \
  --region "$REGION" \
  --key-id "alias/scs-lab1-cloudtrail" \
  --query "{KeyId:KeyMetadata.KeyId,State:KeyMetadata.KeyState,DeletionDate:KeyMetadata.DeletionDate}" \
  --output table


Troubleshooting rápido

  • CloudTrail no entrega logs en S3: revisa LatestDeliveryError, bucket policy, prefijo y KMS.
  • KMS policy falla: valida Principal.Service = cloudtrail.amazonaws.com.
  • No aparecen objetos digest: espera unos minutos y confirma que ya llegan logs normales.
  • OBJ_KEY sale como None: revisa si usaste prefijo cloudtrail.
  • El bucket no se deja borrar: elimina contenido, versiones y delete markers.
  • No puedes agendar eliminación de la KMS key: valida que sigues siendo administrador de la key.

Well-Architected lens: ¿Qué aplicamos aquí?

  • Security: pasamos de sospechas a evidencia verificable.
  • Operational Excellence: dejamos un flujo repetible de investigación.
  • Reliability: reducimos cambios silenciosos sin trazabilidad.
  • Cost Optimization: mantenemos el lab autocontenido y con cleanup completo.
  • Performance Efficiency: evitamos data events e Insights para no recolectar señales innecesarias.

Resultado esperado

Al finalizar deberías poder crear un baseline de auditoría en una cuenta AWS: trail multi-region, logs en S3, cifrado con KMS, validación de integridad, búsqueda de eventos y cleanup completo.

La idea no era solo “prender CloudTrail”, sino dejar evidencia auditable, protegida y verificable.

Al final, Camilo puede responder con más claridad:

“¿Quién cambió qué y cuándo?”


Referencias oficiales


¿Qué viene en el próximo lab?

Digital Cafe Luna ya tiene una base de auditoría en una sola cuenta. El siguiente paso es prepararse para un reto real: escalar

SAA-Lab1 — Scaling en AWS (baseline): ALB + Auto Scaling + CloudFront

Montaremos un baseline de escalamiento con balanceo, escalado automático y caché en el borde, usando el dominio por defecto de CloudFront.

Nos vemos en el próximo laboratorio de Digital Cafe Luna.