diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql
index 27c384e794239..626d00cc81b41 100644
--- a/coderd/database/dump.sql
+++ b/coderd/database/dump.sql
@@ -663,7 +663,11 @@ CREATE TABLE users (
quiet_hours_schedule text DEFAULT ''::text NOT NULL,
theme_preference text DEFAULT ''::text NOT NULL,
name text DEFAULT ''::text NOT NULL,
- github_com_user_id bigint
+ github_com_user_id bigint,
+ hashed_one_time_passcode bytea,
+ one_time_passcode_expires_at timestamp with time zone,
+ must_reset_password boolean DEFAULT false NOT NULL,
+ CONSTRAINT one_time_passcode_set CHECK ((((hashed_one_time_passcode IS NULL) AND (one_time_passcode_expires_at IS NULL)) OR ((hashed_one_time_passcode IS NOT NULL) AND (one_time_passcode_expires_at IS NOT NULL))))
);
COMMENT ON COLUMN users.quiet_hours_schedule IS 'Daily (!) cron schedule (with optional CRON_TZ) signifying the start of the user''s quiet hours. If empty, the default quiet hours on the instance is used instead.';
@@ -674,6 +678,12 @@ COMMENT ON COLUMN users.name IS 'Name of the Coder user';
COMMENT ON COLUMN users.github_com_user_id IS 'The GitHub.com numerical user ID. At time of implementation, this is used to check if the user has starred the Coder repository.';
+COMMENT ON COLUMN users.hashed_one_time_passcode IS 'A hash of the one-time-passcode given to the user.';
+
+COMMENT ON COLUMN users.one_time_passcode_expires_at IS 'The time when the one-time-passcode expires.';
+
+COMMENT ON COLUMN users.must_reset_password IS 'Determines if the user should be forced to change their password.';
+
CREATE VIEW group_members_expanded AS
WITH all_members AS (
SELECT group_members.user_id,
diff --git a/coderd/database/migrations/000258_add_otp_reset_to_user.down.sql b/coderd/database/migrations/000258_add_otp_reset_to_user.down.sql
new file mode 100644
index 0000000000000..0b812889247b6
--- /dev/null
+++ b/coderd/database/migrations/000258_add_otp_reset_to_user.down.sql
@@ -0,0 +1,5 @@
+ALTER TABLE users DROP CONSTRAINT one_time_passcode_set;
+
+ALTER TABLE users DROP COLUMN hashed_one_time_passcode;
+ALTER TABLE users DROP COLUMN one_time_passcode_expires_at;
+ALTER TABLE users DROP COLUMN must_reset_password;
diff --git a/coderd/database/migrations/000258_add_otp_reset_to_user.up.sql b/coderd/database/migrations/000258_add_otp_reset_to_user.up.sql
new file mode 100644
index 0000000000000..3453a2e786078
--- /dev/null
+++ b/coderd/database/migrations/000258_add_otp_reset_to_user.up.sql
@@ -0,0 +1,13 @@
+ALTER TABLE users ADD COLUMN hashed_one_time_passcode bytea;
+COMMENT ON COLUMN users.hashed_one_time_passcode IS 'A hash of the one-time-passcode given to the user.';
+
+ALTER TABLE users ADD COLUMN one_time_passcode_expires_at timestamp with time zone;
+COMMENT ON COLUMN users.one_time_passcode_expires_at IS 'The time when the one-time-passcode expires.';
+
+ALTER TABLE users ADD CONSTRAINT one_time_passcode_set CHECK (
+ (hashed_one_time_passcode IS NULL AND one_time_passcode_expires_at IS NULL)
+ OR (hashed_one_time_passcode IS NOT NULL AND one_time_passcode_expires_at IS NOT NULL)
+);
+
+ALTER TABLE users ADD COLUMN must_reset_password bool NOT NULL DEFAULT false;
+COMMENT ON COLUMN users.must_reset_password IS 'Determines if the user should be forced to change their password.';
diff --git a/coderd/database/modelqueries.go b/coderd/database/modelqueries.go
index c2061adf13d6a..1274608a7d276 100644
--- a/coderd/database/modelqueries.go
+++ b/coderd/database/modelqueries.go
@@ -364,6 +364,9 @@ func (q *sqlQuerier) GetAuthorizedUsers(ctx context.Context, arg GetUsersParams,
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
&i.Count,
); err != nil {
return nil, err
diff --git a/coderd/database/models.go b/coderd/database/models.go
index 87ef020e8be5e..05b4c404ea16f 100644
--- a/coderd/database/models.go
+++ b/coderd/database/models.go
@@ -2869,6 +2869,12 @@ type User struct {
Name string `db:"name" json:"name"`
// The GitHub.com numerical user ID. At time of implementation, this is used to check if the user has starred the Coder repository.
GithubComUserID sql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`
+ // A hash of the one-time-passcode given to the user.
+ HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`
+ // The time when the one-time-passcode expires.
+ OneTimePasscodeExpiresAt sql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`
+ // Determines if the user should be forced to change their password.
+ MustResetPassword bool `db:"must_reset_password" json:"must_reset_password"`
}
type UserLink struct {
diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go
index a8ea40a395cf1..8d423d6f2f6ac 100644
--- a/coderd/database/queries.sql.go
+++ b/coderd/database/queries.sql.go
@@ -9993,7 +9993,7 @@ func (q *sqlQuerier) GetAuthorizationUserRoles(ctx context.Context, userID uuid.
const getUserByEmailOrUsername = `-- name: GetUserByEmailOrUsername :one
SELECT
- id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
FROM
users
WHERE
@@ -10028,13 +10028,16 @@ func (q *sqlQuerier) GetUserByEmailOrUsername(ctx context.Context, arg GetUserBy
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
const getUserByID = `-- name: GetUserByID :one
SELECT
- id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
FROM
users
WHERE
@@ -10063,6 +10066,9 @@ func (q *sqlQuerier) GetUserByID(ctx context.Context, id uuid.UUID) (User, error
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10085,7 +10091,7 @@ func (q *sqlQuerier) GetUserCount(ctx context.Context) (int64, error) {
const getUsers = `-- name: GetUsers :many
SELECT
- id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, COUNT(*) OVER() AS count
+ id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password, COUNT(*) OVER() AS count
FROM
users
WHERE
@@ -10169,23 +10175,26 @@ type GetUsersParams struct {
}
type GetUsersRow struct {
- ID uuid.UUID `db:"id" json:"id"`
- Email string `db:"email" json:"email"`
- Username string `db:"username" json:"username"`
- HashedPassword []byte `db:"hashed_password" json:"hashed_password"`
- CreatedAt time.Time `db:"created_at" json:"created_at"`
- UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
- Status UserStatus `db:"status" json:"status"`
- RBACRoles pq.StringArray `db:"rbac_roles" json:"rbac_roles"`
- LoginType LoginType `db:"login_type" json:"login_type"`
- AvatarURL string `db:"avatar_url" json:"avatar_url"`
- Deleted bool `db:"deleted" json:"deleted"`
- LastSeenAt time.Time `db:"last_seen_at" json:"last_seen_at"`
- QuietHoursSchedule string `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`
- ThemePreference string `db:"theme_preference" json:"theme_preference"`
- Name string `db:"name" json:"name"`
- GithubComUserID sql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`
- Count int64 `db:"count" json:"count"`
+ ID uuid.UUID `db:"id" json:"id"`
+ Email string `db:"email" json:"email"`
+ Username string `db:"username" json:"username"`
+ HashedPassword []byte `db:"hashed_password" json:"hashed_password"`
+ CreatedAt time.Time `db:"created_at" json:"created_at"`
+ UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
+ Status UserStatus `db:"status" json:"status"`
+ RBACRoles pq.StringArray `db:"rbac_roles" json:"rbac_roles"`
+ LoginType LoginType `db:"login_type" json:"login_type"`
+ AvatarURL string `db:"avatar_url" json:"avatar_url"`
+ Deleted bool `db:"deleted" json:"deleted"`
+ LastSeenAt time.Time `db:"last_seen_at" json:"last_seen_at"`
+ QuietHoursSchedule string `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`
+ ThemePreference string `db:"theme_preference" json:"theme_preference"`
+ Name string `db:"name" json:"name"`
+ GithubComUserID sql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`
+ HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`
+ OneTimePasscodeExpiresAt sql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`
+ MustResetPassword bool `db:"must_reset_password" json:"must_reset_password"`
+ Count int64 `db:"count" json:"count"`
}
// This will never return deleted users.
@@ -10224,6 +10233,9 @@ func (q *sqlQuerier) GetUsers(ctx context.Context, arg GetUsersParams) ([]GetUse
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
&i.Count,
); err != nil {
return nil, err
@@ -10240,7 +10252,7 @@ func (q *sqlQuerier) GetUsers(ctx context.Context, arg GetUsersParams) ([]GetUse
}
const getUsersByIDs = `-- name: GetUsersByIDs :many
-SELECT id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id FROM users WHERE id = ANY($1 :: uuid [ ])
+SELECT id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password FROM users WHERE id = ANY($1 :: uuid [ ])
`
// This shouldn't check for deleted, because it's frequently used
@@ -10272,6 +10284,9 @@ func (q *sqlQuerier) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) ([]User
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
); err != nil {
return nil, err
}
@@ -10300,7 +10315,7 @@ INSERT INTO
login_type
)
VALUES
- ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type InsertUserParams struct {
@@ -10345,6 +10360,9 @@ func (q *sqlQuerier) InsertUser(ctx context.Context, arg InsertUserParams) (User
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10403,7 +10421,7 @@ SET
updated_at = $3
WHERE
id = $1
-RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserAppearanceSettingsParams struct {
@@ -10432,6 +10450,9 @@ func (q *sqlQuerier) UpdateUserAppearanceSettings(ctx context.Context, arg Updat
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10495,7 +10516,7 @@ SET
last_seen_at = $2,
updated_at = $3
WHERE
- id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserLastSeenAtParams struct {
@@ -10524,6 +10545,9 @@ func (q *sqlQuerier) UpdateUserLastSeenAt(ctx context.Context, arg UpdateUserLas
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10541,7 +10565,7 @@ SET
'':: bytea
END
WHERE
- id = $2 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ id = $2 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserLoginTypeParams struct {
@@ -10569,6 +10593,9 @@ func (q *sqlQuerier) UpdateUserLoginType(ctx context.Context, arg UpdateUserLogi
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10584,7 +10611,7 @@ SET
name = $6
WHERE
id = $1
-RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserProfileParams struct {
@@ -10623,6 +10650,9 @@ func (q *sqlQuerier) UpdateUserProfile(ctx context.Context, arg UpdateUserProfil
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10634,7 +10664,7 @@ SET
quiet_hours_schedule = $2
WHERE
id = $1
-RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserQuietHoursScheduleParams struct {
@@ -10662,6 +10692,9 @@ func (q *sqlQuerier) UpdateUserQuietHoursSchedule(ctx context.Context, arg Updat
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10674,7 +10707,7 @@ SET
rbac_roles = ARRAY(SELECT DISTINCT UNNEST($1 :: text[]))
WHERE
id = $2
-RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserRolesParams struct {
@@ -10702,6 +10735,9 @@ func (q *sqlQuerier) UpdateUserRoles(ctx context.Context, arg UpdateUserRolesPar
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
@@ -10713,7 +10749,7 @@ SET
status = $2,
updated_at = $3
WHERE
- id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id
+ id = $1 RETURNING id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, login_type, avatar_url, deleted, last_seen_at, quiet_hours_schedule, theme_preference, name, github_com_user_id, hashed_one_time_passcode, one_time_passcode_expires_at, must_reset_password
`
type UpdateUserStatusParams struct {
@@ -10742,6 +10778,9 @@ func (q *sqlQuerier) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusP
&i.ThemePreference,
&i.Name,
&i.GithubComUserID,
+ &i.HashedOneTimePasscode,
+ &i.OneTimePasscodeExpiresAt,
+ &i.MustResetPassword,
)
return i, err
}
diff --git a/docs/admin/audit-logs.md b/docs/admin/audit-logs.md
index 5fb017ba73e92..8872d382fe79b 100644
--- a/docs/admin/audit-logs.md
+++ b/docs/admin/audit-logs.md
@@ -25,7 +25,7 @@ We track the following resources:
| Organization
|
Field | Tracked |
---|
created_at | false |
description | true |
display_name | true |
icon | true |
id | false |
is_default | true |
name | true |
updated_at | true |
|
| Template
write, delete | Field | Tracked |
---|
active_version_id | true |
activity_bump | true |
allow_user_autostart | true |
allow_user_autostop | true |
allow_user_cancel_workspace_jobs | true |
autostart_block_days_of_week | true |
autostop_requirement_days_of_week | true |
autostop_requirement_weeks | true |
created_at | false |
created_by | true |
created_by_avatar_url | false |
created_by_username | false |
default_ttl | true |
deleted | false |
deprecated | true |
description | true |
display_name | true |
failure_ttl | true |
group_acl | true |
icon | true |
id | true |
max_port_sharing_level | true |
name | true |
organization_display_name | false |
organization_icon | false |
organization_id | false |
organization_name | false |
provisioner | true |
require_active_version | true |
time_til_dormant | true |
time_til_dormant_autodelete | true |
updated_at | false |
user_acl | true |
|
| TemplateVersion
create, write | Field | Tracked |
---|
archived | true |
created_at | false |
created_by | true |
created_by_avatar_url | false |
created_by_username | false |
external_auth_providers | false |
id | true |
job_id | false |
message | false |
name | true |
organization_id | false |
readme | true |
template_id | true |
updated_at | false |
|
-| User
create, write, delete | Field | Tracked |
---|
avatar_url | false |
created_at | false |
deleted | true |
email | true |
github_com_user_id | false |
hashed_password | true |
id | true |
last_seen_at | false |
login_type | true |
name | true |
quiet_hours_schedule | true |
rbac_roles | true |
status | true |
theme_preference | false |
updated_at | false |
username | true |
|
+| User
create, write, delete | Field | Tracked |
---|
avatar_url | false |
created_at | false |
deleted | true |
email | true |
github_com_user_id | false |
hashed_one_time_passcode | true |
hashed_password | true |
id | true |
last_seen_at | false |
login_type | true |
must_reset_password | true |
name | true |
one_time_passcode_expires_at | true |
quiet_hours_schedule | true |
rbac_roles | true |
status | true |
theme_preference | false |
updated_at | false |
username | true |
|
| Workspace
create, write, delete | Field | Tracked |
---|
automatic_updates | true |
autostart_schedule | true |
created_at | false |
deleted | false |
deleting_at | true |
dormant_at | true |
favorite | true |
id | true |
last_used_at | false |
name | true |
organization_id | false |
owner_id | true |
template_id | true |
ttl | true |
updated_at | false |
|
| WorkspaceBuild
start, stop | Field | Tracked |
---|
build_number | false |
created_at | false |
daily_cost | false |
deadline | false |
id | false |
initiator_by_avatar_url | false |
initiator_by_username | false |
initiator_id | false |
job_id | false |
max_deadline | false |
provisioner_state | false |
reason | false |
template_version_id | true |
transition | false |
updated_at | false |
workspace_id | false |
|
| WorkspaceProxy
| Field | Tracked |
---|
created_at | true |
deleted | false |
derp_enabled | true |
derp_only | true |
display_name | true |
icon | true |
id | true |
name | true |
region_id | true |
token_hashed_secret | true |
updated_at | false |
url | true |
version | true |
wildcard_hostname | true |
|
diff --git a/enterprise/audit/table.go b/enterprise/audit/table.go
index 7310848f4f959..15eaaeb11b4f5 100644
--- a/enterprise/audit/table.go
+++ b/enterprise/audit/table.go
@@ -129,22 +129,25 @@ var auditableResourcesTypes = map[any]map[string]Action{
"archived": ActionTrack,
},
&database.User{}: {
- "id": ActionTrack,
- "email": ActionTrack,
- "username": ActionTrack,
- "hashed_password": ActionSecret, // Do not expose a users hashed password.
- "created_at": ActionIgnore, // Never changes.
- "updated_at": ActionIgnore, // Changes, but is implicit and not helpful in a diff.
- "status": ActionTrack,
- "rbac_roles": ActionTrack,
- "login_type": ActionTrack,
- "avatar_url": ActionIgnore,
- "last_seen_at": ActionIgnore,
- "deleted": ActionTrack,
- "quiet_hours_schedule": ActionTrack,
- "theme_preference": ActionIgnore,
- "name": ActionTrack,
- "github_com_user_id": ActionIgnore,
+ "id": ActionTrack,
+ "email": ActionTrack,
+ "username": ActionTrack,
+ "hashed_password": ActionSecret, // Do not expose a users hashed password.
+ "created_at": ActionIgnore, // Never changes.
+ "updated_at": ActionIgnore, // Changes, but is implicit and not helpful in a diff.
+ "status": ActionTrack,
+ "rbac_roles": ActionTrack,
+ "login_type": ActionTrack,
+ "avatar_url": ActionIgnore,
+ "last_seen_at": ActionIgnore,
+ "deleted": ActionTrack,
+ "quiet_hours_schedule": ActionTrack,
+ "theme_preference": ActionIgnore,
+ "name": ActionTrack,
+ "github_com_user_id": ActionIgnore,
+ "hashed_one_time_passcode": ActionSecret, // Do not expose a user's one time passcode.
+ "one_time_passcode_expires_at": ActionTrack,
+ "must_reset_password": ActionTrack,
},
&database.Workspace{}: {
"id": ActionTrack,