第3章 Authenticating API Calls
Interaction with the Satellite API requires SSL authentication with Satellite Server CA certificate and authentication with valid Satellite user credentials. This chapter outlines the authenticating methods you can use.
3.1. SSL Authentication Overview リンクのコピーリンクがクリップボードにコピーされました!
Red Hat Satellite uses HTTPS, which provides a degree of encryption and identity verification when communicating with a Red Hat Satellite Server. Satellite 6.8 does not support non-SSL communications.
Each Red Hat Satellite Server uses a self-signed certificate. This certificate acts as both the server certificate to verify the encryption key and the certificate authority (CA) to trust the identity of Satellite Server.
3.1.1. Configuring SSL Authentication リンクのコピーリンクがクリップボードにコピーされました!
Use the following procedure to configure an SSL authentication for the API requests to Satellite Server.
Procedure
Obtain a certificate from the Satellite Server with which you want to communicate using one of the following options:
If you execute the command from a remote server, obtain a certificate using SSH:
scp root@satellite.example.com:/var/www/html/pub/katello-server-ca.crt ./
$ scp root@satellite.example.com:/var/www/html/pub/katello-server-ca.crt ./Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you execute the command directly on the Satellite Server, copy the certificate to the current directory:
cp /var/www/html/pub/katello-server-ca.crt ./
$ cp /var/www/html/pub/katello-server-ca.crt ./Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Use the API request with the
--cacert katello-server-ca.crtoption to verify the identity of the Satellite Server:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Network Security Services (NSS) database to store the
katello-server-ca.crtcertificate:certutil -N -d sql:$HOME/.pki/nssdb
$ certutil -N -d sql:$HOME/.pki/nssdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Permanently include the certificate in the NSS database:
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "Red Hat Satellite" \ -i katello-server-ca.crt
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "Red Hat Satellite" \ -i katello-server-ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the certificate is present in the NSS database by entering the API request without the
--cacertoption:curl --request GET \ --user sat_username:sat_password \ https://satellite.example.com/api/v2/hosts
$ curl --request GET \ --user sat_username:sat_password \ https://satellite.example.com/api/v2/hostsCopy to Clipboard Copied! Toggle word wrap Toggle overflow