← Back to list

REST API ile ILO & IDRAC TLS konfigürasyonu

Uzak yönetim araçları konfigürasyonunda bir değişiklik gerekiyorsa ve ortamda çok sayıda fiziksel sunucu mevcutsa Redfish REST API…

Hasan Göztok · 2026-02-22 13:53 · 0 claps · 1.7 min read
#idrac #ilo #redfish #rest-api #powershell
Open on Medium ↗

REST API ile ILO & IDRAC TLS konfigürasyonu

Uzak yönetim araçları konfigürasyonunda bir değişiklik gerekiyorsa ve ortamda çok sayıda fiziksel sunucu mevcutsa Redfish REST API aracılığıyla bu işlemler topluca gerçekleştirilebilir. Aşağıdaki örneklerde powershell aracılığıyla gönderilen isteklerle web servislerinde TLS sıkılaştırması sağlanmış olacaktır.

ILO 5–6

$iLOIPs = Get-Content <#list.txt#>
$Cred = Get-Credential
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
     $body = @{
              "DisableWeakCiphers" = $true                                                        
              } | ConvertTo-Json

        $apicred = @{
            "UserName"= $Cred.UserName
            "Password"=$Cred.GetNetworkCredential().Password
        } | ConvertTo-Json 

foreach ($ilo in $iLOIPs) {
Write-Host "Connecting: $ilo"

$Session = Invoke-WebRequest -Uri "https://$ilo/redfish/v1/Sessions" -Method Post -Body $apicred -ContentType "application/json" -UseBasicParsing -ErrorAction Stop 
$AuthHeaders = @{ "X-Auth-Token" = $Session.Headers.'X-Auth-Token' }

        if (((Invoke-WebRequest -Uri "https://$ilo/redfish/v1/Managers/1/SecurityService/" -UseBasicParsing -Method Get -Headers $AuthHeaders).Content | ConvertFrom-Json | Select-Object -ExpandProperty DisableWeakCiphers) -eq "True") {
        Write-Host "Weak ciphers already disabled" -ForegroundColor Green
            } 

        else {
        $Result = Invoke-WebRequest -Uri "https://$ilo/redfish/v1/Managers/1/SecurityService/" -UseBasicParsing -Method Patch -Body $body -Headers $AuthHeaders -ContentType "application/json" -ErrorAction Stop
        Write-Host ($Result.Content | ConvertFrom-Json).error.'@Message.ExtendedInfo'[0].MessageId
        Write-Host "Disabling" -ForegroundColor Yellow
             }         
        Start-Sleep -Seconds 3

        }

iDRAC 9–10

$iDRACIPs = Get-Content <#list.txt#>
$Cred = Get-Credential
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
        $body = @{
            "Attributes" = @{
                            "WebServer.1.TLSProtocol" = "TLS 1.2 and Higher" #or "TLS 1.3 Only"
                            } 
                  } | ConvertTo-Json

        $ApiCred = @{
            "UserName"= $Cred.UserName
            "Password"=$Cred.GetNetworkCredential().Password
        } | ConvertTo-Json

foreach ($iDRAC in $iDRACIPs) {
Write-Host "Connecting: $iDRAC"

<#IDRAC9#> $Session = Invoke-WebRequest -Uri "https://$iDRAC/redfish/v1/Sessions" -Method Post -Body $ApiCred -ContentType "application/json" -UseBasicParsing -ErrorAction Stop 

<#IDRAC10#> # $Session = Invoke-WebRequest -Uri "https://$iDRAC/redfish/v1/SessionService/Sessions" -Method Post -Body $ApiCred -ContentType "application/json" -UseBasicParsing -ErrorAction Stop  
        $AuthHeaders = @{ "X-Auth-Token" = $Session.Headers.'X-Auth-Token' }

        Invoke-WebRequest -Uri "https://$idrac/redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellAttributes/iDRAC.Embedded.1/" -Method Patch -Body $body -Headers $AuthHeaders -ContentType "application/json" -UseBasicParsing  | Select-Object -ExpandProperty StatusDescription

        Start-Sleep -Seconds 3

        #kill rest api session
        $location =  $Session.Headers.Location
        Invoke-WebRequest -Uri "https://$iDRAC$location" -Method Delete -Headers $AuthHeaders -UseBasicParsing -ErrorAction SilentlyContinue
        }

iLO tarafında ilgili ayar sonrası otomatik olarak ilo reset gerçekleşeceğinden session kendiliğinden kill edilecektir ve web arayüzüne 20–30 saniye aralığında erişilemeyecektir. iDRAC web arayüzüne de kısa süreli erişim kesilecek ancak iLO’nun aksine reset gerçekleşmeyeceğinden sessionlar kill edilmezse art arda yapılan denemelerde “RAC0218: The maximum number of user sessions is reached" hatası alınabilir. iDRAC’e SSH ile bağlanarak hatayı gidermek için:

racadm> getssninfo
racadm> closessn -i <SSNID>

메타데이터
post_id
d29b4b26b6e8
slug
rest-api-ile-ilo-idrac-tls-konfigürasyonu-d29b4b26b6e8
url
https://medium.com/@hasangoztok/rest-api-ile-ilo-idrac-tls-konfig%C3%BCrasyonu-d29b4b26b6e8
canonical_url
https://medium.com/@hasangoztok/rest-api-ile-ilo-idrac-tls-konfig%C3%BCrasyonu-d29b4b26b6e8
author_url
https://medium.com/@hasangoztok
status
ok
fetched_at
2026-06-11 15:16:29