Table: duo_user
Users in the Duo account.
Examples
List all users
select user_id, username, emailfrom duo_userorder by username
Users who have not yet enrolled
select user_id, username, emailfrom duo_userwhere not is_enrolledorder by username
Most recent 10 users to login
select user_id, username, email, last_loginfrom duo_userorder by last_login desclimit 10
Users who have never logged in
select user_id, username, emailfrom duo_userwhere last_login is nullorder by username
Users who have not logged in for more than 30 days
select user_id, username, email, last_login, age(last_login) as agefrom duo_userwhere age(last_login) > interval '30 days'order by age desc
Users who are locked out
select user_id, username, email, last_login, statusfrom duo_userwhere status = 'locked_out'order by username
User statistics by status
select status, count(*)from duo_usergroup by statusorder by status
Users and their group memberships
select u.username, g ->> 'name' as groupnamefrom duo_user as u, jsonb_array_elements(u.groups) as gorder by username, groupname
Users and their phones
select u.username, p ->> 'number' as phone_number, p ->> 'extension' as phone_extensionfrom duo_user as u, jsonb_array_elements(u.phones) as porder by username, phone_number, phone_extension
Users and their hardware tokens
select u.username, t ->> 'serial' as token_serialfrom duo_user as u, jsonb_array_elements(u.tokens) as torder by username, token_serial
.inspect duo_user
Users in the Duo account.
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
aliases | jsonb | Map of the user's username alias(es). Up to eight aliases may exist. |
created | timestamp with time zone | The user's creation date. |
text | The user's email address. | |
firstname | text | The user's given name. |
groups | jsonb | List of groups to which this user belongs. |
is_enrolled | boolean | Is true if the user has a phone, hardware token, U2F token, WebAuthn security key, or other WebAuthn method available for authentication. Otherwise, false. |
last_directory_sync | timestamp with time zone | The last update to the user via directory sync, or null if the user has never synced with an external directory or if the directory that originally created the user has been deleted from Duo. |
last_login | timestamp with time zone | The last time this user logged in, or null if the user has not logged in. |
lastname | text | The user's surname. |
notes | text | Notes about this user. |
phones | jsonb | A list of phones that this user can use. |
realname | text | The user's real name (or full name). |
status | text | The user's status: active, bypass, disabled, locked out, pending deletion. |
tokens | jsonb | A list of tokens that this user can use. |
user_id | text | The user's ID. |
username | text | The user's username. |