CtrlK
BlogDocsLog inGet started
Tessl Logo

nicholasjackson/opa-rego-language

Rego is the declarative policy language used by Open Policy Agent (OPA). This tile covers writing and testing Rego policies for Kubernetes admission control, Terraform and infrastructure-as-code plan validation, Docker container authorization, HTTP API authorization, RBAC and role-based access control, data filtering, metadata annotations with opa inspect, and OPA policy testing with opa test.

99

1.19x

Quality

Pending

Does it follow best practices?

Impact

99%

1.19x

Average score across 31 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-5/

Access Control: Separation of Duty

Write a Rego policy that detects separation-of-duty (SOD) violations — users who hold two roles that must never be held simultaneously.

Data

data.user_roles maps users to their current role assignments:

{
  "alice": ["create-payment", "approver"],
  "bob": ["create-payment", "auditor"],
  "charlie": ["approve-payment", "auditor"]
}

The conflicting role pairs are:

[
  ["create-payment", "approve-payment"],
  ["create-vendor",  "pay-vendor"]
]

Expected behaviour

  • alice has a SOD violation (holds create-payment and approver — wait, approver isn't in the list, but approve-payment is — so alice is fine)
  • A user holding both create-payment and approve-payment is a violation
  • The policy must produce a set of violating users

README.md

rules.md

tile.json