Saltar al contenido
Skillpedia
Análisis y hojas de cálculo35 mil · #8273

performing-oauth-scope-minimization-review

Qué hace

Esta herramienta revisa los permisos que se han concedido a aplicaciones de terceros que acceden a tus datos. Comprueba si estas apps tienen más acceso del necesario, si hay permisos que no se usan o si se han dado consentimientos arriesgados.

Cuándo usarla

  • ✓Cuando revises los permisos de las apps una vez al año.
  • ✓Después de un incidente de seguridad con tokens de acceso.
  • ✓Para auditorías de cumplimiento (como el RGPD).

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-oauth-scope-minimization-review/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/performing-oauth-scope-minimization-review/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

“Revisa los permisos de acceso de todas las aplicaciones de terceros.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta recopila información sobre todos los permisos de aplicaciones concedidos. Después los clasifica según el riesgo, lo que ayuda a identificar y eliminar accesos excesivos o innecesarios.

Contenido técnico (SKILL.md original)

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

Performing OAuth Scope Minimization Review

When to Use

  • Annual or quarterly review of third-party application OAuth permissions
  • After a security incident involving compromised OAuth tokens or unauthorized data access
  • Compliance audit requiring documentation of third-party data access (GDPR Article 28, SOC 2)
  • Discovery of shadow IT applications accessing organizational data via OAuth grants
  • Migration or consolidation of SaaS applications requiring permission cleanup
  • Implementing least-privilege principle for API integrations

Do not use for reviewing first-party application permissions within the same trust boundary; OAuth scope minimization focuses on third-party and cross-boundary consent grants.

Prerequisites

  • Admin access to identity providers (Microsoft Entra ID, Okta, Google Workspace)
  • Microsoft Graph API permissions: Application.Read.All, OAuth2PermissionGrant.ReadWrite.All
  • Inventory of approved third-party integrations from procurement or IT governance
  • OAuth scope risk classification framework
  • Tools for token analysis (jwt.io for manual review, automated scripts for bulk analysis)

Workflow

Step 1: Inventory All OAuth Grants and Consent Permissions

Enumerate all OAuth application registrations and delegated permissions:

"""
OAuth Grant Inventory - Microsoft Entra ID
Enumerates all application registrations, service principals,
and delegated/application permission grants.
"""
import requests
import json
from collections import defaultdict

class EntraOAuthAuditor:
    def __init__(self, tenant_id, client_id, client_secret):
        self.tenant_id = tenant_id
        self.base_url = "https://graph.microsoft.com/v1.0"
        self.token = self._get_token(client_id, client_secret)
        self.headers = {"Authorization": f"Bearer {self.token}"}

    def _get_token(self, client_id, client_secret):
        url = f"https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token"
        response = requests.post(url, data={
            "grant_type": "client_credentials",
            "client_id": client_id,
            "client_secret": client_secret,
            "scope": "https://graph.microsoft.com/.default"
        })
        return response.json()["access_token"]

    def get_all_service_principals(self):
        """Get all service principals (enterprise applications)."""
        apps = []
        url = f"{self.base_url}/servicePrincipals?$top=999&$select=id,appId,displayName,appOwnerOrganizationId,servicePrincipalType,accountEnabled,createdDateTime"

        while url:
            response = requests.get(url, headers=self.headers)
            data = response.json()
            apps.extend(data.get("value", []))
            url = data.get("@odata.nextLink")

        return apps

    def get_oauth2_permission_grants(self):
        """Get all delegated permission grants (user consent)."""
        grants = []
        url = f"{self.base_url}/oauth2PermissionGrants?$top=999"

        while url:
            response = requests.get(url, headers=self.headers)
            data = response.json()
            grants.extend(data.get("value", []))
            url = data.get("@odata.nextLink")

        return grants

    def get_app_role_assignments(self, sp_id):
        """Get application permission assignments for a service principal."""
        url = f"{self.base_url}/servicePrincipals/{sp_id}/appRoleAssignments"
        response = requests.get(url, headers=self.headers)
        return response.json().get("value", [])

    def build_permission_inventory(self):
        """Build comprehensive OAuth permission inventory."""
        service_principals = self.get_all_service_principals()
        delegated_grants = self.get_oauth2_permission_grants()

        # Map service principal IDs to names
        sp_map = {sp["id"]: sp for sp in service_principals}

        inventory = []

        # Process delegated permissions
        for grant in delegated_grants:
            sp = sp_map.get(grant["clientId"], {})
            scopes = grant.get("scope", "").split()

            for scope in scopes:
                if not scope:
                    continue
                inventory.append({
                    "app_name": sp.get("displayName", "Unknown"),
                    "app_id": grant.get("clientId"),
                    "publisher_tenant": sp.get("appOwnerOrganizationId"),
                    "is_third_party": sp.get("appOwnerOrganizationId") != self.tenant_id,

…
Preguntas frecuentes

¿Qué son los 'scopes' (permisos) de OAuth?

Los scopes son como 'llaves' que definen lo que una aplicación puede hacer o a qué puede acceder en tu nombre (por ejemplo, leer tu correo o acceder a tus contactos).

¿Por qué es importante revisar estos permisos?

Revisarlos asegura que solo las apps necesarias tengan acceso a tus datos y que no tengan permisos excesivos, lo que puede suponer un riesgo para la seguridad.

¿Esta herramienta elimina permisos automáticamente?

No. La herramienta identifica riesgos y excesos, pero quitar o ajustar los permisos normalmente requiere que un administrador lo haga manualmente.

Detalles

Descripción original del autor

Performs OAuth 2.0 scope minimization review to identify over-permissioned third-party application integrations, excessive API scopes, unused token grants, and risky OAuth consent patterns across identity providers and SaaS platforms. Activates for requests involving OAuth scope audit, API permission review, third-party app risk assessment, or consent grant minimization. '

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8273
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