Identity Governance with SCIM
This guide shows how to connect an IdP that supports SCIM 2.0 to Teleport and use its groups to govern access to your infrastructure.
You will set up the SCIM integration so the IdP provisions users and group memberships, then use Access Lists to:
- Give the members of one IdP group standing access to servers.
- Let the members of another IdP group request just-in-time access to a database, with approval from a third group.
The workshop environment runs a Duo-style SAML
and SCIM IdP simulator at https://duo.localhost:8443.
How it works
SCIM integration has three parts:
| Name | Purpose |
|---|---|
| SSO | A SAML or OIDC connector for your IdP, so users can log in to Teleport. |
| SCIM | A SCIM 2.0 endpoint on the Teleport Proxy Service. The IdP pushes users and group memberships to Teleport. |
| SCIM Access Lists | Access Lists with type: scim matching IdP groups. Membership comes from the IdP. |
The SCIM integration requires Access Lists to be created in advance. A group's
displayName in the IdP must exactly match the title of a SCIM Access List.
Groups without a matching list have no effect in Teleport.
Note that you can only have one SCIM integration per Teleport cluster.
To give an IdP group access to Teleport-protected infrastructure, you add its SCIM Access List as a member of an Access List that you create in Teleport.
Prerequisites
- A Teleport Enterprise cluster with Identity Governance.
- A Teleport user with the
editorrole. - An IdP that supports outbound SCIM 2.0 provisioning of users and groups, with OAuth 2.0 client credentials or bearer token authentication. The SCIM integration has been tested with Okta and SailPoint. Microsoft Entra ID customers should use the Entra ID integration instead.
- A SAML or OIDC connector for your IdP. See Integrate Teleport with your IdP.
- Network access from the IdP to the Teleport Proxy Service.
- At least one resource enrolled in Teleport, with labels you can select them by.
- Two IdP groups to grant access to, and one group to approve requests. This
guide uses these groups:
admins: gets standing access to servers and approves database access requests.readonly: requests just-in-time access to the database.
- Sign in to
https://teleport.localhost:3080with the default Duo login and choose Andrew Admin. This user has theeditorrole. - The cluster has an SSH server and a PostgreSQL database, both labeled
env: docker. - The Duo simulator has three users, Andrew Admin, Randy Reviewer, and Roger
Requester, with
@duo.example.comlogins. Andrew and Randy are inadmins, and Roger is inreadonly.
Step 1/4. Connect your IdP to Teleport
SSO connector
Use the SAML or OIDC connector for your IdP. Note that the users that come from the IdP should be the same as the users pushed over SCIM.
The workshop environment has a SAML connector named simulator, displayed as
Duo on the login page.
SCIM Access Lists
Create a SCIM Access List for each IdP group. Set the type to scim, and set
the title to the group's displayName. A SCIM Access List can also grant roles
to the group's members directly.
- YAML and tctl
- Terraform
Save the lists as scim-lists.yaml:
kind: access_list
version: v1
metadata:
name: sre
spec:
type: scim
# Must exactly match the IdP group displayName.
title: sre
description: SCIM group sre
owners:
- name: [email protected]
grants:
roles: [root-access, db-access]
audit:
recurrence:
frequency: 12months
---
kind: access_list
version: v1
metadata:
name: support
spec:
type: scim
# Must exactly match the IdP group displayName.
title: support
description: SCIM group support
owners:
- name: [email protected]
grants:
roles: [readonly, db-requester]
audit:
recurrence:
frequency: 12months
Create the lists (assuming you're logged into the cluster with tsh):
tctl create -f scim-lists.yaml
This tab requires terraform and tctl. Save the configuration as main.tf
in an empty directory:
terraform {
required_providers {
teleport = {
source = "terraform.releases.teleport.dev/gravitational/teleport"
version = "~> 19.0"
}
}
}
# Credentials come from the environment variables that
# `tctl terraform env` sets.
provider "teleport" {
addr = "teleport.localhost:3080"
}
resource "teleport_access_list" "sre" {
header = {
version = "v1"
metadata = {
name = "sre"
}
}
spec = {
type = "scim"
# Must exactly match the IdP group displayName.
title = "sre"
description = "SCIM group sre"
owners = [
{
name = "[email protected]"
}
]
grants = {
roles = ["root-access", "db-access"]
}
audit = {
recurrence = {
frequency = 12 # months
}
}
}
}
resource "teleport_access_list" "support" {
header = {
version = "v1"
metadata = {
name = "support"
}
}
spec = {
type = "scim"
# Must exactly match the IdP group displayName.
title = "support"
description = "SCIM group support"
owners = [
{
name = "[email protected]"
}
]
grants = {
roles = ["readonly", "db-requester"]
}
audit = {
recurrence = {
frequency = 12 # months
}
}
}
}
Get temporary credentials for the Terraform provider and apply the configuration:
eval "$(tctl terraform env)"terraform initterraform planterraform apply
To run the provider outside your own shell, for example in CI, see
Teleport Terraform provider.
For all teleport_access_list fields, see
Creating Access Lists with IaC
and the teleport_access_list reference.
SCIM integration
In the Teleport Web UI, go to Add New > Integration and select the SCIM tile. Select your SSO connector, then copy the client ID, client secret, and base URL.
Note that you can only have one SCIM integration per Teleport cluster.
The workshop environment has the SCIM integration installed with a bearer
token, linked to the simulator connector.
IdP provisioning
In your IdP, add a SCIM 2.0 application or provisioning target with the base URL and credentials from Teleport, and push your users and groups. Steps differ by IdP. See the SailPoint guide as an example.
The Duo simulator pushes users and groups on startup. To push again, click Sync now under SCIM provisioning on the simulator home page.
At this point, IdP users and group memberships should be provisioned to Teleport. When a user is added to an IdP group, the IdP adds them to the group's SCIM Access List, and they get the access granted through it at their next login. When the IdP deactivates a user or removes them from the app, Teleport deletes the user and locks them, which ends their active sessions.
Since SCIM Access Lists are managed directly in Teleport, they can grant roles
directly. For example, in the workshop environment, the dba list grants
direct access to the database to its members without needing to create
additional Access Lists.
Step 2/4. Grant standing access to an IdP group
In this step you will give members of the admins IdP group access to your
servers whenever they log in.
Go to Create New Access List and follow the Standing Access Guide to create an Access List that grants access to selected resources.
The workshop environment includes an SSH server labeled env: docker. Use it
to grant access to the SCIM admins list. If you also followed the Okta or
Entra ID guide, the cluster has more than one Access List named admins. Pick
the SCIM one.
Members of the IdP group now inherit the list's access through nesting. The SCIM Access List stays managed by the IdP.
To verify, log in to Teleport via your SSO connector as a member of the
admins group, for example Andrew Admin in the workshop environment. The
servers now appear in the resource list.
Step 3/4. Let an IdP group request just-in-time access
In this step you will let members of the readonly IdP group request temporary
access to a database with members of the admins group reviewing their
requests.
Go to Create New Access List and follow the Just-in-Time Access Guide to create an Access List that grants Access Request permissions to a database.
Pick readonly SCIM Access List as a list member and admins SCIM Access List
as list owner.
Step 4/4. Request and approve access
Log in as a member of the readonly group via your SSO connector, for example
Roger Requester. The database appears in the resource list as a
requestable resource. Submit an Access Request.
Re-login as a member of the admins group and approve the request from the
Access Requests page.
Log in back as the requester, open the approved request and click Assume Roles. You can now connect to the database. The access ends when the request expires or the user's session ends.