Exchange Server TLS Yapılandırılması

Exchange Server için TLS (Transport Layer Security) yapılandırmasını nasıl yapabileceğinizi anlatacağım. Ayrıca, bu işlemi kolaylaştırmak için oluşturduğum bir PowerShell betiği üzerinden de detayları paylaşacağım.

Exchange Server TLS Yapılandırma Hakkında

Exchange Server, güvenli veri iletişimini sağlamak için TLS protokollerini kullanır. Ancak, Exchange Server 2019 henüz TLS 1.3’ü desteklememektedir. Bu nedenle, bu yazıda TLS 1.2’nin etkinleştirilmesine ve eski sürümlerin devre dışı bırakılmasına odaklanacağız.

TLS 1.2, güvenlik açıklarını azaltır ve veri bütünlüğünü sağlamak için daha güçlü şifreleme yöntemleri sunmaktadır. Exchange Server 2019’da TLS 1.2’nin etkinleştirilmesi, sistem güvenliğinizi artırırken, uyumluluk ve veri koruması sağlamaktadır.

Exchange Server TLS Yapılandırma Scripti

Script, bilgisayarda TLS 1.2’nin etkinleştirilmesi ve diğer eski TLS sürümlerinin devre dışı bırakılmasını otomatize etmektedir. TLS 1.3 için destek olmadığını unutmayın, bu yüzden betikte bu seçenek mevcut değildir.

  1. Display-Menu Fonksiyonu: Menüyü ekrana yazdırır ve kullanıcıya 3 seçenek sunar.
  2. Enable-TLS12 Fonksiyonu: TLS 1.2’yi etkinleştirir.
  3. Disable-OtherTLSVersions Fonksiyonu: Diğer eski TLS sürümlerini devre dışı bırakır.
  4. Ana Döngü: Kullanıcının bir seçenek seçmesini ve betiğin bu seçeneğe göre hareket etmesini sağlar.
<#
=============================================================================================
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")
    }
}

Benzer Yazilar – Exchange Server TLS Yapılandırılması

“Exchange Server TLS Yapılandırılması” üzerine 2 yorum

Yorum yapın