Configuration TLS du serveur Exchange

Exchange Server pour TLS (Sécurité de la couche de transport) Je vais vous expliquer comment vous pouvez le configurer. Il existe également un outil que j'ai créé pour faciliter ce processus. PowerShell Je partagerai les détails à travers le script.

À propos de la configuration TLS du serveur Exchange

Exchange ServerPour assurer une communication sécurisée des données TLS utilise des protocoles. Cependant, Exchange Server 2019 ne prend pas encore en charge TLS 1.3. Par conséquent, dans cet article, nous nous concentrerons sur l’activation de TLS 1.2 et la désactivation des anciennes versions.

TLS 1.2 réduit les vulnérabilités de sécurité et propose des méthodes de cryptage plus puissantes pour garantir l'intégrité des données. L'activation de TLS 2019 dans Exchange Server 1.2 assure la conformité et la protection des données tout en augmentant la sécurité de votre système.

Script de configuration TLS du serveur Exchange

Le script automatise l'activation de TLS 1.2 et la désactivation d'autres anciennes versions de TLS sur l'ordinateur. Notez qu'il n'y a pas de support pour TLS 1.3, cette option n'est donc pas disponible dans le script.

  1. Fonction du menu d'affichage : Il imprime le menu à l'écran et propose à l'utilisateur 3 options.
  2. Fonction Activer-TLS12 : Active TLS 1.2.
  3. Fonction Désactiver-AutresVersionsTLS : Désactive les autres anciennes versions de TLS.
  4. Boucle principale : Il permet à l'utilisateur de sélectionner une option et au script d'agir sur cette option.
<#
=============================================================================================
Name = Cengiz YILMAZ
Microsoft Certified Trainer (MCT) - Microsoft MVP
Date = 18.08.2022
www.cengizyilmaz.net
365gurusu.com
www.cozumpark.com/author/cengizyilmaz
============================================================================================
#>
Function Display-Menu {
    param (
        [string]$Title = 'TLS Configuration Menu'
    )
    Clear-Host
    Write-Host "=============== $Title ================" -ForegroundColor Cyan
    Write-Host '1: Enable TLS 1.2' -ForegroundColor Green
    Write-Host '2: Disable Other TLS Versions' -ForegroundColor Yellow
    Write-Host '3: Exit' -ForegroundColor Red
}

Function Enable-TLS12 {
    $RegPath = 'HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server'
    $Net45Path = 'HKLM:SOFTWAREMicrosoft.NETFrameworkv4.0.30319'
    $Net45Path_WOW64 = 'HKLM:SOFTWAREWOW6432NodeMicrosoft.NETFrameworkv4.0.30319'
    $Net35Path_WOW64 = 'HKLM:SOFTWAREWOW6432NodeMicrosoft.NETFrameworkv2.0.50727'
    $Net35Path = 'HKLM:SOFTWAREMicrosoft.NETFrameworkv2.0.50727'
    $StrongCrypto = 'SchUseStrongCrypto'
    $DefaultTlsVersion = 'SystemDefaultTlsVersions'

    # Enable strong crypto on .NET Framework 4.5
    Set-ItemProperty -Path $Net45Path -Name $StrongCrypto -Value '1'
    Set-ItemProperty -Path $Net45Path_WOW64 -Name $StrongCrypto -Value '1'

    # Enable strong crypto on .NET Framework 3.5
    Set-ItemProperty -Path $Net35Path_WOW64 -Name $StrongCrypto -Value '1'
    Set-ItemProperty -Path $Net35Path -Name $StrongCrypto -Value '1'
    
    # Set system default TLS versions for both 4.5 and 3.5
    Set-ItemProperty -Path $RegPath -Name $DefaultTlsVersion -Value '1'
    
    # Enable TLS 1.2
    New-ItemProperty -Path $RegPath -Name 'Enabled' -Value '1' -PropertyType 'DWord' -Force
    Write-Host "TLS 1.2 Enabled" -ForegroundColor Green
}

Function Disable-OtherTLSVersions {
    $TLS10Server = 'HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server'
    $TLS11Server = 'HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server'

    # Disable TLS 1.0
    New-ItemProperty -Path $TLS10Server -Name 'Enabled' -Value '0' -PropertyType 'DWord' -Force

    # Disable TLS 1.1
    New-ItemProperty -Path $TLS11Server -Name 'Enabled' -Value '0' -PropertyType 'DWord' -Force
    
    Write-Host "Other TLS versions have been disabled" -ForegroundColor Yellow
}

$exitLoop = $false

while ($exitLoop -eq $false) {
    Display-Menu
    $choice = Read-Host "Please make a selection"
    
    switch ($choice) {
        '1' {
            Enable-TLS12
        }
        '2' {
            Disable-OtherTLSVersions
        }
        '3' {
            Write-Host "Exiting..." -ForegroundColor Red
            $exitLoop = $true
            break
        }
    }
    
    if ($exitLoop -eq $false) {
        Write-Host 'Press any key to continue ...' -ForegroundColor Magenta
        $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
    }
}

Articles similaires – Configuration TLS du serveur Exchange

2 commentaires sur « Configuration TLS du serveur Exchange »

Commenter