> For the complete documentation index, see [llms.txt](https://docs.stoik.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoik.io/help/help-center-en-es/herramientas-de-prevencion/cloud-scan/aws.md).

# Configuración: AWS

Concede al análisis en la nube acceso de solo lectura a una cuenta de AWS creando una política y un rol, y luego pegando el ARN del rol en Stoïk Protect.

## Requisitos previos

* Una cuenta de administrador en la cuenta de AWS que se va a analizar.
* Si utilizas AWS Organizations, tus Service Control Policies (SCP) no deben bloquear los permisos de solo lectura siguientes. Las SCP son la causa más común de fallos de configuración, consulta [Solución de problemas](#troubleshooting).
* Se requiere un asesor técnico para la supervisión continua y la remediación de vulnerabilidades.
* Una sola persona realiza toda la configuración, de principio a fin: un usuario de Stoïk Protect autorizado para editar herramientas de prevención, que además es administrador de la cuenta de AWS.

## Configuración

{% stepper %}
{% step %}

### Selecciona Amazon Web Services

Ve a `Cloud Scan` > `Configuración`, haz clic en `Nuevo proveedor`, y selecciona `AWS`.

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FL48UGpzqbZCjyJWwIZd1%2FScreenshot%202026-04-07%20at%2018.48.29.png?alt=media&amp;token=205ab9b0-31ea-4328-8a16-2afa1bdc2162" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Crear una nueva política

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FivaUKKzBa0gW0H6BRi2M%2FScreenshot%202026-04-07%20at%2018.48.55.png?alt=media&amp;token=a8b07550-2f4f-439f-a88b-17314ceeac29" alt=""><figcaption></figcaption></figure>

#### Configura la política

1. Vaya al [Creador de políticas de AWS](https://console.aws.amazon.com/iam/home?#/policies$new?step=edit) e inicie sesión con su cuenta de administrador.
2. Haz clic en la pestaña `JSON` y pega la siguiente política en el editor:

   ```json
   {
     "Version": "2012-10-17",
     "Statement": [
       {
         "Effect": "Allow",
         "Action": [
           "ecr:BatchGetRepositoryScanningConfiguration",
           "ecr:DescribeImageScanFindings",
           "ecr:DescribeImages",
           "dynamodb:ListTagsOfResource",
           "ecr:ListTagsForResource",
           "inspector2:BatchGet*",
           "inspector2:Get*",
           "inspector2:Describe*",
           "inspector2:List*",
           "sqs:ListQueueTags",
           "sso:Describe*",
           "sso:List*"
         ],
         "Resource": "*"
       },
       {
         "Effect": "Deny",
         "Action": [
           "datapipeline:EvaluateExpression",
           "datapipeline:QueryObjects",
           "rds:DownloadDBLogFilePortion"
         ],
         "Resource": "*"
       }
     ]
   }
   ```
3. Haga clic en `Siguiente`.

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fx9ykOc6VoV6cuAGIaXYb%2Faws-create-policy.png?alt=media&amp;token=140fe2ed-5cbd-43b0-b296-6efb60a60018" alt=""><figcaption></figcaption></figure>

#### Guarda la política

1. Nombra la política `StoikAdditionalPermissions`.
2. Haga clic en `Crear política`.

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FNpe6hR0vOQiCv87lK1DO%2Faws-create-policy-validation.png?alt=media&amp;token=855b079e-873d-4582-a215-e170c64249c7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FoANQIZUox1pOS263nogA%2Faws-create-policy-button.png?alt=media&amp;token=2d52294d-7aeb-4ee8-92cb-fcd24c57a328" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Crear un nuevo rol

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FfUh2nx1vfzxqe3rKTvTZ%2FScreenshot%202026-04-07%20at%2018.50.39.png?alt=media&amp;token=0307ddd7-b07d-4d5e-9c08-addbf5814ebc" alt=""><figcaption></figcaption></figure>

#### Configura la confianza del rol

1. Vaya al [Creador de roles de AWS](https://us-east-1.console.aws.amazon.com/iamv2/home#/roles/create?step=selectEntities).
2. Haga clic en `Cuenta de AWS`, y luego `Otra cuenta de AWS`, e introduce el siguiente ID de cuenta:

   ```
   436578779424
   ```
3. Seleccionar `Requiere ID externo` y copia el valor que se muestra en la consola de Stoïk Protect.
4. Haga clic en `Siguiente`.

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FPtqCLbhc6EubRg0FAKJh%2Faws-create-role.png?alt=media&amp;token=ec01ef82-a562-4c76-9029-3af1904bcad2" alt=""><figcaption></figcaption></figure>

#### Asigna permisos y finaliza

1. Seleccionar `StoikAdditionalPermissions` y `SecurityAudit` como permisos.
2. Haga clic en `Siguiente`.
3. Introduce `stoik-auditor` como nombre del rol.
4. Haga clic en `Crear rol`.

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fgit-blob-2794beb9987fd6c3fbc6d1381d782094e37a0f5c%2FCapture%20d%E2%80%99%C3%A9cran%202026-05-29%20%C3%A0%2017.34.12.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fgit-blob-8eb6ce6816a9efa007029ca8e39e3a2ba30a5bfd%2FCapture%20d%E2%80%99%C3%A9cran%202026-05-29%20%C3%A0%2017.36.16.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fgit-blob-89e73e7eac5001395f4b17220469b4dd16428864%2FCapture%20d%E2%80%99%C3%A9cran%202026-05-29%20%C3%A0%2017.40.03.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Añade un identificador ARN

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2F94ToUKwUHjDp3oDbMGwC%2FScreenshot%202026-04-07%20at%2018.51.37.png?alt=media&amp;token=a0b5b107-57e3-44a2-a094-164fac87050b" alt=""><figcaption></figcaption></figure>

1. Vaya al `stoik-auditor` del rol que acabas de crear.
2. Copia la referencia `ARN` .

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fgit-blob-694a0c3196cb783df765b0e5e51364bfdedd2556%2FCapture%20d%E2%80%99%C3%A9cran%202026-05-29%20%C3%A0%2017.44.21.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1731397918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Fgit-blob-1f1c9950b3489ea4d1572e1acb6c4e87f34a3f33%2FCapture%20d%E2%80%99%C3%A9cran%202026-05-29%20%C3%A0%2017.45.04.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Complete la configuración

1. Pega la `ARN` referencia en el campo dedicado de la consola de Stoïk Protect.
2. Haga clic en `Completar configuración`.

{% hint style="info" %}
Actualice la página de Stoïk Protect si es necesario.
{% endhint %}
{% endstep %}
{% endstepper %}

## AWS Organizations

Con AWS Organizations, crea el `stoik-auditor` rol en cada cuenta miembro que quieras analizar, no solo en la cuenta de administración. Todos los permisos solicitados son de solo lectura: la `SecurityAudit` política administrada por AWS más `StoikAdditionalPermissions`. No hay un conjunto más pequeño.

## Solución de problemas

<details>

<summary>"La integración con AWS falló" / "No se puede asumir el rol"</summary>

Comprueba esto en orden, empezando por lo más común:

1. **ID externo:** el valor en Stoïk Protect debe coincidir exactamente con el `sts:ExternalId` en la política de confianza del rol. La distinción entre mayúsculas y minúsculas, y los espacios, cuentan. Un ID externo de un intento anterior también falla.
2. **Cuenta de confianza:** la política de confianza confía en la cuenta `436578779424`.
3. **Rol:** `stoik-auditor` existe en esa cuenta, y el ARN pegado en Stoïk Protect es su ARN. Para un rol que no existe, AWS responde "acceso denegado", no "no encontrado".
4. **Políticas:** ambas `SecurityAudit` y `StoikAdditionalPermissions` están adjuntas, y la última coincide con el JSON anterior. Las configuraciones antiguas suelen carecer de `sso:Describe*` y `sso:List*`.

</details>

<details>

<summary>Todo es correcto, pero la configuración sigue diciendo "los roles no están configurados correctamente"</summary>

Esto suele ser una Service Control Policy (SCP). Antes de aceptar una cuenta, Stoïk comprueba su rol con el simulador de permisos de AWS, y algunas SCP hacen que ese simulador rechace todos los permisos, aunque el análisis real funcione. Ponte en contacto con <protect@stoik.io> con tu ID de cuenta de AWS.

</details>

<details>

<summary>El análisis funcionó y luego se detuvo</summary>

Algo cambió de tu lado: se eliminó o renombró el rol, se desasoció una política, cambió el ID externo o se añadió una nueva SCP. Revisa las cuatro comprobaciones en ["La integración con AWS falló" / "No se puede asumir el rol"](#integration-with-aws-failed--unable-to-assume-role).

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stoik.io/help/help-center-en-es/herramientas-de-prevencion/cloud-scan/aws.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
