次の方法で共有


Azure Stack Hub の証明書署名要求を生成する

Azure Stack Hub 適合性チェッカー ツールを使用して、Azure Stack Hub のデプロイに適した証明書署名要求 (CSP) を作成するか、既存のデプロイの証明書を更新します。 デプロイする前に、十分なリード タイムで証明書を要求、生成、検証することが重要です。

このツールは、この記事の上部にある [CSR 証明書の選択] シナリオ セレクターに基づいて、次の証明書を要求するために使用されます。

  • 新しい展開の標準証明書: この記事の上部にある [CSR 証明書シナリオの選択] セレクターを使用して、[新しい展開] を選択します。
  • 既存の展開の証明書の更新: この記事の上部にある [CSR 証明書シナリオの選択] セレクターを使用して[更新]を選択します。
  • サービスとしてのプラットフォーム (PaaS) 証明書: 必要に応じて、標準証明書と更新証明書の両方で生成できます。 詳細については、 Azure Stack Hub 公開キー 基盤 (PKI) 証明書の要件 (オプションの PaaS 証明書) を参照してください。

[前提条件]

Azure Stack Hub デプロイ用の PKI 証明書の CSR を生成する前に、システムが次の前提条件を満たしている必要があります。

  • Windows 10 以降または Windows Server 2016 以降のコンピューター上に存在する必要があります。
  • 次のコマンドレットを使用して、PowerShell プロンプト (5.1 以降) から Azure Stack Hub 適合性チェッカー ツール をインストールします。
         Install-Module Microsoft.AzureStack.ReadinessChecker -Force -AllowPrerelease
    
  • 証明書には次の属性が必要です。
    • リージョン名
    • 外部完全修飾ドメイン名 (FQDN)
    • サブジェクト

新しいデプロイ証明書の CSR を生成する

証明書署名要求を生成するには、昇格が必要です。 昇格が不可能な制限された環境では、このツールを使用して、Azure Stack Hub 外部証明書に必要なすべての情報を含むクリア テキスト テンプレート ファイルを生成できます。 次に、公開キーと秘密キーのペアの生成を完了するには、管理者特権セッションでこれらのテンプレート ファイルを使用する必要があります。 詳細については、以下を参照してください。

新しい Azure Stack Hub PKI 証明書の CSP を準備するには、次の手順を実行します。

  1. 準備チェッカー ツールをインストールしたコンピューターで PowerShell セッションを開きます。

  2. 次の変数を宣言します。

    <regionName>.<externalFQDN> は、Azure Stack Hub 内のすべての外部 DNS 名が作成される基礎を形成します。 次の例では、ポータルは portal.east.azurestack.contoso.com

    $outputDirectory = "$ENV:USERPROFILE\Documents\AzureStackCSR" # An existing output directory
    $IdentitySystem = "AAD"                     # Use "AAD" for Azure Active Director, "ADFS" for Active Directory Federation Services
    $regionName = 'east'                        # The region name for your Azure Stack Hub deployment
    $externalFQDN = 'azurestack.contoso.com'    # The external FQDN for your Azure Stack Hub deployment
    

次に、同じ PowerShell セッションを使用して CSR を生成します。 手順は、以下で選択する 件名 の形式に固有です。

Azure Stack Hub サービスの最初の DNS 名は、証明書要求の CN フィールドとして構成されます。

  1. 例えば、件名を宣言してください。

    $subject = "C=US,ST=Washington,L=Redmond,O=Microsoft,OU=Azure Stack Hub"
    
  1. 次のいずれかを完了して CSR を生成します。

    • 運用環境の デプロイ環境では、最初のスクリプトによってデプロイ証明書の CSR が生成されます。

      New-AzsHubDeploymentCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory -IdentitySystem $IdentitySystem
      
    • 2 番目のスクリプトは、必要に応じて -IncludeContainerRegistry を使用し、デプロイメント証明書の CSR と同時に Azure Container Registry の CSR を生成します。

      New-AzsHubDeploymentCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory -IdentitySystem $IdentitySystem -IncludeContainerRegistry
      
    • 3 番目のスクリプトでは、インストールした任意の PaaS サービスに対して CSR が生成されます。

      # App Services
      New-AzsHubAppServicesCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory
      
      # DBAdapter (SQL/MySQL)
      New-AzsHubDbAdapterCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory
      
      # EventHubs
      New-AzsHubEventHubsCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory
      
      # Azure Container Registry
      New-AzsHubAzureContainerRegistryCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory 
      
    • 低い特権環境では、必要な属性が宣言されたクリア テキスト証明書テンプレート ファイルを生成するには、-LowPrivilege パラメーターを追加します。

      New-AzsHubDeploymentCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -subject $subject -OutputRequestPath $OutputDirectory -IdentitySystem $IdentitySystem -LowPrivilege
      
    • 開発環境とテスト環境では、複数のサブジェクトの別名を持つ 1 つの CSR を生成するには、-RequestType SingleCSRパラメーターと値を追加します。

      Von Bedeutung

      運用環境では、この方法を使用 しないことを お勧めします。

      New-AzsHubDeploymentCertificateSigningRequest -RegionName $regionName -FQDN $externalFQDN -RequestType SingleCSR -subject $subject -OutputRequestPath $OutputDirectory -IdentitySystem $IdentitySystem
      

最後の手順を完了します。

  1. 出力を確認します。

    Starting Certificate Request Process for Deployment
    CSR generating for following SAN(s): *.adminhosting.east.azurestack.contoso.com,*.adminvault.east.azurestack.contoso.com,*.blob.east.azurestack.contoso.com,*.hosting.east.azurestack.contoso.com,*.queue.east.azurestack.contoso.com,*.table.east.azurestack.contoso.com,*.vault.east.azurestack.contoso.com,adminmanagement.east.azurestack.contoso.com,adminportal.east.azurestack.contoso.com,management.east.azurestack.contoso.com,portal.east.azurestack.contoso.com
    Present this CSR to your Certificate Authority for Certificate Generation:  C:\Users\username\Documents\AzureStackCSR\Deployment_east_azurestack_contoso_com_SingleCSR_CertRequest_20200710165538.req
    Certreq.exe output: CertReq: Request Created
    
  2. -LowPrivilege パラメーターを使用した場合は、C:\Users\username\Documents\AzureStackCSR サブディレクトリに .inf ファイルが生成されました。 例えば次が挙げられます。

    C:\Users\username\Documents\AzureStackCSR\Deployment_east_azurestack_contoso_com_SingleCSR_CertRequest_20200710165538_ClearTextTemplate.inf

    昇格が許可されているシステムにファイルをコピーし、次の構文を使用して certreq で各要求に署名 certreq -new <example.inf> <example.req>。 次に、CA によって署名された新しい証明書を、管理者特権システムで生成される秘密キーと照合する必要があるため、その管理者特権システムでプロセスの残りの部分を完了します。

  • システムのリージョンと外部ドメイン名 (FQDN) は、既存の証明書から属性を抽出するためのエンドポイントを決定するために、準備チェッカーによって使用されます。 シナリオに次のいずれかが当てはまる場合は、この記事の上部にある [CSR 証明書シナリオの選択 ] セレクターを使用し、代わりにこの記事の 新しい展開 バージョンを選択する必要があります。
    • サブジェクト、キーの長さ、署名アルゴリズムなど、エンドポイントの証明書の属性を変更する必要があります。
    • 共通名属性のみを含む証明書のサブジェクトを使用する場合。
  • 開始する前に、Azure Stack Hub システムの HTTPS 接続があることを確認します。

更新証明書の CSR を生成する

このセクションでは、既存の Azure Stack Hub PKI 証明書を更新するための CSP の準備について説明します。

CSR の生成

  1. 準備チェッカー ツールをインストールしたコンピューターで PowerShell セッションを開きます。

  2. 次の変数を宣言します。

    準備チェッカーでは、 stampEndpoint と先頭に付加された文字列を使用して、既存の証明書を検索します。 たとえば、 portal.east.azurestack.contoso.com はデプロイ証明書、app services 証明書の sso.appservices.east.azurestack.contoso.com などに使用されます。

    $regionName = 'east'                                            # The region name for your Azure Stack Hub deployment
    $externalFQDN = 'azurestack.contoso.com'                        # The external FQDN for your Azure Stack Hub deployment    
    $stampEndpoint = "$regionName.$externalFQDN"
    $outputDirectory = "$ENV:USERPROFILE\Documents\AzureStackCSR"   # Declare the path to an existing output directory
    
  3. 次の 1 つ以上を完了して CSR を生成します。

    • 運用環境の場合、最初のスクリプトはデプロイ証明書の CSP を生成します。

      New-AzsHubDeploymentCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory
      
    • 2 番目のスクリプトは、必要に応じて -IncludeContainerRegistry を使用し、デプロイメント証明書の CSR と同時に Azure Container Registry の CSR を生成します。

      New-AzsHubDeploymentCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory -IncludeContainerRegistry
      
    • 3 番目のスクリプトでは、インストールした任意の PaaS サービスに対して CSR が生成されます。

      # App Services
      New-AzsHubAppServicesCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory
      
      # DBAdapter
      New-AzsHubDBAdapterCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory
      
      # EventHubs
      New-AzsHubEventHubsCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory
      
      # Azure Container Registry
      New-AzsHubAzureContainerRegistryCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory 
      
    • 開発環境とテスト環境では、複数のサブジェクトの別名を持つ 1 つの CSR を生成するには、-RequestType SingleCSRパラメーターと値を追加します。

      Von Bedeutung

      運用環境では、この方法を使用 しないことを お勧めします。

      New-AzsHubDeploymentCertificateSigningRequest -StampEndpoint $stampEndpoint -OutputRequestPath $OutputDirectory -RequestType SingleCSR
      
  4. 出力を確認します。

    Querying StampEndpoint portal.east.azurestack.contoso.com for existing certificate
    Starting Certificate Request Process for Deployment
    CSR generating for following SAN(s): *.adminhosting.east.azurestack.contoso.com,*.adminvault.east.azurestack.contoso.com,*.blob.east.azurestack.contoso.com,*.hosting.east.azurestack.contoso.com,*.queue.east.azurestack.contoso.com,*.table.east.azurestack.contoso.com,*.vault.east.azurestack.contoso.com,adminmanagement.east.azurestack.contoso.com,adminportal.east.azurestack.contoso.com,management.east.azurestack.contoso.com,portal.east.azurestack.contoso.com
    Present this CSR to your certificate authority for certificate generation: C:\Users\username\Documents\AzureStackCSR\Deployment_east_azurestack_contoso_com_SingleCSR_CertRequest_20200710122723.req
    Certreq.exe output: CertReq: Request Created
    

準備ができたら、生成された .req ファイルを CA (内部またはパブリック) に送信します。 $outputDirectory変数で指定されたディレクトリには、CA に送信する必要がある CSR が含まれています。 このディレクトリには、参照用に、証明書要求の生成中に使用される .inf ファイルを含む子ディレクトリも含まれています。 AZURE Stack Hub PKI の要件を満たす生成された要求を使用して、CA によって証明書が生成されることを確認してください。

次のステップ

証明機関から証明書を受け取ったら、「同じシステムで Azure Stack Hub PKI 証明書を準備 する」の手順に従います。