-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMM-13171 Add ClickHouse credentials #3646
Open
ademidoff
wants to merge
21
commits into
v3
Choose a base branch
from
PMM-13171-add-clickhouse-credentials
base: v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c8f4e00
PMM-13171 Update Readme
ademidoff 9878b9e
PMM-13171 Add credentials via env variables
ademidoff e03e35c
PMM-13171 Use v1 in protobuf names
ademidoff cd382b4
PMM-13171 Add empty line
ademidoff f10146f
PMM-13171 Remove redundant const
ademidoff d21f9bf
PMM-13171 Pass CH creds to qan-api spec
ademidoff d7eb535
PMM-13171 Align parameters
ademidoff 26ebc09
Merge branch 'v3' into PMM-13171-add-clickhouse-credentials
ademidoff 4ada2cb
PMM-13171 Fix the spelling
ademidoff 448eaa0
PMM-13171 Fix the test
ademidoff 790399d
PMM-13171 Add user password and change users' config
ademidoff 13b12d1
PMM-13171 Fix the tests
ademidoff 6d12e8b
PMM-13171 Fix the typo
ademidoff 604f7b1
PMM-13171 Remove logging clickhouse password
ademidoff 6cc7dde
PMM-13171 Add creds to clickhouse telemetry
ademidoff b7f9fc0
PMM-13171 Do not log clickhouse password
ademidoff 683507e
PMM-13171 Update docker-compose.yml
ademidoff 62f1fd5
PMM-13171 Update the documentation
ademidoff 155a900
PMM-13171 Update the HA documentation
ademidoff 9c7ef1b
Merge branch 'v3' into PMM-13171-add-clickhouse-credentials
ademidoff 6786624
Merge branch 'v3' into PMM-13171-add-clickhouse-credentials
ademidoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ | |
<!-- Compatibility with MySQL protocol. | ||
ClickHouse will pretend to be MySQL for applications connecting to this port. | ||
--> | ||
<mysql_port>9004</mysql_port> | ||
<!-- <mysql_port>9004</mysql_port> --> | ||
|
||
<!-- Compatibility with PostgreSQL protocol. | ||
ClickHouse will pretend to be PostgreSQL for applications connecting to this port. | ||
|
@@ -484,9 +484,9 @@ | |
<tmp_path>/srv/clickhouse/tmp/</tmp_path> | ||
|
||
<!-- Disable AuthType plaintext_password and no_password for ACL. --> | ||
<allow_plaintext_password>1</allow_plaintext_password> | ||
<allow_no_password>1</allow_no_password> | ||
<allow_implicit_no_password>1</allow_implicit_no_password> | ||
<allow_plaintext_password>0</allow_plaintext_password> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will harden security, for it was too poor before. |
||
<allow_no_password>0</allow_no_password> | ||
<allow_implicit_no_password>0</allow_implicit_no_password> | ||
|
||
<!-- When a user does not specify a password type in the CREATE USER query, the default password type is used. | ||
Accepted values are: 'plaintext_password', 'sha256_password', 'double_sha1_password', 'bcrypt_password'. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<clickhouse> | ||
<!-- See also the files in users.d directory where the settings can be overridden. --> | ||
|
||
<!-- Profiles of settings. --> | ||
<profiles> | ||
<!-- Default settings. --> | ||
<default> | ||
</default> | ||
|
||
<!-- Profile that allows only read queries. --> | ||
<readonly> | ||
<readonly>1</readonly> | ||
</readonly> | ||
</profiles> | ||
|
||
<!-- Users and ACL. --> | ||
<users> | ||
<!-- If user name was not specified, 'default' user is used. --> | ||
<default> | ||
<!-- See also the files in users.d directory where the password can be overridden. | ||
|
||
Password could be specified in plaintext or in SHA256 (in hex format). | ||
|
||
If you want to specify password in plaintext (not recommended), place it in 'password' element. | ||
Example: <password>qwerty</password>. | ||
Password could be empty. | ||
|
||
If you want to specify SHA256, place it in 'password_sha256_hex' element. | ||
Example: <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex> | ||
Restrictions of SHA256: impossibility to connect to ClickHouse using MySQL JS client (as of July 2019). | ||
|
||
If you want to specify double SHA1, place it in 'password_double_sha1_hex' element. | ||
Example: <password_double_sha1_hex>e395796d6546b1b65db9d665cd43f0e858dd4303</password_double_sha1_hex> | ||
|
||
If you want to specify a previously defined LDAP server (see 'ldap_servers' in the main config) for authentication, | ||
place its name in 'server' element inside 'ldap' element. | ||
Example: <ldap><server>my_ldap_server</server></ldap> | ||
|
||
If you want to authenticate the user via Kerberos (assuming Kerberos is enabled, see 'kerberos' in the main config), | ||
place 'kerberos' element instead of 'password' (and similar) elements. | ||
The name part of the canonical principal name of the initiator must match the user name for authentication to succeed. | ||
You can also place 'realm' element inside 'kerberos' element to further restrict authentication to only those requests | ||
whose initiator's realm matches it. | ||
Example: <kerberos /> | ||
Example: <kerberos><realm>EXAMPLE.COM</realm></kerberos> | ||
|
||
How to generate decent password: | ||
Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-' | ||
In first line will be password and in second - corresponding SHA256. | ||
|
||
How to generate double SHA1: | ||
Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-' | ||
In first line will be password and in second - corresponding double SHA1. | ||
--> | ||
<password_sha256_hex>7e099f39b84ea79559b3e85ea046804e63725fd1f46b37f281276aae20f86dc3</password_sha256_hex> | ||
|
||
<!-- List of networks with open access. | ||
|
||
To open access from everywhere, specify: | ||
<ip>::/0</ip> | ||
|
||
To open access only from localhost, specify: | ||
<ip>::1</ip> | ||
<ip>127.0.0.1</ip> | ||
|
||
Each element of list has one of the following forms: | ||
<ip> IP-address or network mask. Examples: 213.180.204.3 or 10.0.0.1/8 or 10.0.0.1/255.255.255.0 | ||
2a02:6b8::3 or 2a02:6b8::3/64 or 2a02:6b8::3/ffff:ffff:ffff:ffff::. | ||
<host> Hostname. Example: server01.clickhouse.com. | ||
To check access, DNS query is performed, and all received addresses compared to peer address. | ||
<host_regexp> Regular expression for host names. Example, ^server\d\d-\d\d-\d\.clickhouse\.com$ | ||
To check access, DNS PTR query is performed for peer address and then regexp is applied. | ||
Then, for result of PTR query, another DNS query is performed and all received addresses compared to peer address. | ||
Strongly recommended that regexp is ends with $ | ||
All results of DNS requests are cached till server restart. | ||
--> | ||
<networks> | ||
<ip>::/0</ip> | ||
</networks> | ||
|
||
<!-- Settings profile for user. --> | ||
<profile>default</profile> | ||
|
||
<!-- Quota for user. --> | ||
<quota>default</quota> | ||
|
||
<!-- User can create other users and grant rights to them. --> | ||
<!-- <access_management>1</access_management> --> | ||
</default> | ||
</users> | ||
|
||
<!-- Quotas. --> | ||
<quotas> | ||
<!-- Name of quota. --> | ||
<default> | ||
<!-- Limits for time interval. You could specify many intervals with different limits. --> | ||
<interval> | ||
<!-- Length of interval. --> | ||
<duration>3600</duration> | ||
|
||
<!-- No limits. Just calculate resource usage for time interval. --> | ||
<queries>0</queries> | ||
<errors>0</errors> | ||
<result_rows>0</result_rows> | ||
<read_rows>0</read_rows> | ||
<execution_time>0</execution_time> | ||
</interval> | ||
</default> | ||
</quotas> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We likely don't need to have that many ports open. Please review this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use it that way I think - so fair point.