Opscraft
Open Policy Agent · Lesson 8 of 9 · 3 min read

OPA beyond Kubernetes admission

  • Microservice / API authorisation — services query OPA (sidecar or library) with the user, method and path; OPA answers allow/deny with fine-grained rules (RBAC + ABAC: "managers can approve expenses in their own department under ₹1 lakh").
  • Envoy / service mesh — the OPA-Envoy plugin implements Envoy's external authorisation (ext_authz) API, so the mesh enforces OPA decisions on every HTTP/gRPC request.
  • CI/CD gates — conftest on manifests, Helm output, Terraform plans, Dockerfiles.
  • Kafka, SSH/sudo (PAM), data filtering — other integrations.

Comparisons interviewers like:

What it decides
RBAC (Kubernetes) Who may perform which verb on which resource type — not what's inside the object
OPA/Gatekeeper What the object contains and context-aware rules (no :latest, labels present, registry allowed)
IAM policies (AWS) Who may call which AWS API on which resource
SCPs (AWS Organizations) Guardrails on what accounts can do at all
OPA in CI Whether a proposed change is acceptable before it's applied
Cedar / Amazon Verified Permissions Application authorisation with a purpose-built language (alternative to OPA for app authz)

They're complementary layers, not alternatives.

Enlarge diagramKubernetes RBACOPA / GatekeeperAWS IAMSCPsOPA in CIwho may do which verb on which resource typewhat the object contains is acceptablewho may call which AWS API on which resourcewhat an account may ever dowhether a proposed change is acceptable
Figure 1. Each tool answers a different question. They are layers, not alternatives.
Swipe sideways to see all of it, or tap to open it full screen.