Quick onboard
Deployment
Data Modeling
Connecting
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
GSSAPI-encrypted connections encrypt all data transmitted over the network, including queries and result sets (passwords are not sent over the network). This ensures data integrity and confidentiality during transmission.
In YMatrix, GSSAPI encryption is implemented using Kerberos. Kerberos provides a secure authentication mechanism, which can be configured in the pg_hba.conf file. It allows clients to authenticate using Kerberos tickets in coordination with the Kerberos Key Distribution Center (KDC), ensuring that only authorized users can access the database.
pg_hba.conf configuration:hostgssenc all mxadmin 10.51.0.40/32 gss
Note!
Ensure that the YMatrix server is installed and running. If not yet installed, refer to Quick Installation for setup instructions.
sudo yum install krb5-workstation
On the Kerberos administration server, create a service principal for the YMatrix service. The service principal name typically follows the format servicename/hostname@realm, for example:
postgres/[email protected].
kadmin tool to create the service principal: kadmin
kadmin prompt, run the following command to create a service principal with a random key: addprinc -randkey postgres/[email protected]
Export the service principal's key into a keytab file. Run the following command:
Note!
Replace/path/to/postgresql.keytabwith the desired path for storing the keytab file.
ktadd -k /path/to/postgresql.keytab
postgres/[email protected]
Copy the generated keytab file to the host running the YMatrix server, and ensure the YMatrix server has read access to this file. For example:
scp /path/to/postgresql.keytab
[email protected]:/etc/postgresql.keytab
pg_hba.conf fileIn the pg_hba.conf file, add or modify the authentication method to gss.
host all all 10.51.0.40/32 gss
This configuration allows clients from the 10.51.0.40/32 subnet to access all databases using GSSAPI (Kerberos) authentication.
postgresql.conf fileOpen the YMatrix main configuration file postgresql.conf, and set the krb_server_keyfile parameter to specify the path of the keytab file.
krb_server_keyfile = '/etc/postgresql.keytab'
After saving changes to the configuration files, restart the YMatrix server to apply the new settings.
mxstop -u
Map the Kerberos principal to a database user:
CREATE USER "username@REALM";
On the client system, use the kinit command to obtain a Kerberos ticket:
kinit username@REALM
Replace
usernamewith the user's Kerberos username andREALMwith the Kerberos realm.
Use a YMatrix client tool that supports Kerberos authentication to connect to the database. If the client supports automatic Kerberos ticket acquisition, you do not need to manually specify a username or password.
psql -h server.example.com -U username dbname
-- Successful login message
GSSAPI-encrypted connection
Check the YMatrix server log files to confirm that Kerberos authentication was successful.