본문으로 건너뛰기
Skillpedia
보안35k · #7710

building-role-mining-for-rbac-optimization

하는 일

이 도구는 시스템에서 사람들이 접근 권한을 어떻게 사용하는지 분석합니다. 함께 쓰이는 권한 묶음을 찾아 '역할'로 합치면, 접근 통제를 단순하게 하고 모든 사람이 꼭 필요한 권한만 갖도록 할 수 있습니다.

사용하는 경우

  • ✓접근 역할이 너무 많고 서로 겹칠 때.
  • ✓새 접근 통제 시스템을 설정할 때.
  • ✓기존 보안을 검토하고 개선할 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-role-mining-for-rbac-optimization/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“현재 접근 권한을 분석하고 단순화된 접근 역할을 제안해 주세요.”

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

작동 방식

이 도구는 집단으로 있는 사용자들이 함께 사용하는 권한을 살펴봅니다. 군집화와 수학적 분석 방법으로 패턴을 찾아, 더 효율적이고 안전한 접근 역할을 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Building Role Mining for RBAC Optimization

Overview

Role mining is the process of analyzing existing user-permission assignments to discover optimal roles for a Role-Based Access Control (RBAC) system. Organizations accumulate excessive permissions over time through job changes, project assignments, and ad-hoc access grants, leading to "role explosion" where thousands of granular roles exist with significant overlap. Role mining uses data analysis -- including clustering algorithms, formal concept analysis, and graph-based methods -- to consolidate permissions into a minimal set of roles that accurately represent business functions while enforcing least privilege.

When to Use

  • When deploying or configuring building role mining for rbac optimization capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Export of current user-permission assignments (CSV/database)
  • Identity governance platform or directory service access
  • Python 3.9+ with pandas, scikit-learn, numpy
  • Understanding of organizational structure and job functions
  • Stakeholder access for role validation workshops

Core Concepts

Role Mining Approaches

Approach Description Best For
Bottom-Up Analyze existing permissions to discover common patterns Large datasets with organic permission growth
Top-Down Design roles from business requirements and job descriptions Greenfield RBAC or organizational restructuring
Hybrid Combine bottom-up analysis with top-down business validation Most production environments

Role Mining Algorithms

1. Permission Clustering: Group users with similar permission sets using k-means or hierarchical clustering. Users in the same cluster share a common role.

2. Formal Concept Analysis (FCA): Mathematical framework that identifies complete set of concepts (user groups sharing exact permission sets) from a binary user-permission matrix.

3. Graph-Based Mining: Model users and permissions as a bipartite graph, then find dense subgraphs representing candidate roles.

4. Boolean Matrix Decomposition: Decompose the user-permission matrix U into U ≈ R × P where R maps users to roles and P maps roles to permissions.

Role Mining Metrics

Metric Formula Target
Role Count Total distinct roles after mining Minimize
Coverage Permissions explained by mined roles / Total permissions > 95%
Weighted Structural Complexity (WSC) Sum of role-user + role-permission assignments Minimize
Deviation Extra permissions not covered by assigned roles < 5%

Workflow

Step 1: Extract User-Permission Data

Collect the current access state from all identity sources:

import pandas as pd
import numpy as np

# Load user-permission assignments
# Format: user_id, permission_id (one row per assignment)
assignments = pd.read_csv("user_permissions.csv")

# Create binary user-permission matrix (UPA matrix)
upa_matrix = assignments.pivot_table(
    index="user_id",
    columns="permission_id",
    aggfunc="size",
    fill_value=0
)
upa_matrix = (upa_matrix > 0).astype(int)

print(f"Users: {upa_matrix.shape[0]}")
print(f"Permissions: {upa_matrix.shape[1]}")
print(f"Assignments: {assignments.shape[0]}")
print(f"Density: {upa_matrix.values.sum() / upa_matrix.size:.2%}")

Step 2: Bottom-Up Role Discovery Using Clustering

from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics import silhouette_score

def find_optimal_clusters(matrix, max_k=50):
    """Find optimal number of roles using silhouette analysis."""
    scores = []
    for k in range(2, min(max_k, matrix.shape[0])):
        clustering = AgglomerativeClustering(
            n_clusters=k, metric="jaccard", linkage="average"
        )
        labels = clustering.fit_predict(matrix)
        score = silhouette_score(matrix, labels, metric="jaccard")
        scores.append((k, score))

    optimal_k = max(scores, key=lambda x: x[1])[0]
    return optimal_k, scores

def mine_roles_clustering(upa_matrix, n_clusters):
    """Mine roles using hierarchical clustering on Jaccard distance."""
    clustering = AgglomerativeClustering(

…
자주 묻는 질문

'역할 폭발(role explosion)'이란 무엇인가요?

접근 역할의 수가 너무 많아지고 비슷하거나 중복된 역할이 많아 복잡해지는 상황입니다.

'최소 권한'이란 무엇인가요?

각 사용자가 자기 업무에 꼭 필요한 권한만 가지고, 그 이상은 갖지 않도록 하는 보안 원칙입니다.

어떤 데이터가 필요한가요?

현재 시스템에서 어떤 사용자가 어떤 권한을 가지고 있는지 목록이 필요합니다.

상세 정보

작성자의 원본 설명

Apply bottom-up and top-down role mining techniques, including clustering algorithms and formal concept analysis, to discover optimal RBAC roles from existing user-permission assignments, consolidating overlapping roles and enforcing least privilege. Use when an identity program needs to reduce role explosion or redesign its RBAC role set from access data.

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬