Skip to main content
日本語は機械翻訳による参考訳です。内容に矛盾や不一致があった場合には、英語の内容が優先されます。

ONTAPストレージバックエンドで認証を有効にする

共同作成者

Astra Control Centerには、ONTAP バックエンドの認証に次の2つのモードがあります。

  • クレデンシャルベースの認証:必要な権限を持つONTAP ユーザのユーザ名とパスワード。ONTAP のバージョンとの互換性を最大限に高めるには、adminやvsadminなどの事前定義されたセキュリティログインロールを使用する必要があります。

  • 証明書ベースの認証:Astra Control Centerは、バックエンドにインストールされている証明書を使用してONTAP クラスタと通信することもできます。クライアント証明書、キー、および信頼されたCA証明書を使用する(推奨)。

後で既存のバックエンドを更新して、あるタイプの認証から別の方法に移行することができます。一度にサポートされる認証方式は1つだけです。

クレデンシャルベースの認証を有効にします

Astra Control Centerには、クラスタを対象としたクレデンシャルが必要です admin ONTAP バックエンドと通信するため。事前定義された標準のロール(など)を使用する必要があります admin。これにより、Astra Control Centerの今後のリリースで使用する機能APIが公開される可能性がある、将来のONTAP リリースとの前方互換性が確保されます。

メモ カスタムのセキュリティログインロールはAstra Control Centerで作成して使用できますが、推奨されません。

バックエンド定義の例を次に示します。

{
  "version": 1,
  "backendName": "ExampleBackend",
  "storageDriverName": "ontap-nas",
  "managementLIF": "10.0.0.1",
  "dataLIF": "10.0.0.2",
  "svm": "svm_nfs",
  "username": "admin",
  "password": "secret"
}

クレデンシャルがプレーンテキストで保存されるのは、バックエンド定義のみです。クレデンシャルの知識が必要なのは、バックエンドの作成または更新だけです。そのため、Kubernetes管理者またはストレージ管理者が実行するのは管理者専用の操作です。

証明書ベースの認証を有効にします

Astra Control Centerでは、証明書を使用して新規および既存のONTAP バックエンドと通信できます。バックエンド定義には、次の情報を入力する必要があります。

  • clientCertificate:クライアント証明書。

  • clientPrivateKey:関連付けられた秘密鍵。

  • trustedCACertificate:信頼されたCA証明書。信頼された CA を使用する場合は、このパラメータを指定する必要があります。信頼された CA が使用されていない場合は無視してかまいません。

次のいずれかのタイプの証明書を使用できます。

  • 自己署名証明書

  • サードパーティの証明書

自己署名証明書による認証を有効にします

一般的なワークフローは次の手順で構成されます。

手順
  1. クライアント証明書とキーを生成します。生成時に、認証に使用するONTAP ユーザに共通名(CN)を設定します。

    openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -keyout k8senv.key -out k8senv.pem -subj "/C=US/ST=NC/L=RTP/O=NetApp/CN=<common-name>"
  2. タイプがのクライアント証明書をインストールします client-ca とキーをONTAP 入力します。

    security certificate install -type client-ca -cert-name <certificate-name> -vserver <vserver-name>
    security ssl modify -vserver <vserver-name> -client-enabled true
  3. ONTAP のセキュリティログインロールが証明書認証方式をサポートしていることを確認します。

    security login create -user-or-group-name vsadmin -application ontapi -authentication-method cert -vserver <vserver-name>
    security login create -user-or-group-name vsadmin -application http -authentication-method cert -vserver <vserver-name>
  4. 生成した証明書を使用して認証をテストします。ONTAP 管理LIF>と<vserver name> を管理のIPと名前に置き換えてください。LIFのサービスポリシーがに設定されていることを確認する必要があります default-data-management

    curl -X POST -Lk https://<ONTAP-Management-LIF>/servlets/netapp.servlets.admin.XMLrequest_filer --key k8senv.key --cert ~/k8senv.pem -d '<?xml version="1.0" encoding="UTF-8"?><netapp xmlns=http://www.netapp.com/filer/admin version="1.21" vfiler="<vserver-name>"><vserver-get></vserver-get></netapp>
  5. 前の手順で得た値を使用して、Astra Control CenterのUIでストレージバックエンドを追加します。

サードパーティの証明書による認証を有効にします

サードパーティの証明書がある場合は、次の手順で証明書ベースの認証を設定できます。

手順
  1. 秘密鍵とCSRを生成します。

    openssl req -new -newkey rsa:4096 -nodes -sha256 -subj "/" -outform pem -out ontap_cert_request.csr -keyout ontap_cert_request.key -addext "subjectAltName = DNS:<ONTAP_CLUSTER_FQDN_NAME>,IP:<ONTAP_MGMT_IP>”
  2. CSRをWindows CA(サードパーティCA)に渡し、署名済み証明書を問題 します。

  3. 署名済み証明書をダウンロードし、「ontap_signed_cert.crt」という名前を付けます。

  4. Windows CA(サードパーティCA)からルート証明書をエクスポートします。

  5. このファイルに名前を付けます ca_root.crt

    これで、次の3つのファイルが作成されました。

    • 秘密鍵ontap_signed_request.key (これは、ONTAP のサーバ証明書に対応するキーです。サーバ証明書のインストール時に必要です)。

    • 署名済み証明書ontap_signed_cert.crt (これは、ONTAP の_server certificate_inとも呼ばれます)。

    • ルートCA証明書ca_root.crt (これは、ONTAP の_server-ca certificate_inとも呼ばれます)。

  6. これらの証明書をONTAP にインストールします。生成してインストールします server および server-ca ONTAP の証明書。

    sample.yamlの展開
    # Copy the contents of ca_root.crt and use it here.
    
    security certificate install -type server-ca
    
    Please enter Certificate: Press <Enter> when done
    
    -----BEGIN CERTIFICATE-----
    <certificate details>
    -----END CERTIFICATE-----
    
    
    You should keep a copy of the CA-signed digital certificate for future reference.
    
    The installed certificate's CA and serial number for reference:
    
    CA:
    serial:
    
    The certificate's generated name for reference:
    
    
    ===
    
    # Copy the contents of ontap_signed_cert.crt and use it here. For key, use the contents of ontap_cert_request.key file.
    security certificate install -type server
    Please enter Certificate: Press <Enter> when done
    
    -----BEGIN CERTIFICATE-----
    <certificate details>
    -----END CERTIFICATE-----
    
    Please enter Private Key: Press <Enter> when done
    
    -----BEGIN PRIVATE KEY-----
    <private key details>
    -----END PRIVATE KEY-----
    
    Enter certificates of certification authorities (CA) which form the certificate chain of the server certificate. This starts with the issuing CA certificate of the server certificate and can range up to the root CA certificate.
    Do you want to continue entering root and/or intermediate certificates {y|n}: n
    
    The provided certificate does not have a common name in the subject field.
    Enter a valid common name to continue installation of the certificate: <ONTAP_CLUSTER_FQDN_NAME>
    
    You should keep a copy of the private key and the CA-signed digital certificate for future reference.
    The installed certificate's CA and serial number for reference:
    CA:
    serial:
    The certificate's generated name for reference:
    
    
    ==
    # Modify the vserver settings to enable SSL for the installed certificate
    
    ssl modify -vserver <vserver_name> -ca <CA>  -server-enabled true -serial <serial number>       (security ssl modify)
    
    ==
    # Verify if the certificate works fine:
    
    openssl s_client -CAfile ca_root.crt -showcerts -servername server -connect <ONTAP_CLUSTER_FQDN_NAME>:443
    CONNECTED(00000005)
    depth=1 DC = local, DC = umca, CN = <CA>
    verify return:1
    depth=0
    verify return:1
    write W BLOCK
    ---
    Certificate chain
    0 s:
       i:/DC=local/DC=umca/<CA>
    
    -----BEGIN CERTIFICATE-----
    <Certificate details>
  7. パスワードを使用しない通信用に同じホストのクライアント証明書を作成します。Astra Control Centerは、このプロセスを使用してONTAP と通信します。

  8. クライアント証明書を生成してONTAP にインストールします。

    sample.yamlの展開
    # Use /CN=admin or use some other account which has privileges.
    openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -keyout ontap_test_client.key -out ontap_test_client.pem -subj "/CN=admin"
    
    Copy the content of ontap_test_client.pem file and use it in the below command:
    security certificate install -type client-ca -vserver <vserver_name>
    
    Please enter Certificate: Press <Enter> when done
    
    -----BEGIN CERTIFICATE-----
    <Certificate details>
    -----END CERTIFICATE-----
    
    You should keep a copy of the CA-signed digital certificate for future reference.
    The installed certificate's CA and serial number for reference:
    
    CA:
    serial:
    The certificate's generated name for reference:
    
    
    ==
    
    ssl modify -vserver <vserver_name> -client-enabled true
    (security ssl modify)
    
    # Setting permissions for certificates
    security login create -user-or-group-name admin -application ontapi -authentication-method cert -role admin -vserver <vserver_name>
    
    security login create -user-or-group-name admin -application http -authentication-method cert -role admin -vserver <vserver_name>
    
    ==
    
    #Verify passwordless communication works fine with the use of only certificates:
    
    curl --cacert ontap_signed_cert.crt  --key ontap_test_client.key --cert ontap_test_client.pem https://<ONTAP_CLUSTER_FQDN_NAME>/api/storage/aggregates
    {
    "records": [
    {
    "uuid": "f84e0a9b-e72f-4431-88c4-4bf5378b41bd",
    "name": "<aggr_name>",
    "node": {
    "uuid": "7835876c-3484-11ed-97bb-d039ea50375c",
    "name": "<node_name>",
    "_links": {
    "self": {
    "href": "/api/cluster/nodes/7835876c-3484-11ed-97bb-d039ea50375c"
    }
    }
    },
    "_links": {
    "self": {
    "href": "/api/storage/aggregates/f84e0a9b-e72f-4431-88c4-4bf5378b41bd"
    }
    }
    }
    ],
    "num_records": 1,
    "_links": {
    "self": {
    "href": "/api/storage/aggregates"
    }
    }
    }%
  9. Astra Control CenterのUIでストレージバックエンドを追加し、次の値を指定します。

    • クライアント証明書:ontap_test_client.pem

    • 秘密鍵:ontap_test_client.key

    • 信頼されたCA証明書:ontap_signed_cert.crt