Skip to content

Docs for disabling root and enabling debug_user#22682

Open
mikeCRL wants to merge 7 commits intomainfrom
disable-root-enable-debug-user
Open

Docs for disabling root and enabling debug_user#22682
mikeCRL wants to merge 7 commits intomainfrom
disable-root-enable-debug-user

Conversation

@mikeCRL
Copy link
Contributor

@mikeCRL mikeCRL commented Feb 17, 2026

Resolves DOC-15543 DOC-15545

mikeCRL and others added 7 commits February 17, 2026 01:20
Add comprehensive documentation for the Preview feature that allows
disabling root login for compliance requirements.

- Update 'The root access rule' section to note the new optional
  --disallow-root-login flag
- Add 'Disabling root login (Preview)' subsection explaining the
  feature and prerequisites
- Add 'Using debug_user for diagnostics (Preview)' subsection
  documenting the debug_user privileged user
- Add complete 'Disable root login and use debug_user' procedure
  with 6 steps, security best practices, and troubleshooting

Related to v26.1 PRs cockroachdb/cockroach#155216, cockroachdb/cockroach#158961, cockroachdb/cockroach#158963
Add documentation for two new Preview security flags to cockroach start:

- --allow-debug-user: Enables authentication for debug_user
- --disallow-root-login: Disables root user authentication

Also add example showing how to start a cluster with root login
disabled for compliance requirements.

Related to v26.1 PRs cockroachdb/cockroach#155216, cockroachdb/cockroach#158963
Add documentation for the --user flag behavior change in v26.1:
- Previously always used root regardless of flag value
- Now uses specified user (e.g., debug_user) when root is disabled

Also add example showing how to collect debug zip with debug_user
when root login is disabled.

Related to v26.1 PR cockroachdb/cockroach#158961
Add documentation for the --user flag (new in v26.1):
- Previously always used root user
- Now uses specified user (e.g., debug_user) when root is disabled

Also add example showing how to generate tsdump with debug_user
when root login is disabled.

Related to v26.1 PR cockroachdb/cockroach#158961
Add example showing how to create a client certificate for debug_user,
including prerequisites and setup requirements.

Related to v26.1 PRs cockroachdb/cockroach#155216, cockroachdb/cockroach#158963
Add example showing how to create the debug_user for diagnostic
operations when root login is disabled.

Related to v26.1 PRs cockroachdb/cockroach#155216, cockroachdb/cockroach#158963
@mikeCRL mikeCRL marked this pull request as ready for review February 17, 2026 21:11
@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit d606a00
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/6994d95c4e1db5000881f58a

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit d606a00
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/6994d95c14be150008dcbb04

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 47b5986
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/6994d9656eed080008893ee4

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 47b5986
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/6994d9656137cd0008431d4f

Copy link
Contributor Author

@mikeCRL mikeCRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@souravcrl Submitting for your review with a couple inline comments/questions. Thank you.

Comment on lines +170 to +194
## Disable root login and use debug_user

This procedure shows how to configure a cluster to disable root login for compliance requirements while maintaining debugging capabilities.

### Before you begin

- You must have an existing CockroachDB cluster
- You must have root access to create the `debug_user`
- You must have access to the CA key to generate certificates

### Step 1: Create debug_user

1. Connect to the cluster as root:

{% include_cached copy-clipboard.html %}
~~~ shell
cockroach sql --certs-dir=certs
~~~

1. Create the debug_user:

{% include_cached copy-clipboard.html %}
~~~ sql
CREATE USER debug_user;
~~~
Copy link
Contributor Author

@mikeCRL mikeCRL Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@souravcrl Must debug_user actually be set up before disabling root (or is that the only workflow we want to publish)?

I am wondering if there are alternative workflows that are possible (and, if so, worth documenting) where a customer can disable root without setting up debug_user; then, when troubleshooting is needed:

  • Rolling restart to re-enable root, or, if preferable, make use of a different user with admin privileges
  • Collect debug data with root, or with the other admin user, or just use one of these to set up debug_user at that time, and use it
  • Remove any users/roles, to return to prior state, if preferred

I could leave the doc as-is and we can save this for a follow-up if worthwhile. Please let me know what you think.

Regardless, should I expand "Connect to the cluster as root" to say "Connect to the cluster as root or another user with the admin role or CREATEROLE privilege?"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems only admin users can create or drop roles(https://www.cockroachlabs.com/docs/v25.2/security-reference/authorization#admin-role), so if there are other admin roles, it seems we can maybe postpone creation of debug_user.

On the contrary for the debug zip collection workflow, it is actually dependent on granting of certain privileges to debug_user which obs team is managing, so will defer the question to them as the user granting the privilege must have permission to do the same. cc: @aa-joshi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are couple of ways with which we can generate debug.zip with debug_user:

  1. grant admin privileges to debug_user.
  2. grant below privileges to debug_user:
    2.1. VIEWACTIVITY
    2.2. VIEWACTIVITYREDACTED
    2.3 VIEWCLUSTERMETADATA
    2.4 VIEWCLUSTERSETTING
    2.5 VIEWSYSTEMTABLE
    2.6 REPAIRCLUSTER
    2.7 REPLICATION

Note: As of v25.2 REPLICATION is deprecated. Instead, use the REPLICATIONSOURCE and REPLICATIONDEST privileges at the table level.

Comment on lines +196 to +201
1. Grant admin privileges (optional, but recommended for full debug access):

{% include_cached copy-clipboard.html %}
~~~ sql
GRANT admin TO debug_user;
~~~
Copy link
Contributor Author

@mikeCRL mikeCRL Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@souravcrl Is this accurate?

If it lacks the SQL admin role, will debug_user collect some/all/none of the debug zip/tsdump info?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This again relates to the debug zip collection part(independent of the user having rpc access). I will again defer this to @aa-joshi

Copy link

@aa-joshi aa-joshi Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will fetch the data which is not tied to privileges. Tsdump is not tied with any privileges.

@mikeCRL mikeCRL requested a review from souravcrl February 17, 2026 21:18
@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit d606a00
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6994d95c2ec5de00080b6f7c

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 47b5986
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6994d965b59cd7000835cff8

@mikeCRL mikeCRL requested a review from biplav-crl February 18, 2026 05:52
Copy link

@souravcrl souravcrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for the access and authorization changes bits.

@mikeCRL mikeCRL requested a review from aa-joshi February 18, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments