steampipe plugin install workos

Table: workos_user - Query WorkOS Users using SQL

WorkOS is a platform that provides a set of APIs to help developers quickly add enterprise-ready features to their applications. It includes capabilities for Single Sign-On, Directory Sync, and Audit Trail, among others. A WorkOS User is an individual with access to WorkOS, with details including user ID, email, first and last names, and related organization data.

Table Usage Guide

The workos_user table provides insights into user details within WorkOS. As a developer or security analyst, explore user-specific details through this table, including user ID, email, first and last names, and related organization data. Utilize it to uncover information about users, such as their associated organizations and roles, aiding in user management and security analysis.

Examples

Basic info

Explore the user profiles within your organization to gain insights into their status and creation date. This can help in assessing the user activity and managing the user database effectively.

select
id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user;
select
id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user;

List suspended users

Identify users whose accounts are currently suspended. This is useful for account management and to ensure that any unexpected or unauthorized suspensions are immediately addressed.

select
id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user
where
state = 'suspended';
select
id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user
where
state = 'suspended';

List users of a particular group

Explore which users belong to a specific group, allowing for efficient management and organization of user access and permissions. This is particularly beneficial in large organizations where grouping users can simplify administrative tasks.

select
workos_user.id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user,
jsonb_array_elements(groups) as g
where
g ->> 'Name' = 'test';
select
workos_user.id,
user_name,
state,
directory_id,
organization_id,
created_at,
first_name,
last_name
from
workos_user,
json_each(groups) as g
where
json_extract(g.value, '$.Name') = 'test';

List users of a particular organization

Explore which users belong to a specific organization, gaining insights into their user ID, username, and other relevant details. This can be useful for managing user access and understanding user distribution across different organizations.

select
u.id as user_id,
u.user_name,
u.state,
u.directory_id,
u.organization_id,
u.created_at,
u.first_name,
u.last_name
from
workos_user as u,
workos_organization as o
where
u.organization_id = o.id
and o.name = 'test';
select
u.id as user_id,
u.user_name,
u.state,
u.directory_id,
u.organization_id,
u.created_at,
u.first_name,
u.last_name
from
workos_user as u,
workos_organization as o
where
u.organization_id = o.id
and o.name = 'test';

List users of a particular directory

Explore which users are associated with a specific directory to manage access and permissions efficiently. This is particularly useful for administrators seeking to maintain security and organization within their system.

select
u.id as user_id,
u.user_name,
u.state,
u.directory_id,
u.organization_id,
u.created_at,
u.first_name,
u.last_name
from
workos_user as u,
workos_directory as d
where
u.directory_id = d.id
and d.name = 'test';
select
u.id as user_id,
u.user_name,
u.state,
u.directory_id,
u.organization_id,
u.created_at,
u.first_name,
u.last_name
from
workos_user as u,
workos_directory as d
where
u.directory_id = d.id
and d.name = 'test';

Schema for workos_user

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
created_attimestamp with time zoneThe user's created at date.
custom_attributesjsonbThe user's custom attributes in raw encoded JSON.
directory_idtext=The identifier of the directory the directory user belongs to.
emailsjsonbThe user's e-mails.
first_nametextThe user's first name.
groupsjsonbThe user's groups.
idtext=The User's unique identifier.
idp_idtextThe user's unique identifier assigned by the directory provider.
job_titletextThe user's job title.
last_nametextThe user's last name.
organization_idtextThe identifier for the organization in which the directory resides.
raw_attributesjsonbThe user's raw attributes in raw encoded JSON.
statetextThe user's state.
titletextTitle of the resource.
updated_attimestamp with time zoneThe user's updated at date.
user_nametextThe user's username.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- workos

You can pass the configuration to the command with the --config argument:

steampipe_export_workos --config '<your_config>' workos_user