Sprawdzanie poprawności certyfikatów infrastruktury kluczy publicznych usługi Azure Stack HubValidate Azure Stack Hub PKI certificates
Narzędzie do sprawdzania gotowości centrum Azure Stack opisane w tym artykule jest dostępne z Galeria programu PowerShell.The Azure Stack Hub Readiness Checker tool described in this article is available from the PowerShell Gallery. Użyj narzędzia, aby sprawdzić, czy wygenerowane certyfikaty infrastruktury kluczy publicznych (PKI) są odpowiednie do wdrożenia wstępnego.Use the tool to validate that generated public key infrastructure (PKI) certificates are suitable for pre-deployment. Sprawdź poprawność certyfikatów przez pozostawienie wystarczająco dużo czasu na przetestowanie i wystawianie certyfikatów w razie potrzeby.Validate certificates by leaving enough time to test and reissue certificates if necessary.
Narzędzie sprawdzania gotowości wykonuje następujące walidacje certyfikatów:The Readiness Checker tool performs the following certificate validations:
- Analizuj plik PFXParse PFX
Sprawdza, czy jest prawidłowy plik PFX, prawidłowe hasło i czy informacje publiczne są chronione hasłem.Checks for valid PFX file, correct password, and whether the public information is protected by the password. - Data wygaśnięciaExpiry Date
Sprawdza co najmniej siedem dni.Checks for minimum validity of seven days. - Algorytm podpisuSignature algorithm
Sprawdza, czy algorytm podpisu nie jest SHA1.Checks that the signature algorithm isn't SHA1. - Klucz prywatnyPrivate Key
Sprawdza, czy klucz prywatny jest obecny i jest eksportowany z atrybutem komputera lokalnego.Checks that the private key is present and is exported with the local machine attribute. - Łańcuch certyfikatówCert chain
Sprawdza łańcuch certyfikatów, w tym sprawdzenie certyfikatów z podpisem własnym.Checks certificate chain is intact including a check for self-signed certificates. - Nazwy DNSDNS names
Sprawdza, czy sieć SAN zawiera odpowiednie nazwy DNS dla każdego z punktów końcowych lub jeśli istnieje pomocniczy symbol wieloznaczny.Checks the SAN contains relevant DNS names for each endpoint or if a supporting wildcard is present. - Użycie kluczaKey usage
Sprawdza, czy użycie klucza zawiera podpis cyfrowy i szyfrowanie klucza i sprawdza, czy ulepszone użycie klucza zawiera uwierzytelnianie serwera i uwierzytelnianie klienta.Checks if the key usage contains a digital signature and key encipherment and checks if enhanced key usage contains server authentication and client authentication. - Rozmiar kluczaKey size
Sprawdza, czy rozmiar klucza wynosi 2048 lub większy.Checks if the key size is 2048 or larger. - Kolejność łańcuchaChain order
Sprawdza kolejność innych certyfikatów, sprawdzając, czy kolejność jest poprawna.Checks the order of the other certificates validating that the order is correct. - Inne certyfikatyOther certificates
Upewnij się, że żadne inne certyfikaty nie zostały opakowane w PFX poza odpowiednim certyfikatem liścia i jego łańcuchem.Ensure no other certificates have been packaged in PFX other than the relevant leaf certificate and its chain.
Ważne
Certyfikat PKI jest plikiem PFX, a hasło powinno być traktowane jako informacje poufne.The PKI certificate is a PFX file and password should be treated as sensitive information.
Wymagania wstępnePrerequisites
Przed zweryfikowaniem certyfikatów PKI na potrzeby wdrożenia centrum Azure Stack należy spełnić następujące wymagania wstępne:Your system should meet the following prerequisites before validating PKI certificates for an Azure Stack Hub deployment:
- Microsoft Azure Stack narzędzia sprawdzania gotowości centrum.Microsoft Azure Stack Hub Readiness Checker.
- Certyfikaty SSL zostały wyeksportowane zgodnie z instrukcjami przygotowania.SSL Certificate(s) exported following the preparation instructions.
- DeploymentData.js.DeploymentData.json.
- Windows 10 lub Windows Server 2016.Windows 10 or Windows Server 2016.
Sprawdzanie poprawności certyfikatu usług podstawowychPerform core services certificate validation
Wykonaj następujące kroki, aby sprawdzić poprawność certyfikatów PKI centrum Azure Stack na potrzeby wdrażania i rotacji wpisów tajnych:Use these steps to validate the Azure Stack Hub PKI certificates for deployment and secret rotation:
Zainstaluj AzsReadinessChecker z wiersza polecenia programu PowerShell (5,1 lub nowszego), uruchamiając następujące polecenie cmdlet:Install AzsReadinessChecker from a PowerShell prompt (5.1 or above) by running the following cmdlet:
Install-Module Microsoft.AzureStack.ReadinessChecker -Force -AllowPrerelease
Utwórz strukturę katalogu certyfikatów.Create the certificate directory structure. W poniższym przykładzie można zmienić
<C:\Certificates\Deployment>
na wybraną nową ścieżkę katalogu.In the example below, you can change<C:\Certificates\Deployment>
to a new directory path of your choice.New-Item C:\Certificates\Deployment -ItemType Directory $directories = 'ACSBlob', 'ACSQueue', 'ACSTable', 'Admin Extension Host', 'Admin Portal', 'ARM Admin', 'ARM Public', 'KeyVault', 'KeyVaultInternal', 'Public Extension Host', 'Public Portal' $destination = 'C:\Certificates\Deployment' $directories | % { New-Item -Path (Join-Path $destination $PSITEM) -ItemType Directory -Force}
Uwaga
AD FS i Graph są wymagane, jeśli używasz AD FS jako systemu tożsamości.AD FS and Graph are required if you're using AD FS as your identity system. Na przykład:For example:
$directories = 'ACSBlob', 'ACSQueue', 'ACSTable', 'ADFS', 'Admin Extension Host', 'Admin Portal', 'ARM Admin', 'ARM Public', 'Graph', 'KeyVault', 'KeyVaultInternal', 'Public Extension Host', 'Public Portal'
- Umieść swoje certyfikaty w odpowiednich katalogach utworzonych w poprzednim kroku.Place your certificate(s) in the appropriate directories created in the previous step. Na przykład:For example:
C:\Certificates\Deployment\ACSBlob\CustomerCertificate.pfx
C:\Certificates\Deployment\Admin Portal\CustomerCertificate.pfx
C:\Certificates\Deployment\ARM Admin\CustomerCertificate.pfx
- Umieść swoje certyfikaty w odpowiednich katalogach utworzonych w poprzednim kroku.Place your certificate(s) in the appropriate directories created in the previous step. Na przykład:For example:
W oknie programu PowerShell Zmień wartości
RegionName
FQDN
iIdentitySystem
odpowiednie dla środowiska Azure Stack Hub, a następnie uruchom następujące polecenie cmdlet:In the PowerShell window, change the values ofRegionName
,FQDN
andIdentitySystem
appropriate to the Azure Stack Hub environment and run the following cmdlet:$pfxPassword = Read-Host -Prompt "Enter PFX Password" -AsSecureString Invoke-AzsHubDeploymentCertificateValidation -CertificatePath C:\Certificates\Deployment -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com -IdentitySystem AAD
Sprawdź dane wyjściowe i upewnij się, że wszystkie certyfikaty przechodzą wszystkie testy.Check the output and ensure that all certificates pass all tests. Na przykład:For example:
Invoke-AzsHubDeploymentCertificateValidation v1.2005.1286.272 started. Testing: KeyVaultInternal\KeyVaultInternal.pfx Thumbprint: E86699****************************4617D6 PFX Encryption: OK Expiry Date: OK Signature Algorithm: OK DNS Names: OK Key Usage: OK Key Length: OK Parse PFX: OK Private Key: OK Cert Chain: OK Chain Order: OK Other Certificates: OK Testing: ARM Public\ARMPublic.pfx Thumbprint: 8DC4D9****************************69DBAA PFX Encryption: OK Expiry Date: OK Signature Algorithm: OK DNS Names: OK Key Usage: OK Key Length: OK Parse PFX: OK Private Key: OK Cert Chain: OK Chain Order: OK Other Certificates: OK Testing: Admin Portal\AdminPortal.pfx Thumbprint: 6F9055****************************4AC0EA PFX Encryption: OK Expiry Date: OK Signature Algorithm: OK DNS Names: OK Key Usage: OK Key Length: OK Parse PFX: OK Private Key: OK Cert Chain: OK Chain Order: OK Other Certificates: OK Testing: Public Portal\PublicPortal.pfx Log location (contains PII): C:\Users\[*redacted*]\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log Report location (contains PII): C:\Users\[*redacted*]\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json Invoke-AzsHubDeploymentCertificateValidation Completed
Aby sprawdzić poprawność certyfikatów dla innych usług Azure Stack Hub, Zmień wartość parametru
-CertificateType
.To validate certificates for other Azure Stack Hub services, change the value for-CertificateType
. Na przykład:For example:# App Services Invoke-AzsHubAppServicesCertificateValidation -CertificatePath C:\Certificates\AppServices -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com # DBAdapter Invoke-AzsHubDBAdapterCertificateValidation -CertificatePath C:\Certificates\DBAdapter -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com # EventHubs Invoke-AzsHubEventHubsCertificateValidation -CertificatePath C:\Certificates\EventHubs -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com # IoTHub Invoke-AzsHubIoTHubCertificateValidation -CertificatePath C:\Certificates\IoTHub -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com
Każdy folder powinien zawierać pojedynczy plik PFX dla typu certyfikatu.Each folder should contain a single PFX file for the certificate type. Jeśli typ certyfikatu ma wymagania dotyczące certyfikatów, należy oczekiwać folderów zagnieżdżonych dla każdego pojedynczego certyfikatu i uwzględniania nazwy.If a certificate type has multi-certificate requirements, nested folders for each individual certificate are expected and name-sensitive. Poniższy kod przedstawia przykład struktury folderów/certyfikatów dla wszystkich typów certyfikatów i odpowiednią wartość dla
-CertificateType
i-CertificatePath
.The following code shows an example folder/certificate structure for all certificate types, and the appropriate value for-CertificateType
and-CertificatePath
.C:\>tree c:\SecretStore /A /F Folder PATH listing Volume serial number is 85AE-DF2E C:\SECRETSTORE \---AzureStack +---CertificateRequests \---Certificates +---AppServices # Invoke-AzsCertificateValidation ` | +---API # -CertificateType AppServices ` | | api.pfx # -CertificatePath C:\Certificates\AppServices | | | +---DefaultDomain | | wappsvc.pfx | | | +---Identity | | sso.pfx | | | \---Publishing | ftp.pfx | +---DBAdapter # Invoke-AzsCertificateValidation ` | dbadapter.pfx # -CertificateType DBAdapter ` | # -CertificatePath C:\Certificates\DBAdapter | +---Deployment # Invoke-AzsCertificateValidation ` | +---ACSBlob # -CertificateType Deployment ` | | acsblob.pfx # -CertificatePath C:\Certificates\Deployment | | | +---ACSQueue | | acsqueue.pfx ./. ./. ./. ./. ./. ./. ./. <- Deployment certificate tree trimmed. | \---Public Portal | portal.pfx | +---EventHubs # Invoke-AzsCertificateValidation ` | eventhubs.pfx # -CertificateType EventHubs ` | # -CertificatePath C:\Certificates\EventHubs | \---IoTHub # Invoke-AzsCertificateValidation ` iothub.pfx # -CertificateType IoTHub ` # -CertificatePath C:\Certificates\IoTHub
Znane problemyKnown issues
Objaw: testy są pomijaneSymptom: Tests are skipped
Przyczyna: AzsReadinessChecker pomija niektóre testy, jeśli zależność nie jest spełniona:Cause: AzsReadinessChecker skips certain tests if a dependency isn't met:
Inne certyfikaty są pomijane w przypadku niepowodzenia łańcucha certyfikatów.Other certificates are skipped if certificate chain fails.
Testing: ACSBlob\singlewildcard.pfx Read PFX: OK Signature Algorithm: OK Private Key: OK Cert Chain: OK DNS Names: Fail Key Usage: OK Key Size: OK Chain Order: OK Other Certificates: Skipped Details: The certificate records '*.east.azurestack.contoso.com' do not contain a record that is valid for '*.blob.east.azurestack.contoso.com'. Please refer to the documentation for how to create the required certificate file. The Other Certificates check was skipped because Cert Chain and/or DNS Names failed. Follow the guidance to remediate those issues and recheck. Log location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log Report location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json Invoke-AzsCertificateValidation Completed
Rozwiązanie: Postępuj zgodnie ze wskazówkami dotyczącymi narzędzia w sekcji Szczegóły w poszczególnych zestawach testów dla każdego certyfikatu.Resolution: Follow the tool's guidance in the details section under each set of tests for each certificate.
Objaw: sprawdzanie listy CRL protokołu HTTP kończy się niepowodzeniem, mimo że punkt CDP protokołu HTTP jest zapisany w rozszerzeniach x509.Symptom: HTTP CRL Checking fails despite having an HTTP CDP written to x509 extensions.
Przyczyna: obecnie AzsReadinessChecker nie może sprawdzić dostępności protokołu HTTP CDP w niektórych językach.Cause: Currently, AzsReadinessChecker can't check for HTTP CDP in some languages.
Rozwiązanie: Uruchom weryfikację z ustawionym językiem systemu operacyjnego na en-us.Resolution: Run validation with OS language set to EN-US.
CertyfikatyCertificates
KatalogDirectory | CertyfikatCertificate |
---|---|
ACSBlobACSBlob | wildcard_blob_<region>_<externalFQDN> |
ACSQueueACSQueue | wildcard_queue_<region>_<externalFQDN> |
ACSTableACSTable | wildcard_table_<region>_<externalFQDN> |
Host rozszerzenia administratoraAdmin Extension Host | wildcard_adminhosting_<region>_<externalFQDN> |
Portal administracyjnyAdmin Portal | adminportal_<region>_<externalFQDN> |
Administrator ARMARM Admin | adminmanagement_<region>_<externalFQDN> |
Z RAMIENIa PublicARM Public | management_<region>_<externalFQDN> |
KeyVaultKeyVault | wildcard_vault_<region>_<externalFQDN> |
KeyVaultInternalKeyVaultInternal | wildcard_adminvault_<region>_<externalFQDN> |
Publiczny Host rozszerzeńPublic Extension Host | wildcard_hosting_<region>_<externalFQDN> |
Portal publicznyPublic Portal | portal_<region>_<externalFQDN> |
Korzystanie z zweryfikowanych certyfikatówUsing validated certificates
Po sprawdzeniu poprawności certyfikatów przez AzsReadinessChecker można je używać w ramach wdrożenia centrum Azure Stack lub do rotacji kluczy tajnych centrum Azure Stack.Once your certificates are validated by the AzsReadinessChecker, you're ready to use them in your Azure Stack Hub deployment or for Azure Stack Hub secret rotation.
- W celu wdrożenia należy bezpiecznie przetransferować certyfikaty do inżyniera wdrożenia, aby mogli je skopiować na hosta wdrażania, jak określono w dokumentacji wymagań dotyczących infrastruktury PKI Azure Stack Hub.For deployment, securely transfer your certificates to your deployment engineer so that they can copy them onto the deployment host as specified in the Azure Stack Hub PKI requirements documentation.
- W przypadku rotacji kluczy tajnych można użyć certyfikatów do aktualizowania starych certyfikatów dla punktów końcowych infrastruktury publicznej środowiska centrum Azure Stack, postępując zgodnie z dokumentacją rotacji tajnego centrum Azure Stack.For secret rotation, you can use the certificates to update old certificates for your Azure Stack Hub environment's public infrastructure endpoints by following the Azure Stack Hub Secret Rotation documentation.
- W przypadku usług PaaS można użyć certyfikatów do zainstalowania dostawców zasobów SQL, MySQL i App Services w centrum Azure Stack, postępując zgodnie z omówieniem usług oferowanych w dokumentacji centrum Azure Stack.For PaaS services, you can use the certificates to install SQL, MySQL, and App Services Resource Providers in Azure Stack Hub by following the Overview of offering services in Azure Stack Hub documentation.
Następne krokiNext steps
Integracja tożsamości centrum danychDatacenter identity integration