Algorithm Search⌘K

Problemadvanced

Role mining problem

Also called basic role mining problem.

Given a user-permission matrix, find the fewest roles whose Boolean product with a user-role matrix gives it exactly. Its decision version is NP-complete.

The role mining problem asks for the smallest set of roles that explains an existing assignment of permissions to users. The input is the user-permission matrix of a system, as it is before the move to role-based access control. The output is a set of roles, each a set of permissions, and an assignment of roles to users, such that each user gets exactly the permissions he has now, no more and no fewer. Vaidya, Atluri and Guo stated it in 2007 and showed that its decision version is NP-complete. The problem is the same as the Boolean rank of a 0-1 matrix and as the minimum biclique cover of a bipartite graph.

In plain words

A company has many users and many permissions, and a big table that says which user has which permission. It wants to replace the table with roles, such as "clerk" or "auditor": each role is a bundle of permissions, and each user gets some roles. The goal is to use as few roles as possible, under one strict condition: after the change, every user must have exactly the same permissions as before. A user may not lose a permission he needs, and he may not gain one he did not have. Finding the smallest number of roles is hard in general, so tools use fast methods that find a good set of roles but not always the best one. Some versions of the problem allow a small number of errors in return for fewer roles.

Definition

Let UU be a set of uu users and PP a set of pp permissions. On this page uu is the number of users, pp the number of permissions and kk the number of roles. The input is a 0-1 matrix UPA\mathit{UPA} of size u×pu \times p, with UPA[i,j]=1\mathit{UPA}[i, j] = 1 if user ii has permission jj.

A role set of size kk is a pair of 0-1 matrices: UA\mathit{UA} of size u×ku \times k (users to roles) and PA\mathit{PA} of size k×pk \times p (roles to permissions). Their Boolean product is

(UA⊗PA)[i,j]=⋁l=1k(UA[i,l]∧PA[l,j]).(\mathit{UA} \otimes \mathit{PA})[i, j] = \bigvee_{l=1}^{k} \bigl(\mathit{UA}[i, l] \wedge \mathit{PA}[l, j]\bigr).

Basic role mining problem. Given UPA\mathit{UPA}, find UA\mathit{UA} and PA\mathit{PA} with UA⊗PA=UPA\mathit{UA} \otimes \mathit{PA} = \mathit{UPA} and kk as small as possible.

Decision version. Given UPA\mathit{UPA} and an integer kk, is there a role set of size at most kk with UA⊗PA=UPA\mathit{UA} \otimes \mathit{PA} = \mathit{UPA}?

The minimum kk is the Boolean rank of UPA\mathit{UPA}. In graph terms, let GG be the bipartite graph with users on one side, permissions on the other, and an edge for each 1 of UPA\mathit{UPA}. A role ll is a complete bipartite subgraph (a biclique) between the users that have it and its permissions. The product equals UPA\mathit{UPA} exactly when every biclique uses only edges of GG and every edge is in some biclique. So the minimum kk is the minimum number of bicliques that cover the edges of GG.

Variants

  • Delta-approx role mining (Vaidya, Atluri and Guo 2007). Given δ\delta, find the smallest kk with ∥UA⊗PA−UPA∥1≤δ\lVert \mathit{UA} \otimes \mathit{PA} - \mathit{UPA} \rVert_1 \le \delta, where the norm counts the cells that differ. The basic problem is the case δ=0\delta = 0.
  • MinNoise role mining (Vaidya, Atluri and Guo 2007). Given kk, find a role set of size kk that minimizes the number of cells that differ.
  • Fewest assignments. Minimize ∣UA∣+∣PA∣|\mathit{UA}| + |\mathit{PA}|, the number of 1s in the two matrices, instead of kk. This measures the work of the administrators more closely than the number of roles.
  • Role hierarchy mining (Guo, Vaidya and Atluri 2008). Find roles together with a hierarchy among them, so that a role inherits the permissions of the roles below it, and minimize the size of the hierarchy.

The approximate variants have a security cost. A cell with 1 in the product and 0 in UPA\mathit{UPA} gives a user a permission he did not have. If the adversary is a user who uses every permission he holds, such a cell is a real gain for him and a break of the principle of least privilege. A cell with 0 in the product and 1 in UPA\mathit{UPA} only blocks his work. So tools often allow only the second kind of error.

Examples

Take four users and five permissions:

user permissions
u1u_1 p1,p2,p3p_1, p_2, p_3
u2u_2 p1,p2p_1, p_2
u3u_3 p3,p4,p5p_3, p_4, p_5
u4u_4 p1,p2,p3,p4,p5p_1, p_2, p_3, p_4, p_5

Three roles suffice: r1={p1,p2}r_1 = \{p_1, p_2\}, r2={p3}r_2 = \{p_3\} and r3={p4,p5}r_3 = \{p_4, p_5\}, with u1↦{r1,r2}u_1 \mapsto \{r_1, r_2\}, u2↦{r1}u_2 \mapsto \{r_1\}, u3↦{r2,r3}u_3 \mapsto \{r_2, r_3\} and u4↦{r1,r2,r3}u_4 \mapsto \{r_1, r_2, r_3\}. A search over all role sets shows that there are five optimal role sets of size 3.

Two roles are not enough, for two separate reasons. First, the four users have four different nonempty permission sets, and with kk roles there are at most 2k−12^k - 1 different nonempty unions of roles, which is 3 for k=2k = 2. Second, the three cells (u2,p1)(u_2, p_1), (u3,p4)(u_3, p_4) and (u1,p3)(u_1, p_3) are pairwise isolated: no role can contain two of them, because a role that gives p1p_1 to u2u_2 and p4p_4 to u3u_3 would also give p4p_4 to u2u_2, which is 0 in UPA\mathit{UPA}, and the other two pairs fail at (u2,p3)(u_2, p_3) and (u1,p4)(u_1, p_4). Each of the three cells needs its own role.

Known algorithms

  • Remove duplicates (exact). Users with equal rows can share one role set, and permissions with equal columns can be merged into one. This never changes the minimum kk.
  • Kernel and exact search (theorem). After duplicates are removed, a matrix with Boolean rank at most kk has at most 2k2^k different rows and at most 2k2^k different columns, since each row is a union of a subset of the kk roles and each column is the set of users of a subset of the roles. So if there are more than 2k2^k distinct rows, the answer is no. Otherwise the reduced matrix has size at most 2k×2k2^k \times 2^k, and an exhaustive search over the roles, each a subset of the at most 2k2^k columns, decides the instance. The total time is polynomial in uu and pp plus a function of kk alone, so the decision problem is fixed-parameter tractable in kk. The function of kk is doubly exponential, so this is useful only for very small kk.
  • Greedy cover by maximal bicliques (theorem for the ratio). Every role of an optimal solution can be grown to a maximal biclique of GG without breaking exactness, so there is an optimal solution made of maximal bicliques. Running greedy set cover with the edges as elements and the maximal bicliques as sets gives at most H(e)≤1+ln⁡eH(e) \le 1 + \ln e times the minimum number of roles, where ee is the number of 1s in UPA\mathit{UPA}. The weak point is that GG can have exponentially many maximal bicliques.
  • Candidate roles from intersections (heuristic). Practical tools build candidate roles from the permission sets of the users and their pairwise intersections, which are polynomially many, and then pick roles from the candidates greedily. This keeps the result exact but gives no bound on its size.
  • Integer programming and SAT (exact). The decision version for a given kk is a SAT instance with k(u+p)k(u + p) main variables, one for each cell of UA\mathit{UA} and PA\mathit{PA}. How large a matrix a solver handles in practice is a matter of measurement, not of a proven bound.

Bounds

Each item is a theorem.

  • Upper bound. k≤min⁡(u,p)k \le \min(u, p): one role per user (its row) or one role per permission (assigned to the users of its column) is always exact.
  • Counting lower bound. If UPA\mathit{UPA} has dd distinct nonempty rows, then k≥⌈log⁡2(d+1)⌉k \ge \lceil \log_2(d + 1) \rceil.
  • Isolated set lower bound. A set of 1 cells such that for any two of them, (i,j)(i, j) and (i′,j′)(i', j'), one of UPA[i,j′]\mathit{UPA}[i, j'] and UPA[i′,j]\mathit{UPA}[i', j] is 0, needs one role per cell. So kk is at least the size of the largest such set.
  • Hardness. The decision version is NP-complete (Vaidya, Atluri and Guo 2007). It is in NP because a role set of size k≤min⁡(u,p)k \le \min(u, p) is a certificate of polynomial size that is checked by one Boolean matrix product.

Reductions

  • Set basis. In the set basis problem (problem SP7 in the Garey and Johnson compendium), the input is a collection CC of subsets of a finite set and an integer kk, and the question is whether there are kk sets such that each member of CC is a union of some of them. Take CC to be the set of rows of UPA\mathit{UPA}: the basic role mining problem with bound kk is then exactly set basis with bound kk. Since set basis is NP-complete, so is role mining. Vaidya, Atluri and Guo use this reduction.
  • Biclique cover. As in the definition, role mining is the minimum cover of the edges of a bipartite graph by bicliques. The covering form is close to edge clique cover, where the graph is general and the covering sets are cliques.
  • Set cover. Once a family of candidate roles is fixed, choosing the fewest of them is an instance of set cover on the 1 cells of UPA\mathit{UPA}.
  • Boolean matrix factorization. Role mining is exact factorization of a 0-1 matrix over the Boolean semiring with the smallest inner dimension. The MinNoise variant is the approximate factorization studied in data mining.

Applications

  • Role engineering. Moving a large organization to role-based access control needs an initial set of roles. Bottom-up role mining finds them from the current permissions; top-down role engineering starts from job functions. Most projects use both.
  • Access review. Users whose permissions are far from every mined role are candidates for review, since their access may be a leftover of earlier jobs.
  • Separation of duty. Mined roles must still be checked against separation of duty constraints, which a pure minimization ignores.

References

  1. Jaideep Vaidya, Vijayalakshmi Atluri and Qi Guo, The role mining problem: finding a minimal descriptive set of roles, Proceedings of the 12th ACM Symposium on Access Control Models and Technologies (SACMAT), 2007, pages 175 to 184, the basic role mining problem, the delta-approx and MinNoise variants, and the proof of NP-completeness by the set basis problem
  2. Jaideep Vaidya, Vijayalakshmi Atluri and Qi Guo, The role mining problem: a formal perspective, ACM Transactions on Information and System Security 13(3), 2010, the journal version, with the variants and their relation to known problems
  3. Qi Guo, Jaideep Vaidya and Vijayalakshmi Atluri, The role hierarchy mining problem: discovery of optimal role hierarchies, Annual Computer Security Applications Conference (ACSAC), 2008, pages 237 to 246, the role hierarchy mining problem

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a known algorithm
  • a contract.yaml