Private/AzStackHci.Connectivity.Helpers.ps1
|
# //////////////////////////////////////////////////////////////////////////// # Strict Mode v1 (PS 5.1 safe) - surfaces reads of uninitialised variables at runtime. Set-StrictMode -Version 1.0 function Protect-ConnectivityDiagnosticText { param([AllowEmptyString()][string]$Text) $Text = $Text -replace '(?im)\b(Authorization|Proxy-Authorization|Cookie|Set-Cookie|X-[A-Za-z0-9_-]*(?:Token|Secret|Password|Api[-_]?Key)[A-Za-z0-9_-]*)\s*[:=]\s*[^\r\n]*', '$1: [REDACTED]' $Text = $Text -replace '(?i)("(?:access_token|id_token|refresh_token|token|sig|signature|secret|password|client_secret|api[_-]?key)"\s*:\s*)"(?:\\.|[^"\\])*"', '$1"[REDACTED]"' $Text = $Text -replace '(?i)([?&](?:access_token|id_token|refresh_token|token|sig|signature|secret|password|client_secret|code|api_key|apikey)=)[^&\s''"<>]*', '$1[REDACTED]' return ($Text -replace '(?i)(https?://)[^/\s@]+@', '$1[REDACTED]@') } function Add-ConnectivityDiagnosticMessage { param([string]$Level, [AllowEmptyString()][string]$Message) if ($null -eq $script:EndpointDiagnosticActive -or [string]::IsNullOrWhiteSpace($Message)) { return } $script:EndpointDiagnosticActive.Messages.Add([pscustomobject]@{ TimestampUtc = [DateTime]::UtcNow.ToString('o') Level = $Level Message = Protect-ConnectivityDiagnosticText -Text $Message }) } function ConvertTo-ConnectivityDiagnosticHeaders { param([object]$InputHeaders) $headers = [ordered]@{} if ($null -ne $InputHeaders) { $names = if ($InputHeaders -is [Collections.Specialized.NameValueCollection]) { $InputHeaders.AllKeys } else { $InputHeaders.Keys } foreach ($name in $names) { $values = if ($InputHeaders -is [Collections.Specialized.NameValueCollection]) { $InputHeaders.GetValues([string]$name) } else { $InputHeaders[$name] } $headers[$name] = [string[]]@( foreach ($value in $values) { if ($name -match '(?i)authorization|cookie|token|secret|password|api[-_]?key') { '[REDACTED]' } else { Protect-ConnectivityDiagnosticText -Text ([string]$value) } } ) } } return $headers } function Restore-ConnectivityDiagnosticArrays { param([object]$Diagnostics) if ($null -eq $Diagnostics) { return $null } $Diagnostics.Entries = @($Diagnostics.Entries) foreach ($entry in $Diagnostics.Entries) { $entry.Messages = @($entry.Messages) $entry.HttpAttempts = @($entry.HttpAttempts) foreach ($attempt in $entry.HttpAttempts) { $attempt.ResponseHeaders = ConvertTo-ConnectivityDiagnosticHeaders -InputHeaders $attempt.ResponseHeaders } if ($null -ne $entry.TCPDiagnostics.NameResolutionResults) { $entry.TCPDiagnostics.NameResolutionResults = [string[]]@($entry.TCPDiagnostics.NameResolutionResults) } if ($null -ne $entry.DNSDiagnostics.ResolverResults) { $entry.DNSDiagnostics.ResolverResults = @($entry.DNSDiagnostics.ResolverResults) foreach ($resolver in $entry.DNSDiagnostics.ResolverResults) { if ($null -ne $resolver.Addresses) { $resolver.Addresses = [string[]]@($resolver.Addresses) } if ($null -ne $resolver.PrivateAddresses) { $resolver.PrivateAddresses = [string[]]@($resolver.PrivateAddresses) } } } } return $Diagnostics } function Add-ConnectivityHttpAttempt { param([string]$Uri, [string]$Method, [double]$DurationSeconds, [object]$Response, [object]$RequestError) if ($null -eq $script:EndpointDiagnosticActive) { return } if ($RequestError -and $RequestError -isnot [Management.Automation.ErrorRecord] -and $RequestError.ErrorRecord) { $RequestError = $RequestError.ErrorRecord } $httpResponse = if ($RequestError) { $RequestError.Exception.Response } else { $Response } $headers = ConvertTo-ConnectivityDiagnosticHeaders -InputHeaders $httpResponse.Headers $body = $null $bodyStatus = 'Unavailable' $bodyTruncated = $false if ($Method -eq 'HEAD') { $bodyStatus = 'NotApplicable' } else { if ($RequestError -and $null -ne $RequestError.ErrorDetails.Message) { $body = $RequestError.ErrorDetails.Message } elseif (-not $RequestError -and $Response.Content -is [string]) { $body = $Response.Content } if ($null -ne $body) { $body = Protect-ConnectivityDiagnosticText -Text $body $bodyTruncated = $body.Length -gt 16384 if ($bodyTruncated) { $body = $body.Substring(0, 16384) } $bodyStatus = 'Captured' } } $errorDetail = if ($RequestError) { [pscustomobject]@{ ExceptionType = $RequestError.Exception.GetType().FullName Status = if ($null -ne $RequestError.Exception.Status) { [string]$RequestError.Exception.Status } else { $null } FullyQualifiedErrorId = $RequestError.FullyQualifiedErrorId Message = Protect-ConnectivityDiagnosticText -Text $RequestError.Exception.Message } } else { $null } $script:EndpointDiagnosticActive.HttpAttempts.Add([pscustomobject]@{ AttemptNumber = 0 TimestampUtc = [DateTime]::UtcNow.ToString('o') RequestUri = Protect-ConnectivityDiagnosticText -Text $Uri Method = $Method.ToUpperInvariant() DurationSeconds = [Math]::Round($DurationSeconds, 3) HttpStatusCode = if ($null -ne $httpResponse.StatusCode) { [int]$httpResponse.StatusCode } else { $null } HttpStatusDescription = if ($null -ne $httpResponse.StatusDescription) { Protect-ConnectivityDiagnosticText -Text $httpResponse.StatusDescription } else { $null } ResponseHeaders = $headers ResponseBodyText = $body ResponseBodyCaptureStatus = $bodyStatus ResponseBodyTruncated = $bodyTruncated Error = $errorDetail }) } function Get-ConnectivityDiagnosticKey { param([string]$Url, [int]$Port) $scheme = if ($Port -eq 80) { 'http' } else { 'https' } if ($Url -match '^(https?)://') { $scheme = $Matches[1].ToLowerInvariant() } $resource = ($Url -replace '^https?://', '') -split '#', 2 | Select-Object -First 1 $authority = ($resource -split '[/?]', 2)[0] $suffix = $resource.Substring($authority.Length) if ($suffix -eq '/') { $suffix = '' } if ($suffix.StartsWith('?')) { $suffix = "/$suffix" } return '{0}://{1}{2}|{3}' -f $scheme, ($authority -replace ':\d+$', '').ToLowerInvariant(), $suffix, $Port } function Invoke-ConnectivityDiagnosticCapture { [CmdletBinding()] param( [string]$Url, [int]$Port, [object]$Row, [Parameter(Mandatory)][scriptblock]$Action ) if ($null -eq $script:EndpointDiagnosticLog -or $null -ne $script:EndpointDiagnosticActive) { & $Action return } $savedVerbose = $script:VerbosePreference $savedDebug = $script:DebugPreference $emitVerbose = -not $script:SilentMode -and $savedVerbose -eq 'Continue' $emitDebug = -not $script:SilentMode -and $savedDebug -eq 'Continue' $entry = [pscustomobject]@{ Messages = [Collections.Generic.List[object]]::new(); HttpAttempts = [Collections.Generic.List[object]]::new(); EmitVerbose=$emitVerbose } $script:EndpointDiagnosticActive = $entry $script:VerbosePreference = 'Continue' $script:DebugPreference = 'Continue' $VerbosePreference = 'Continue' $DebugPreference = 'Continue' try { & $Action 4>&1 5>&1 | ForEach-Object { if ($_ -is [Management.Automation.VerboseRecord]) { Add-ConnectivityDiagnosticMessage -Level Verbose -Message $_.Message if ($emitVerbose) { $PSCmdlet.WriteVerbose($_.Message) } } elseif ($_ -is [Management.Automation.DebugRecord]) { Add-ConnectivityDiagnosticMessage -Level Debug -Message $_.Message if ($emitDebug) { $PSCmdlet.WriteDebug($_.Message) } } else { $_ } } } catch { Add-ConnectivityDiagnosticMessage -Level Error -Message $_.Exception.Message throw } finally { $script:VerbosePreference = $savedVerbose $script:DebugPreference = $savedDebug $script:EndpointDiagnosticActive = $null if ($null -ne $Row) { $Url = Get-ConnectivityRowResourceUrl -Row $Row; $Port = [int]$Row.Port } $key = Get-ConnectivityDiagnosticKey -Url $Url -Port $Port if (-not $script:EndpointDiagnosticLog.Contains($key)) { $script:EndpointDiagnosticLog[$key] = [pscustomobject]@{Messages=[Collections.Generic.List[object]]::new(); HttpAttempts=[Collections.Generic.List[object]]::new()} } foreach ($message in $entry.Messages) { $script:EndpointDiagnosticLog[$key].Messages.Add($message) } foreach ($attempt in $entry.HttpAttempts) { $attempt.AttemptNumber = $script:EndpointDiagnosticLog[$key].HttpAttempts.Count + 1 $script:EndpointDiagnosticLog[$key].HttpAttempts.Add($attempt) } } } # Function to test version of PowerShell # Returns $true on Windows PowerShell 5.1 and $false on PowerShell 6/7+. # Uses PSEdition ('Desktop' = Windows PowerShell, 'Core' = PowerShell 6/7+) rather than a # version-string comparison: it is the intent-revealing signal for "must be Windows PowerShell" # and avoids the magic 5.1.99999.999 upper-bound constant. Callers own the user-facing message # (this helper only returns a boolean; it never throws or writes an error). Function Test-PowerShellVersion5 { param ( [Parameter(Mandatory = $false)] [bool]$NoVerboseOutput = $false ) if (-not $NoVerboseOutput) { Write-Verbose "PowerShell version $($PSVersionTable.PSVersion.ToString()) ($($PSVersionTable.PSEdition) edition) detected." } # 'Desktop' is Windows PowerShell (5.1); 'Core' is PowerShell 6/7+. return ($PSVersionTable.PSEdition -eq 'Desktop') } # //////////////////////////////////////////////////////////////////////////// # Classify a single connectivity result row into a stable, machine-readable # category (v0.6.7). Lets integrators branch on $row.ResultCategory instead of # brittle free-text matching on $row.Note (e.g. the old config-gap heuristic # -match 'WAS NOT USED|REQUIRED TO SPECIFY'). # # Categories (mutually exclusive, evaluated in priority order): # ConfigGap - a required parameter placeholder (e.g. -KeyVaultURL) was left # unsubstituted, so the row carries the 'WAS NOT USED' / # 'REQUIRED TO SPECIFY' Note marker. This is a setup/input gap, # NOT a real network fault. # PrivateLink - the endpoint resolved to an RFC1918 private IP (Private Link). # SSLInspected - an untrusted certificate chain was seen (possible SSL inspection). # Skipped - the endpoint was never tested. Covers (a) Arc-Gateway skip rows and # skip-list rows (Layer7Status/TCPStatus literally 'Skipped'), and # (b) untested wildcard-parent placeholder rows whose Layer7Status is # still the initial EMPTY string because they never entered the # DNS/TCP/Layer7 test loop. (A genuinely tested row ALWAYS ends with a # non-empty Layer7Status - Success / Failed / N/A / 'Invalid port:' - # so an empty/whitespace value unambiguously means "not tested".) # Success - Layer7Status reported Success. # ConnectivityFailure - any other terminal state where a test ran and did not pass # (Failed, or N/A from a DNS-resolution failure, or 'Invalid port:'). # # Precedence rationale: the three "diagnostic" categories (ConfigGap, PrivateLink, # SSLInspected) describe WHY a row is special and are evaluated ahead of the generic # Success / ConnectivityFailure split, because such rows usually ALSO carry # Layer7Status='Failed' which would otherwise mask the real cause. # # NOTE on CRL/OCSP revocation-offline rows: these keep Layer7Status='Failed' + a # '- CRL/OCSP unreachable' Layer7Response marker and are DELIBERATELY left as # ConnectivityFailure here (NOT given their own category) to keep the ResultCategory # enum stable for consumers. The run-level signal for them is the CRLOfflineDetected / # CRLOfflineURLs container NoteProperties on the returned ArrayList (and JSON summary), # mirroring how SSL inspection is ALSO surfaced as a container array - integrators that # want to treat revocation-offline as a softer WARNING branch on those fields. Function Get-ConnectivityResultCategory { [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory = $true)] [psobject]$Row, # Run-level detection lists. Publish-Results passes a snapshot of the module-scope # state ($script:SSLInspectedURLs / $script:PrivateLinkDetectedArray); unit tests # pass synthetic lists. Default to empty so the helper is fully self-contained. [AllowNull()] [string[]]$SSLInspectedURLs = @(), [AllowNull()] [string[]]$PrivateLinkURLs = @() ) # Bare property reads are safe under StrictMode v1.0 (it throws only on uninitialised # VARIABLES, not absent object properties); cast to [string] to coalesce $null to ''. $note = [string]$Row.Note $url = [string]$Row.URL $l7 = [string]$Row.Layer7Status $tcp = [string]$Row.TCPStatus # URL normalisation for the detection-list lookups (steps 2 & 3). The two run-level arrays # store the URL in DIFFERENT shapes: # * $script:PrivateLinkDetectedArray stores the bare result-row .URL (host[/path]) - it is # populated by matching $_.URL in Test-AzureLocalConnectivity, so it already aligns. # * $script:SSLInspectedURLs stores the SCHEME-PREFIXED request URL ('https://host/path') # because Test-Layer7Connectivity adds the value it actually requested. # The result-row .URL is the bare host+path with no scheme, so a raw -contains against the # SSL list silently MISSES (an SSL-inspected row then falls through to ConnectivityFailure). # Strip a leading http(s):// and any trailing '/' from BOTH the row URL and every list entry # so the comparison is scheme- and trailing-slash-insensitive. (-contains is already # case-insensitive for strings.) $normalizeUrl = { param($u) (([string]$u) -replace '^\s*https?://', '').TrimEnd('/') } $urlNorm = & $normalizeUrl $url $sslNorm = @(@($SSLInspectedURLs) | ForEach-Object { & $normalizeUrl $_ }) $plNorm = @(@($PrivateLinkURLs) | ForEach-Object { & $normalizeUrl $_ }) # 1. Config gap — required parameter placeholder was never substituted. if ($note -match 'WAS NOT USED|REQUIRED TO SPECIFY') { return 'ConfigGap' } # 2. Private Link — endpoint resolved to an RFC1918 address. if ($plNorm -and ($plNorm -contains $urlNorm)) { return 'PrivateLink' } # 3. SSL inspection — untrusted certificate chain observed (possible TLS interception). # Two signals, set in lockstep by AzStackHci.Layer7.Helpers.ps1; either is authoritative: # (a) the bare row URL appears in the run-level $script:SSLInspectedURLs snapshot, OR # (b) the row's own Layer7Response carries the '- SSL Inspection detected' marker. # (b) is read straight off the row, so it survives any URL-shape drift between the snapshot # (which stores the scheme-prefixed REQUEST url, possibly a redirect target) and the row's # .URL field. A CRL/OCSP-offline row is reclassified away from this marker before this helper runs, so it # correctly does NOT match here and stays a ConnectivityFailure. $l7Response = [string]$Row.Layer7Response if (($sslNorm -and ($sslNorm -contains $urlNorm)) -or ($l7Response -match 'SSL Inspection detected')) { return 'SSLInspected' } # 4. Skipped / not-tested. Three cases: # (a) Arc-Gateway / skip-list rows -> TCPStatus or Layer7Status literally 'Skipped'. # (b) Untested wildcard-parent / placeholder rows that never entered the test loop # -> Layer7Status is still the initial EMPTY string. A tested row always has a # non-empty Layer7Status, so empty/whitespace here means "never tested", NOT a # failure. Guard with -not IsNullOrWhiteSpace($note) is unnecessary because the # ConfigGap Note marker is already handled at step 1 above. if (($tcp -like 'Skipped*') -or ($l7 -eq 'Skipped') -or [string]::IsNullOrWhiteSpace($l7)) { return 'Skipped' } # 5. Success. if ($l7 -eq 'Success') { return 'Success' } # 6. Everything else is a terminal connectivity failure (Failed / N/A / 'Invalid port:'). return 'ConnectivityFailure' } # //////////////////////////////////////////////////////////////////////////// # This function converts a hashtable to a string representation Function Convert-HashTableToString { param ( [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $HashTable ) begin { # Write-Verbose "Starting Convert-HashTableToString function" } process { $HashString = "@{" $Keys = $HashTable.keys foreach ($Key in $Keys) { $v = $HashTable[$key] if ($key -match "\s") { $HashString += "`"$key`"" + "=" + "`"$v`"" + ";" } else { $HashString += $key + "=" + "`"$v`"" + ";" } } $HashString += "}" } # End of process block end { # Write-Debug "Completed Convert-HashTableToString function" return $HashString } } # //////////////////////////////////////////////////////////////////////////// # Function to extract domains from URLs Function Get-DomainFromURL { param ( [string]$url ) begin { # Write-Verbose "Starting Get-DomainFromURL function" } process { # Isolate the authority before extracting the port; paths must not enter DNS validation. $url = $url -replace "^https?://", "" $url = ($url -split '[/?#]', 2)[0] # Check if the URL contains a port number # If the URL contains a port number, extract it if ($url -match ":(\d+)$") { $port = [int]($url -replace ".*:(\d+)$", '$1') $url = $url -replace ":(\d+)$", "" } else { $port = $null } $domain = $url return @{ Domain = $domain; Port = $port } } end { # Write-Debug "Completed Get-DomainFromURL function" } } # //////////////////////////////////////////////////////////////////////////// function New-ConnectivityDiscoveryIndex { param([AllowEmptyCollection()][object[]]$Rows) $index = [pscustomobject]@{ ByDomain = [Collections.Hashtable]::new([StringComparer]::InvariantCultureIgnoreCase) Entries = [Collections.Generic.List[object]]::new() } foreach ($row in $Rows) { Add-ConnectivityDiscoveryIndexEntry -Index $index -Row $row -Domain (Get-DomainFromURL -url $row.URL).Domain } return $index } function Add-ConnectivityDiscoveryIndexEntry { param([pscustomobject]$Index, $Row, [string]$Domain) $entry = [pscustomobject]@{ Domain = $Domain; Row = $Row } if (-not $Index.ByDomain.ContainsKey($Domain)) { $Index.ByDomain[$Domain] = [Collections.Generic.List[object]]::new() } $Index.ByDomain[$Domain].Add($entry) $Index.Entries.Add($entry) } function Find-ConnectivityDiscoveryRows { param([pscustomobject]$Index, [string]$Domain, $Port, [switch]$Wildcard) # Wildcard metadata updates retain original row order and PowerShell port coercion. if ($Wildcard -and [Management.Automation.WildcardPattern]::ContainsWildcardCharacters($Domain)) { foreach ($entry in $Index.Entries) { if ($entry.Domain -like $Domain -and $entry.Row.Port -eq $Port) { $entry.Row } } } elseif ($Index.ByDomain.ContainsKey($Domain)) { foreach ($entry in $Index.ByDomain[$Domain]) { if ($entry.Row.Port -eq $Port) { $entry.Row } } } } # //////////////////////////////////////////////////////////////////////////// # Helper function to normalize URL with protocol based on port # This is a private helper function for Test-Layer7Connectivity Function Initialize-WebRequestUrl { param ( [Parameter(Mandatory=$true)] [string]$url, [Parameter(Mandatory=$true)] [int]$port ) # Check if the port is 80 for HTTP or port 443, 8084 or 8443 for HTTPS and update the URL accordingly if ($port -eq $script:PORT_HTTPS -or $port -eq $script:PORT_HTTPS_ALT1 -or $port -eq $script:PORT_HTTPS_ALT2) { if($url -notmatch "^https://") { # If the URL does not start with https://, add it $url = "https://$url" } } elseif($port -eq $script:PORT_HTTP) { if($url -notmatch "^http://") { # If the URL does not start with http://, add it $url = "http://$url" } } else { # For custom ports, use http as the default if($url -notmatch "^http") { Write-Verbose "Custom port $port detected, using http as the default" $url = "http://$url" } } $requestUri = [uri]$url if ($requestUri.Port -ne $port) { $builder = [System.UriBuilder]::new($requestUri) $builder.Port = $port $url = $builder.Uri.AbsoluteUri } return $url } # //////////////////////////////////////////////////////////////////////////// # Helper function to register a redirected URL into the RedirectedResults array # Prevents duplicates by checking both RedirectedResults and Results arrays. # Called from the redirect-handling section of Test-Layer7Connectivity. function Get-ConnectivityResourceUrl { param ( [Parameter(Mandatory=$true)][string]$Url, [Parameter(Mandatory=$true)][int]$Port ) if ($Url -notmatch '^https?://') { $scheme = if ($Port -eq 80) { 'http' } else { 'https' } $Url = '{0}://{1}' -f $scheme, $Url } $builder = [System.UriBuilder]::new($Url) if ($builder.Scheme -notin @('http', 'https')) { throw 'Only HTTP and HTTPS resources are supported.' } $builder.Port = $Port $builder.Fragment = '' return $builder.Uri.AbsoluteUri } function Get-ConnectivityRowResourceUrl { param ([Parameter(Mandatory=$true)]$Row) $resource = [string]$Row.URL if ($Row.PSObject.Properties['redirect'] -and $Row.redirect) { $resource = [string]$Row.redirect } if ($resource.Contains('*')) { return '' } return Get-ConnectivityResourceUrl -Url $resource -Port $Row.Port } function Resolve-ConnectivityRedirectUrl { param ([Parameter(Mandatory=$true)][uri]$BaseUri, [Parameter(Mandatory=$true)][string]$Location) $target = [uri]::new($BaseUri, $Location) if ($target.Scheme -notin @('http', 'https')) { throw 'Only HTTP and HTTPS redirect targets are supported.' } return Get-ConnectivityResourceUrl -Url $target.AbsoluteUri -Port $target.Port } function Test-ConnectivityRedirectAdvisory { param ([Parameter(Mandatory=$true)]$Row) return ($Row.PSObject.Properties['RedirectDisposition'] -and $Row.RedirectDisposition -eq 'Advisory' -and $Row.PSObject.Properties['ResultCategory'] -and $Row.ResultCategory -eq 'ConnectivityFailure') } function Initialize-ConnectivityRedirectMetadata { param ([Parameter(Mandatory=$true)]$Row) $defaults = [ordered]@{ RedirectDisposition = 'NotRedirect' RedirectReason = '' RedirectOriginUrls = [string[]]@() RedirectTargetUrl = '' } foreach ($property in $defaults.Keys) { if (-not $Row.PSObject.Properties[$property]) { Add-Member -InputObject $Row -NotePropertyName $property -NotePropertyValue $defaults[$property] } } } function Merge-ConnectivityRedirectRow { param ([Parameter(Mandatory=$true)]$Row) $target = Get-ConnectivityRowResourceUrl -Row $Row $existing = $script:RedirectedResults | Where-Object { (Get-ConnectivityRowResourceUrl -Row $_) -ceq $target } | Select-Object -First 1 if ($existing) { foreach ($property in @('RedirectOriginUrls', 'RedirectParentUrls')) { if ($Row.PSObject.Properties[$property]) { $values = [string[]]@($Row.$property) if ($existing.PSObject.Properties[$property]) { $values += [string[]]@($existing.$property) } $unique = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) foreach ($value in $values) { [void]$unique.Add($value) } Add-Member -InputObject $existing -NotePropertyName $property -NotePropertyValue ([string[]]@($unique | Sort-Object -CaseSensitive)) -Force } } } else { [void]$script:RedirectedResults.Add($Row) } } function Update-ConnectivityRedirectDisposition { $inventory = @($script:Results | Where-Object { $_.Source -match '^(GitHub|Environment Checker)( Wildcard)?$' -or $_.Source -match '^(?!(?:Redirect for|Test for) ).+ SBE(?: Wildcard)?$' }) foreach ($result in $script:Results) { Initialize-ConnectivityRedirectMetadata -Row $result } foreach ($redirectRow in $script:RedirectedResults) { Initialize-ConnectivityRedirectMetadata -Row $redirectRow $target = [uri](Get-ConnectivityRowResourceUrl -Row $redirectRow) $redirectRow.RedirectTargetUrl = $target.AbsoluteUri $redirectRow.RedirectDisposition = 'Advisory' $redirectRow.RedirectReason = 'Destination requirement unverified; discovered while following redirects during connectivity testing. Review the ''RedirectOriginUrls'' column for source details.' $requiredTarget = @($inventory | Where-Object { $_.Port -eq $target.Port -and $target.Host -like (Get-DomainFromURL -url $_.URL).Domain }).Count -gt 0 if ($requiredTarget) { $redirectRow.RedirectDisposition = 'RequiredDependency' $redirectRow.RedirectReason = 'Destination matches an applicable inventory endpoint and port.' } } for ($pass = 0; $pass -le $script:RedirectedResults.Count; $pass++) { $changed = $false foreach ($redirectRow in $script:RedirectedResults) { if (-not $redirectRow.PSObject.Properties['RedirectParentUrls']) { continue } foreach ($parentUrl in $redirectRow.RedirectParentUrls) { $parent = [uri]$parentUrl foreach ($parentRow in @($script:RedirectedResults | Where-Object { $_.RedirectTargetUrl -ceq $parentUrl })) { foreach ($origin in $parentRow.RedirectOriginUrls) { if ($redirectRow.RedirectOriginUrls -cnotcontains $origin) { $redirectRow.RedirectOriginUrls = [string[]]@($redirectRow.RedirectOriginUrls + $origin) $changed = $true } } } $requiredParent = @($script:RedirectedResults | Where-Object { $_.RedirectTargetUrl -ceq $parentUrl -and $_.RedirectDisposition -eq 'RequiredDependency' }).Count -gt 0 $intentionalLink = ($parent.Host -eq 'aka.ms' -and $parent.AbsolutePath -ne '/') -or ($parent.Host -eq 'go.microsoft.com' -and $parent.AbsolutePath.TrimEnd('/') -eq '/fwlink' -and $parent.Query -match '(?i)[?&]linkid=\d+(?:&|$)') if ($intentionalLink) { $requiredParent = $requiredParent -or @($inventory | Where-Object { -not $_.IsWildcard -and (Get-ConnectivityRowResourceUrl -Row $_) -ceq $parentUrl }).Count -gt 0 } if ($requiredParent -and $redirectRow.RedirectDisposition -ne 'RequiredDependency') { $redirectRow.RedirectDisposition = 'RequiredDependency' $redirectRow.RedirectReason = 'Dependency of an applicable required redirect chain.' $changed = $true } } } if (-not $changed) { break } } } Function Add-RedirectedUrlToResults { param ( [Parameter(Mandatory=$true)] [string]$RedirectedURL, [Parameter(Mandatory=$true)] [string]$FullRedirectUrl, [Parameter(Mandatory=$true)] [int]$DestinationPort, [Parameter(Mandatory=$true)] [string]$OriginalURL, [Parameter(Mandatory=$true)] [int]$OriginalPort, [string]$ParentUrl ) Write-HostAzS "Redirected to '$FullRedirectUrl'" -ForegroundColor Yellow # Update the Note on the original result to show the redirect target (only if not already set) $ResultsToUpdate = $script:Results | Where-Object { $_.url -eq $OriginalURL -and ($_.Port -eq $OriginalPort) } ForEach ($ResultToUpdate in $ResultsToUpdate) { if (-not($ResultToUpdate.Note -like "Redirects to *")) { if ($ResultToUpdate.Note) { $ResultToUpdate.Note = "Redirects to '$($RedirectedURL)' - $($ResultToUpdate.Note)" } else { $ResultToUpdate.Note = "Redirects to '$($RedirectedURL)'" } } } if ([string]::IsNullOrWhiteSpace($RedirectedURL)) { Write-Warning "Redirected URL is null for $FullRedirectUrl, skipping" return } $originUrl = Get-ConnectivityResourceUrl -Url $OriginalURL -Port $OriginalPort if (-not $ParentUrl) { $ParentUrl = $originUrl } $targetUrl = Get-ConnectivityResourceUrl -Url $FullRedirectUrl -Port $DestinationPort $OriginalResult = @($script:Results) + @($script:RedirectedResults) | Where-Object { -not $_.IsWildcard -and (Get-ConnectivityRowResourceUrl -Row $_) -ceq $originUrl } | Select-Object -First 1 $originUrls = [string[]]@($originUrl) $originalSource = 'Connectivity probe' if ($OriginalResult) { $originalSource = $OriginalResult.Source if ($OriginalResult.PSObject.Properties['RedirectOriginUrls'] -and $OriginalResult.RedirectOriginUrls.Count) { $originUrls = [string[]]@($OriginalResult.RedirectOriginUrls) } } Merge-ConnectivityRedirectRow -Row ([PSCustomObject]@{ RowID = 0 MachineName = $env:COMPUTERNAME url = $RedirectedURL redirect = $targetUrl Port = $DestinationPort ArcGateway = $false IsWildcard = $false Source = "Redirect for $originalSource" Note = "Redirected URL from '$originUrl'; destination requirement evaluated separately." RedirectDisposition = 'Advisory' RedirectReason = 'Destination requirement unverified; discovered while following redirects during connectivity testing. Review the ''RedirectOriginUrls'' column for source details.' RedirectOriginUrls = $originUrls RedirectTargetUrl = $targetUrl RedirectParentUrls = [string[]]@($ParentUrl) TCPStatus = "" IPAddress = "" Layer7Status = "" Layer7Response = "" Layer7ResponseTime = "" CertificateSubject = "" CertificateIssuer = "" CertificateThumbprint = "" IntermediateCertificateIssuer = "" IntermediateCertificateSubject = "" IntermediateCertificateThumbprint = "" RootCertificateIssuer = "" RootCertificateSubject = "" RootCertificateThumbprint = "" }) Update-ConnectivityRedirectDisposition } # //////////////////////////////////////////////////////////////////////////// # Helper function to register a CRL / OCSP dependency URL as its own row in # $script:Results. Called when Get-Layer7CertificateDetails classifies an HTTPS # endpoint as "CRL/OCSP unreachable" (trusted chain, revocation offline). # # Dedupe strategy (two tiers): # - OCSP: skip if ANY existing row already covers the same host+port=80 # (the OCSP protocol uses a single host, so host match = full coverage) # - CRL: fall through to exact-URL match — different .crl files on the same # host can be blocked independently by path-based proxy filtering # When an identical URL was already added by a previous parent, the existing # row's Source is extended to list both parents. # # Rows are appended directly to $script:Results with Layer7Status = "" so the # existing remainingUrls loop in Test-AzureLocalConnectivity picks them up and # tests them as first-class endpoints. Function Add-CrlDependencyRowToResults { [CmdletBinding()] param ( [Parameter(Mandatory=$true)][ValidateSet('CRL','OCSP')][string]$Kind, [Parameter(Mandatory=$true)][string]$DependencyURL, [Parameter(Mandatory=$true)][string]$ParentURL ) if ([string]::IsNullOrWhiteSpace($DependencyURL)) { return } $parentDomain = (Get-DomainFromURL -url $ParentURL).Domain $depDomain = (Get-DomainFromURL -url $DependencyURL).Domain if ([string]::IsNullOrWhiteSpace($depDomain)) { Write-Debug "Add-CrlDependencyRowToResults: cannot parse domain from '$DependencyURL', skipping" return } # Tier 1 — dedupe against existing rows if ($Kind -eq 'OCSP') { # Host-level dedupe is sufficient for OCSP (single-host protocol) $existing = $script:Results | Where-Object { ((Get-DomainFromURL -url $_.URL).Domain -eq $depDomain) -and ($_.Port -eq $script:PORT_HTTP) } | Select-Object -First 1 if ($existing) { Write-Debug "Add-CrlDependencyRowToResults: OCSP host '$depDomain' already in Results (row URL '$($existing.URL)'), skipping duplicate" return } } else { # CRL — exact URL dedupe (different .crl paths on same host can be independently blocked) $existingSame = $script:Results | Where-Object { ($_.URL -eq $DependencyURL) -and ($_.Port -eq $script:PORT_HTTP) } | Select-Object -First 1 if ($existingSame) { # Same CRL URL already added — extend Source to reflect shared parent if ($existingSame.Source -notmatch [regex]::Escape($parentDomain)) { $existingSame.Source = "$($existingSame.Source); $parentDomain" } Write-Debug "Add-CrlDependencyRowToResults: CRL URL '$DependencyURL' already present — appended parent '$parentDomain' to Source" return } } # Tier 2 — append new row (Layer7Status="" so the remaining-URLs loop tests it) $sourcePrefix = if ($Kind -eq 'CRL') { 'CRL dependency for' } else { 'OCSP dependency for' } $script:Results.Add([PSCustomObject]@{ RowID = 0 MachineName = $env:COMPUTERNAME URL = $DependencyURL Port = $script:PORT_HTTP ArcGateway = $false IsWildcard = $false Source = "$sourcePrefix $parentDomain" Note = "Required for certificate revocation check of https://$parentDomain (HTTP port 80 must be reachable)" TCPStatus = "" IPAddress = "" Layer7Status = "" Layer7Response = "" Layer7ResponseTime = "" CertificateIssuer = "" CertificateSubject = "" CertificateThumbprint = "" IntermediateCertificateIssuer = "" IntermediateCertificateSubject = "" IntermediateCertificateThumbprint = "" RootCertificateIssuer = "" RootCertificateSubject = "" RootCertificateThumbprint = "" }) | Out-Null Write-Debug "Add-CrlDependencyRowToResults: appended $Kind dependency row '$DependencyURL' for parent '$parentDomain'" } # //////////////////////////////////////////////////////////////////////////// # Helper function to initialize ServerCertificateValidationCallback for SSL bypass # This is a private helper function for Test-Layer7Connectivity Function Initialize-CertificateCallback { # IMPORTANT: This sets a PROCESS-WIDE callback on ServicePointManager.ServerCertificateValidationCallback # that accepts all certificates. This is intentional — the module needs to connect to endpoints even when # SSL inspection replaces certificates, so it can detect and report SSL inspection to the user. # The callback is reset to $null in the end block of Test-Layer7Connectivity and Test-AzureLocalConnectivity. # Check if ServerCertificateValidationCallback class is already defined if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) { # Define the ServerCertificateValidationCallback class # This class is used to bypass SSL certificate validation, to allow for SSL inspection detection $CertCallback = @" using System; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; public class ServerCertificateValidationCallback { public static void Ignore() { if(ServicePointManager.ServerCertificateValidationCallback == null) { ServicePointManager.ServerCertificateValidationCallback += delegate ( Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors ) { return true; }; } } } "@ Add-Type $CertCallback } # Call the Ignore method to bypass SSL certificate validation. # PRECONDITION: the C# Ignore() only installs the accept-all delegate when # ServicePointManager.ServerCertificateValidationCallback is currently $null. If the # caller (or another loaded module) already set a callback, the bypass is NOT installed, # so SSL-inspection detection can be inconsistent in shared sessions. The caller # (Test-Layer7Connectivity / Test-AzureLocalConnectivity) captures and restores the # original callback in its finally block, so this never leaks across function calls. [ServerCertificateValidationCallback]::Ignore() } # //////////////////////////////////////////////////////////////////////////// # Helper to set all connectivity result fields on a URL object to skip/N/A values. # Used when a URL is skipped, wildcarded, or DNS resolution fails. Function Set-UrlObjectSkipFields { param( [Parameter(Mandatory)][PSCustomObject]$UrlObject, [Parameter(Mandatory)][string]$TCPStatus, [Parameter(Mandatory)][string]$Layer7Status, [string]$IPAddress = "N/A", [string]$Layer7Response = "N/A", [string]$Layer7ResponseTime = "N/A" ) $UrlObject.TCPStatus = $TCPStatus $UrlObject.IPAddress = $IPAddress $UrlObject.Layer7Status = $Layer7Status $UrlObject.Layer7Response = $Layer7Response $UrlObject.Layer7ResponseTime = $Layer7ResponseTime $UrlObject.CertificateIssuer = "N/A" $UrlObject.CertificateSubject = "N/A" $UrlObject.CertificateThumbprint = "N/A" $UrlObject.IntermediateCertificateIssuer = "N/A" $UrlObject.IntermediateCertificateSubject = "N/A" $UrlObject.IntermediateCertificateThumbprint = "N/A" $UrlObject.RootCertificateIssuer = "N/A" $UrlObject.RootCertificateSubject = "N/A" $UrlObject.RootCertificateThumbprint = "N/A" } # //////////////////////////////////////////////////////////////////////////// # Helper to copy connectivity test results from an Invoke-EndpointConnectivityTest # result hashtable to a URL result object. Function Copy-ConnectivityResultsToUrlObject { param( [Parameter(Mandatory)][PSCustomObject]$UrlObject, [Parameter(Mandatory)][hashtable]$TestResult ) $UrlObject.TCPStatus = $TestResult.TCPStatus foreach ($field in @('TCPDiagnostics', 'DNSDiagnostics', 'DNSFailureCode', 'DNSResolutionStatus')) { Add-Member -InputObject $UrlObject -NotePropertyName $field -NotePropertyValue $TestResult[$field] -Force } $UrlObject.IPAddress = $TestResult.IPAddress $UrlObject.Layer7Status = $TestResult.Layer7Status $UrlObject.Layer7Response = $TestResult.Layer7Response $UrlObject.Layer7ResponseTime = $TestResult.Layer7ResponseTime $UrlObject.CertificateIssuer = $TestResult.CertificateIssuer $UrlObject.CertificateSubject = $TestResult.CertificateSubject $UrlObject.CertificateThumbprint = $TestResult.CertificateThumbprint $UrlObject.IntermediateCertificateIssuer = $TestResult.CertificateIntermediateIssuer $UrlObject.IntermediateCertificateSubject = $TestResult.CertificateIntermediateSubject $UrlObject.IntermediateCertificateThumbprint = $TestResult.CertificateIntermediateThumbprint $UrlObject.RootCertificateIssuer = $TestResult.CertificateRootIssuer $UrlObject.RootCertificateSubject = $TestResult.CertificateRootSubject $UrlObject.RootCertificateThumbprint = $TestResult.CertificateRootThumbprint } # SIG # Begin signature block # MIInOgYJKoZIhvcNAQcCoIInKzCCJycCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDtQ0aQRy1VZQQj # eNvb9z6pb5pV5SBW5za86onoehOmnKCCDMkwggYEMIID7KADAgECAhMzAAACHPrN # xZvoL37EAAAAAAIcM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