# Roles con permisos excesivos

Si un rol cuenta con permisos de lectura en recursos que cuentan con claves secretas o información sensible. Se podría obtener dicha información realizando una petición que obtenga la información de los parámetros sobre recursos donde se tengan más permisos de los necesarios.

* Obtener los recursos:

```powershell
Get-AzResource
```

* Obtener los roles asignados a un recurso:

{% code overflow="wrap" %}

```powershell
Get-AzRoleAssignment -Scope '/subscriptions/b414826f-108d-4045-8c11-d52d5d388738/resourceGroups/RESEARCH/providers/Microsoft.Compute/virtualMachines/vmtest'
```

{% endcode %}

* De los roles obtenidos, se pueden visualizar las acciones permitidas:

```powershell
Get-AzRoleDefinition -Name "Virtual Machine Execute Commands"
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.xtormin.com/pentesting-en-infraestructuras/cloud/azure/metodologia-de-azure-pentest/acceso-inicial/roles-con-permisos-excesivos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
