LoginSignup
2
1

はじめに

PowerVC の自己証明書の置き換えを確認した参考ログです。


環境

PowerVC 2.2.0 (RHEL 8.6 ppc64le)

# cat /opt/ibm/powervc/version.properties
[2.2.0 Install]
name = IBM PowerVC
version = 2.2.0
build = 20231102-0930
oem = no
install-date = 2024-04-09
cloud_enabled = yes
cluster = pvc220
install_method = cluster

確認

現在の証明書の内容を確認します。

# openssl x509 -text -noout -in /etc/pki/tls/certs/powervc.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 1 (0x1)
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN = 172.16.xxx.xxb
        Validity
            Not Before: Apr  9 07:58:18 2024 GMT
            Not After : Jan 28 07:58:18 2027 GMT
        Subject: CN = 172.16.xxx.xxb
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
                Modulus:
                    00:c5:f6:xxx 省略 xxxxxx4a:59:7c:07:
                    xx:xx
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Alternative Name:
                DNS:pvc-test, DNS:pvc-test, DNS:pvc-test, IP Address:172.16.xxx.xxa, IP Address:172.16.xxx.xxb
    Signature Algorithm: sha256WithRSAEncryption
         4c:41:a2:b3:c3:f7:09:50:23xxxx 省略 xxxxxx
         xx:xx

・Issuerに Common Name "CN = 172.16.xxx.xxb" (PowerVC Virtual IP のアドレス) が入っています。
・RSA Public-Key: (2048 bit) です。
・Signature Algorithm: sha256WithRSAEncryption が使用されています。


証明書のバックアップを取得

# mkdir /work/pki_backup
# cp -p /etc/pki/tls/certs/powervc.crt /work/pki_backup/
# cp -p /etc/pki/tls/private/powervc.key /work/pki_backup/

# ls -l /work/pki_backup/	
total 8
-r--r--r-- 1 root pvcservices 1094 Apr  9 03:58 powervc.crt
-r--r----- 1 root pvcservices 1704 Apr  9 03:58 powervc.key

SSL 証明書を作成


# mkdir /work/pki_new/
# cd /work/pki_new

# openssl genrsa -out powervc.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
..........................................................+++++
.....................................................+++++
e is 65537 (0x010001)

# echo $?
0


# ls -l
-rw------- 1 root root 1679 Jun 13 07:21 powervc.key
# openssl req -new -x509 -key powervc.key -sha256 -out powervc.crt -days 3096
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:172.16.xxx.xxb
Email Address []:

# echo $?
0

# ls -l
-rw-r--r-- 1 root root 1306 Jun 13 07:23 powervc.crt
-rw------- 1 root root 1679 Jun 13 07:21 powervc.key

作成した powervc.crt を確認します。

# openssl x509 -text -noout -in ./powervc.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            7b:99:0e:5c:d8:b9:07:cf:af:b3:52:ca:a3:b9:79:9b:e4:48:3f:c4
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = XX, L = Default City, O = Default Company Ltd, CN = 172.16.xxx.xxb
        Validity
            Not Before: Jun 13 11:23:30 2024 GMT
            Not After : Dec  4 11:23:30 2032 GMT
        Subject: C = XX, L = Default City, O = Default Company Ltd, CN = 172.16.xxx.xxb
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
                Modulus:
                    00:c2:32### 省略 ####
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                DE:CF:A8:C5:5D:B6:AD:2F:EF:0B:2E:54:38:C4:97:F5:A5:89:8B:5B
            X509v3 Authority Key Identifier:
                keyid:DE:CF:A8:C5:5D:B6:AD:2F:EF:0B:2E:54:38:C4:97:F5:A5:89:8B:5B

            X509v3 Basic Constraints: critical
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
         2f:8e:77:d2:5b### 省略 ####f:99:e4:45:13:35:85:

以前の証明書の違いとして、X509v3 Subject Alternative Name など入っていない設定もあります。
openssl コマンドのオプション指定は検討が必要かもしれません。


新しい証明書に置き換え

ひとまず置き換えてみます。

# cp powervc.crt /etc/pki/tls/certs/
cp: overwrite '/etc/pki/tls/certs/powervc.crt'? y

# cp powervc.key /etc/pki/tls/private/
cp: overwrite '/etc/pki/tls/private/powervc.key'? y

コピーコマンドでは -p オプションを使いがちですが、ここではあえて使用しないことで元のパーミッションを踏襲しています。


PowerVC 再起動

(コマンドのみ。ログは省略)

停止

# powervc-services stop

確認

# powervc-services status

起動

# powervc-services start 

確認

# powervc-services status

おわりに

この方法でPowerVCの正常起動は確認できました。
openstack コマンドを打つことも確認できています。


ただしこれは、この環境での確認のため、他の環境では Subject Alternative Name が必要などの違いがある可能性があります。

次に詳細な設定方法の記載があります。

Securing PowerVC web interface with self-signed or CA signed certificates.

正しく方法はサポートに手順確認が望ましいと思います。

証明書周りの設定、複雑です...

以上です。

2
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1