pingcap / pingcap/tidb-operator

Make initial account setup more secure.

Open
#6,428 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

security
Dominant language
Go
Stars
1.3k
Forks
540
Avg merge
3d 2h
Merged PRs (30d)
18

Description

Feature Request

Currently TidbInitializer can connect to the cluster and setup list of accounts based on a secret.
(docs: https://docs.pingcap.com/tidb-in-kubernetes/stable/initialize-a-cluster/#set-initial-account-and-password )

The problem with this is that there is some time in between where the cluster is deployed and when the accounts are configured that might allow someone to access the cluster.

Workaround: Disallow network access to the cluster until it is fully configured.

Possible solution 1:

  1. Start the cluster with --initialize-secure and/or with only UNIX socket access.
  2. Setup the accounts
  3. Restart the TiDB instance if needed to allow network access

Possible solution 2:
Use --initialize-sql-file to setup the accounts during TiDB startup.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating TidbInitializer and reviewing how it currently connects and configures accounts, then compare the documented --initialize-secure, UNIX socket, and --initialize-sql-file approaches. Define the selected initialization flow and verify that accounts are configured before network access is available, using any existing project tests you find around TidbInitializer.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.