Saltar al contenido
Skillpedia
Agentes35 mil · #8349

remediating-s3-bucket-misconfiguration

Qué hace

Esta guía enseña a corregir configuraciones incorrectas en los contenedores de almacenamiento en la nube llamados "buckets" (en concreto, buckets de S3) que podrían exponer datos sensibles. Muestra cómo bloquear el acceso público, revisar quién puede acceder a los datos y asegurar que estén protegidos.

Cuándo usarla

  • ✓Cuando una alerta indica que tus buckets de almacenamiento están abiertos al público o desprotegidos.
  • ✓Cuando necesitas demostrar en una auditoría que tus datos están seguros.
  • ✓Cuando descubres que datos importantes podrían haberse expuesto por error.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/remediating-s3-bucket-misconfiguration/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/remediating-s3-bucket-misconfiguration/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Cómo protejo mis buckets de almacenamiento en la nube que están abiertos al público?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La guía comprueba automáticamente qué buckets tienen problemas y aplica protecciones como "Block Public Access" y el cifrado. También sugiere configurar registros para saber quién accedió a qué.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Remediating S3 Bucket Misconfiguration

When to Use

  • When AWS Config or Security Hub reports S3 buckets with public access or missing encryption
  • When a security scan reveals S3 bucket policies granting access to Principal "*" (everyone)
  • When preparing for a data protection audit requiring evidence of storage security controls
  • When responding to a data exposure incident involving publicly accessible S3 objects
  • When establishing preventive controls for new S3 bucket creation across an AWS Organization

Do not use for Azure Blob Storage or GCP Cloud Storage misconfigurations, for S3 data classification (see implementing-cloud-dlp-policy), or for S3 access pattern analysis unrelated to security.

Prerequisites

  • AWS account with S3 administrative permissions (s3:, s3-outposts:)
  • AWS Config enabled to evaluate S3 resource compliance
  • AWS CloudTrail logging S3 data events for access auditing
  • Macie enabled for sensitive data discovery in S3 buckets

Workflow

Step 1: Identify All Public and Misconfigured Buckets

Use multiple detection methods to identify S3 buckets with public access. Rely on AWS Config rules, S3 Access Analyzer, and Macie rather than manual inspection.

# Enable S3 Access Analyzer for external access detection
aws accessanalyzer create-analyzer \
  --analyzer-name s3-analyzer \
  --type ACCOUNT

# List all S3 buckets with public access indicators
aws s3api list-buckets --query 'Buckets[*].Name' --output text | while read bucket; do
  public_status=$(aws s3api get-public-access-block --bucket "$bucket" 2>/dev/null)
  if [ $? -ne 0 ]; then
    echo "NO PUBLIC ACCESS BLOCK: $bucket"
  fi
done

# Check bucket policies for public access grants
aws s3api list-buckets --query 'Buckets[*].Name' --output text | while read bucket; do
  policy=$(aws s3api get-bucket-policy --bucket "$bucket" 2>/dev/null)
  if echo "$policy" | grep -q '"Principal":"*"' 2>/dev/null; then
    echo "PUBLIC POLICY DETECTED: $bucket"
  fi
done

# Use AWS Config to find non-compliant buckets
aws configservice get-compliance-details-by-config-rule \
  --config-rule-name s3-bucket-public-read-prohibited \
  --compliance-types NON_COMPLIANT \
  --query 'EvaluationResults[*].EvaluationResultIdentifier.EvaluationResultQualifier.ResourceId'

Step 2: Enable S3 Block Public Access at Account Level

Apply the four Block Public Access settings at the AWS account level as a safety net. This prevents any bucket in the account from being made public, regardless of individual bucket policies or ACLs.

# Enable account-level Block Public Access (all four settings)
aws s3control put-public-access-block \
  --account-id 123456789012 \
  --public-access-block-configuration '{
    "BlockPublicAcls": true,
    "IgnorePublicAcls": true,
    "BlockPublicPolicy": true,
    "RestrictPublicBuckets": true
  }'

# Verify account-level settings
aws s3control get-public-access-block --account-id 123456789012

# Enable at bucket level for defense in depth
aws s3api put-public-access-block \
  --bucket production-data-bucket \
  --public-access-block-configuration '{
    "BlockPublicAcls": true,
    "IgnorePublicAcls": true,
    "BlockPublicPolicy": true,
    "RestrictPublicBuckets": true
  }'

Step 3: Audit and Remediate Bucket Policies and ACLs

Review all bucket policies for overly permissive Principal statements and remove legacy ACLs. Enforce bucket ownership controls to disable ACLs entirely.

# Remove a public bucket policy
aws s3api delete-bucket-policy --bucket exposed-bucket

# Replace with a restrictive policy
aws s3api put-bucket-policy --bucket exposed-bucket --policy '{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyUnencryptedTransport",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::exposed-bucket",
        "arn:aws:s3:::exposed-bucket/*"
      ],
      "Condition": {
        "Bool": {"aws:SecureTransport": "false"}
      }
    },
    {
      "Sid": "AllowOnlyVPCEndpoint",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::exposed-bucket",
        "arn:aws:s3:::exposed-bucket/*"
      ],
      "Condition": {
        "StringNotEquals": {"aws:SourceVpce": "vpce-0abc123def456"}
      }
    }
  ]
}'

# Enforce bucket owner for all objects (disable ACLs)
aws s3api put-bucket-ownership-controls --bucket exposed-bucket \

…
Preguntas frecuentes

¿Qué son los buckets de S3?

Son como 'cajas' digitales de la nube de Amazon Web Services (AWS) donde puedes guardar archivos y datos.

¿Qué significa "configuración incorrecta"?

Significa que los ajustes de seguridad de esos buckets no son correctos, lo que podría dejar tus datos vulnerables.

¿Necesito ser experto en informática para usar esto?

Esta guía está pensada para ayudar incluso a quienes no tienen experiencia en programación, guiándote paso a paso.

Detalles

Descripción original del autor

Provides step-by-step procedures for remediating Amazon S3 bucket misconfigurations that expose sensitive data: enabling S3 Block Public Access, auditing bucket policies and ACLs, enforcing encryption, configuring access logging, and deploying automated remediation with AWS Config and Lambda. Use when AWS Config or Security Hub flags public or unencrypted S3 buckets, or preparing audit evidence fo

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8349
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas