Skip to content

Commit aa16442

Browse files
Fixed trailing slash in powershell scripts. Removed old doc example that was from M1. Updated ApplianceConfigBasePath folders for consistency
1 parent 8b3d642 commit aa16442

File tree

3 files changed

+10
-135
lines changed

3 files changed

+10
-135
lines changed

azure-local/manage/disconnected-operations-deploy.md

Lines changed: 6 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ To prepare the first machine for the disconnected operations appliance, follow t
177177
Here's an example:
178178
179179
```powershell
180-
$applianceConfigBasePath = 'D:\AzureLocalDisconnectedOperations\'
180+
$applianceConfigBasePath = 'C:\AzureLocalDisconnectedOperations'
181181
```
182182
183183
1. Copy the disconnected operations installation files (appliance and manifest) to the first machine. Save these files into the base folder you created earlier.
@@ -222,7 +222,7 @@ To prepare the first machine for the disconnected operations appliance, follow t
222222
Copy-Item \\fileserver\share\azurelocalcerts $certspath -recurse
223223
```
224224
225-
1. Verify the certificates, public key, and management endpoint. You should have two folders: `ManagementEndpointCerts` and `IngressEndpointCerts` and at least 24 certificates.
225+
1. Verify the certificates, public key, and management endpoint. You should have two folders: `ManagementEndpointCerts` and `IngressEndpointsCerts` and at least 24 certificates.
226226
227227
```powershell
228228
Get-ChildItem $certsPath
@@ -240,7 +240,7 @@ To prepare the first machine for the disconnected operations appliance, follow t
240240
```powershell
241241
Import-Module "$applianceConfigBasePath\OperationsModule\Azure.Local.DisconnectedOperations.psd1" -Force
242242
$mgmntCertFolderPath = "$certspath\ManagementEndpointCerts"
243-
$ingressCertFolderPath = "$certspath\IngressEndpointCerts"
243+
$ingressCertFolderPath = "$certspath\IngressEndpointsCerts"
244244
```
245245
246246
## Initialize the parameters
@@ -323,138 +323,13 @@ Populate the required parameters based on your deployment planning. Modify the e
323323
324324
For more information, see [PKI for disconnected operations](disconnected-operations-pki.md).
325325
326-
1. Generate the appliance manifest file:
326+
1. Copy the appliance manifest file (Downloaded from Azure) to your configuration folder:
327327
328328
```powershell
329-
$stampId = (New-Guid).Guid
330-
$resourcename = "appliance1"
331-
$resourcegroupname= "rg"
332-
$subscriptionId= "subscriptionid"
333-
334-
$applianceManifest = @{
335-
resourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Edge/azurelocaldisconnected/$resourceName"
336-
resourceName = $resourceName
337-
stampId = $stampId
338-
location = "eastus"
339-
billingModel = "model"
340-
connectionIntent = "Disconnected"
341-
}
342-
$applianceManifestJsonPath = "$applianceConfigBasePath\AzureLocal.DisconnectedOperations.Appliance.manifest.json"
343-
$applianceManifest | ConvertTo-JSON | Out-File $ApplianceManifestJsonPath | Out-Null
329+
# Please modify your source path accordingly
330+
copy-item AzureLocal.DisconnectedOperations.Manifest.json $applianceConfigBasePath\AzureLocal.DisconnectedOperations.Appliance.manifest.json
344331
```
345332
346-
## Validate the management endpoint certificates
347-
348-
Before you install the appliance, validate the management endpoint certificates. Ensure that the certificate has a validated certificate chain, isn't expired, has the correct subject, the appropriate enhanced key usage (EKUs), and the supported cryptography.
349-
350-
Run the following script:
351-
352-
```powershell
353-
function Test-SSLCertificateSAN {
354-
[CmdletBinding()]
355-
param(
356-
[Parameter(Mandatory = $true)]
357-
[string]$HostName,
358-
359-
[Parameter(Mandatory = $true)]
360-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
361-
)
362-
363-
$sanExtension = $SslCertificate.Extensions | Where-Object { $_.Oid.FriendlyName -ieq "Subject Alternative Name" }
364-
365-
if (-not $sanExtension) {
366-
throw "Subject Alternative Name is not specified in the certificate. Correct the certifcate and try again."
367-
}
368-
369-
$sanExtensionContent = $sanExtension.Format(0)
370-
$sanList = $sanExtensionContent.Split(",") | ForEach-Object { $_.Trim() }
371-
372-
if ($sanList -inotcontains "DNS Name=$HostName") {
373-
throw "Subject Alternative Name does not contain the hostname $HostName. It only has Subject Alternative Name: $sanExtensionContent. Correct the certificate and try again."
374-
}
375-
}
376-
377-
function Test-SSLCertificateChain {
378-
[CmdletBinding()]
379-
param(
380-
[Parameter(Mandatory = $true)]
381-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
382-
)
383-
384-
$chain = New-Object System.Security.Cryptography.X509Certificates.X509Chain
385-
$chain.ChainPolicy.RevocationMode = [System.Security.Cryptography.X509Certificates.X509RevocationMode]::NoCheck
386-
$chain.ChainPolicy.VerificationFlags = [System.Security.Cryptography.X509Certificates.X509VerificationFlags]::NoFlag
387-
388-
$chain.Build($SslCertificate) | Out-Null
389-
390-
if ($chain.ChainStatus.Count -ne 0) {
391-
throw "Certificate chain validation failed with error message: `r`n$(($chain.ChainStatus).StatusInformation -Join "`r`n"). Correct the certificate chain and try again."
392-
}
393-
}
394-
395-
function Test-SslCertificateEnhancedKeyUsage {
396-
[CmdletBinding()]
397-
param(
398-
[Parameter(Mandatory = $true)]
399-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
400-
)
401-
402-
$extensions = $SslCertificate.Extensions | Where-Object { $_ -is [System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension] }
403-
$serverAuthenticationValue = "1.3.6.1.5.5.7.3.1"
404-
$serverAuth = $extensions.EnhancedKeyUsages | Where-Object { $_.Value -ieq $serverAuthenticationValue }
405-
406-
if (-not $serverAuth) {
407-
throw "Certificate does not have Server Authentication Enhanced Key Usage. Correct the certificate and try again."
408-
}
409-
}
410-
411-
function Test-SslCertificateCrypto {
412-
[CmdletBinding()]
413-
param(
414-
[Parameter(Mandatory = $true)]
415-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
416-
)
417-
418-
if ($SslCertificate.PublicKey.Oid.FriendlyName -eq "RSA") {
419-
if ($SslCertificate.PublicKey.Key.KeySize -lt 2048) {
420-
throw "Weak RSA Key: Upgrade to at least 2048-bit"
421-
} else {
422-
Write-Verbose "RSA Key is secure ($($SslCertificate.PublicKey.Key.KeySize) bits)"
423-
}
424-
}
425-
426-
if ($SslCertificate.PublicKey.Oid.FriendlyName -match "ECDSA") {
427-
$validCurves = @("ECDSA_P256", "ECDSA_P384", "ECDSA_P521")
428-
if ($validCurves -contains $SslCertificate.PublicKey.Oid.FriendlyName) {
429-
Write-Verbose "ECDSA with $($SslCertificate.PublicKey.Oid.FriendlyName) curve is secure"
430-
} else {
431-
throw "Weak ECDSA Curve: Use P-256, P-384, or P-521"
432-
}
433-
}
434-
435-
if ($SslCertificate.SignatureAlgorithm.FriendlyName -match "sha1") {
436-
throw "Weak Signature Algorithm: Upgrade to SHA-256 or higher"
437-
}
438-
}
439-
440-
# Test SSL Certificate for Management cert
441-
$HostName = $ManagementNetworkConfiguration.ManagementIpAddress
442-
$SslCertificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new(`
443-
$ManagementNetworkConfiguration.TlsCertificatePath,
444-
$ManagementNetworkConfiguration.TlsCertificatePassword)
445-
446-
$currentDate = Get-Date
447-
if ($currentDate -lt $SslCertificate.NotBefore) {
448-
throw "Certificate is not yet valid (future start date). Correct the certificate and try again."
449-
} elseif ($currentDate -gt $SslCertificate.NotAfter) {
450-
throw "Certificate has expired. Correct the certificate and try again."
451-
}
452-
453-
Test-SSLCertificateSAN -HostName $HostName -SslCertificate $SslCertificate | Out-Null
454-
Test-SSLCertificateChain -SslCertificate $SslCertificate | Out-Null
455-
Test-SslCertificateEnhancedKeyUsage -SslCertificate $SslCertificate | Out-Null
456-
Test-SslCertificateCrypto -SslCertificate $SslCertificate | Out-Null
457-
```
458333
459334
## Install and configure the appliance
460335

azure-local/manage/disconnected-operations-pki.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ On the host machine or Active Directory virtual machine (VM), follow the steps i
8585
You need these certificates to deploy the disconnected operations appliance. You also need the public key for your local infrastructure to provide a secure trust chain.
8686

8787
> [!NOTE]
88-
> **IngressEndpointCerts** is the folder where you store all 24 certificate files. **IngressEndpointPassword** is a secure string with the certificate password.
88+
> **IngressEndpointsCerts** is the folder where you store all 24 certificate files. **IngressEndpointPassword** is a secure string with the certificate password.
8989
9090
1. Connect to the CA.
9191
1. Create a folder named **IngressEndpointsCerts**. Use this folder to store all certificates.
92-
1. Create the 24 certs in the table above and export them into the IngressEndpointCerts folder.
92+
1. Create the 24 certs in the table above and export them into the IngressEndpointsCerts folder.
9393

9494
Here's an example script you can modify and run. It creates ingress certificates and exports them to the configured folder by creating CSRs and issuing them to your CA.
9595

@@ -206,7 +206,7 @@ $AzLCerts = @(
206206
}
207207
```
208208

209-
- Copy the original certificates (24 .pfx files / *.pfx) obtained from your CA to the directory structure represented in IngressEndpointCerts.
209+
- Copy the original certificates (24 .pfx files / *.pfx) obtained from your CA to the directory structure represented in IngressEndpointsCerts.
210210

211211
### Management endpoint
212212

azure-local/manage/disconnected-operations-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ To back up Host Guardian Service certificates from your cluster, run these comma
9898
1. To export the Host Guardian Service certificates to a specific path, run `Export-ApplianceHGSCertificates`.
9999
100100
```powershell
101-
Export-ApplianceHGSCertificates -Path D:\AzureLocal\HGSBackup
101+
Export-ApplianceHGSCertificates -Path C:\AzureLocalDisconnectedOperations\HGSBackup
102102
```
103103
104104
## Configure syslog forwarding

0 commit comments

Comments
 (0)