-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
71134: security: remove the node TLS client cert exemption r=catj-cockroach,andy-kimball a=knz Fixes #71102. Release note (security update): It is not possible any more to use a node TLS certificate to establish a SQL connection with another username than `node`. This facility had existed as an "escape hatch" so that an operator could use the node cert to perform operations on behalf of another SQL user. However, this facility is not necessary: an operator with access to a node cert can log in as `node` directly and create new credentials for another user anyway. By removing this facility, we tighten the guarantee that the principal in the TLS client cert always matches the SQL identity. Co-authored-by: Raphael 'kena' Poss <[email protected]>
- Loading branch information
Showing
10 changed files
with
64 additions
and
20 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,20 @@ | |
|
||
set -e | ||
|
||
echo "Available certs:" | ||
ls -l /certs | ||
|
||
echo "Environment:" | ||
env | ||
|
||
echo "Creating a k5s token..." | ||
echo psql | kinit [email protected] | ||
|
||
echo "Preparing SQL user ahead of test" | ||
env \ | ||
PGSSLKEY=/certs/client.root.key \ | ||
PGSSLCERT=/certs/client.root.crt \ | ||
psql -c "ALTER USER root WITH PASSWORD rootpw" | ||
|
||
echo "Running test" | ||
./gss.test |
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 |
---|---|---|
|
@@ -2,10 +2,29 @@ | |
|
||
set -e | ||
|
||
psql -c "SET CLUSTER SETTING server.host_based_authentication.configuration = 'host all all all gss include_realm=0'" | ||
psql -c "CREATE USER tester" | ||
echo "Available certs:" | ||
ls -l /certs | ||
|
||
echo "Environment:" | ||
env | ||
|
||
echo "Creating a k5s token..." | ||
echo psql | kinit [email protected] | ||
|
||
export PGSSLKEY=/certs/client.root.key | ||
export PGSSLCERT=/certs/client.root.crt | ||
export PGUSER=root | ||
|
||
echo "Creating test user" | ||
psql -c "CREATE USER tester" | ||
echo "Configuring the HBA rule prior to running the test..." | ||
psql -c "SET CLUSTER SETTING server.host_based_authentication.configuration = 'host all all all gss include_realm=0'" | ||
|
||
echo "Testing the django connection..." | ||
|
||
unset PGSSLKEY | ||
unset PGSSLCERT | ||
export PGUSER=tester | ||
|
||
# Exit with error unless we find the expected error message. | ||
python manage.py inspectdb 2>&1 | grep 'use of GSS authentication requires an enterprise license' |
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