Sourcegraph Accounts Management System (SAMS) is the single source of truth (aka. IdP) for Sourcegraph-operated services that require a Sourcegraph user account or machine-to-machine authentication and authorization, including but not limited to Sourcegraph.com, Workspaces, Cody PLG, Sourcegraph Analytics, Cody Gateway, Telemetry Gateway and Enterprise Portal.

The MSP IAM (Identity and Access Management) framework aims to standardize how SAMS-integrated Managed Services Platform (MSP) services think about and manage roles and permissions by offering a Zanzibar-style relationship-based access control (ReBAC) solution based on OpenFGA.

Diagram

The diagram below illustrates the example architecture for Enterprise Portal (EP) (excalidraw):

CleanShot 2024-06-22 at 10.02.40@2x.png

In the above diagram, we have Enterprise Portal as the example service, and components colored in orange are part of the MSP IAM framework, components colored in blue belong to Enterprise Portal itself.

The motivation for the distributedly-managed architecture:

Philosophy

In Zanzibar’s data modeling, the primary building blocks are a few types of “relationships” that form graphs from which access control decisions are made. It does not provide further details about how exactly services are utilizing those relations, i.e. are they making roles the most granular level, or are they using relations both as roles and permissions, or are they doing interpretation of relation (as roles) and translating to permissions at the service level. How the “access control graph” is used is up to each integrator.

In lieu of a “Zanzibar recommendation”, we propose usage patterns that are similar to GCP IAM (which according to the white paper, builds access controls on top of Zanzibar): the MSP IAM framework makes roles and permissions first-class concepts by explicitly defining their purposes and responsibilities.

The way service owners should think about roles and permissions:

Further readings:

Scopes vs. roles and permissions