본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트35k · #8273

performing-oauth-scope-minimization-review

하는 일

이 도구는 내 데이터에 접근하는 제3자 애플리케이션에 부여된 권한을 검토합니다. 이 앱들이 필요 이상의 접근 권한을 가졌는지, 사용하지 않는 권한이 있는지, 위험한 동의 패턴이 있는지 확인합니다.

사용하는 경우

  • ✓앱 권한을 매년 검토할 때.
  • ✓액세스 토큰과 관련된 보안 사고가 발생한 뒤.
  • ✓GDPR 같은 규정 준수 감사를 위한 경우.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-oauth-scope-minimization-review/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-oauth-scope-minimization-review/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“모든 제3자 애플리케이션의 접근 권한을 검토해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 부여된 모든 애플리케이션 권한에 대한 정보를 모읍니다. 그다음 위험도에 따라 분류해, 과도하거나 불필요한 접근을 식별하고 제거하는 데 도움을 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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,

…
자주 묻는 질문

OAuth ‘스코프(권한)’란 무엇인가요?

애플리케이션이 사용자를 대신해 할 수 있거나 접근할 수 있는 범위를 정의하는 ‘열쇠’와 같습니다. 예를 들어 이메일 읽기나 연락처 접근이 있습니다.

이 권한들을 검토하는 것이 왜 중요한가요?

필요한 앱만 데이터에 접근하고 과도한 권한이 없도록 보장해 보안 위험을 줄이기 위해서입니다.

이 도구가 권한을 자동으로 제거하나요?

아니요. 도구는 위험과 과도한 권한을 식별하지만, 권한 제거나 조정은 보통 관리자가 직접 해야 합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
35k
순위
#8273
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬