RDP Altijd Vragen Om Wachtwoord

πŸ’Ό Management Samenvatting

Remote Desktop moet altijd om wachtwoord vragen bij verbinding maken om te voorkomen dat credentials opgeslagen worden in RDP client configuraties, wat Diefstal van inloggegevens risico's vermindert.

Aanbeveling
IMPLEMENT
Risico zonder
Medium
Risk Score
5/10
Implementatie
2u (tech: 1u)
Van toepassing op:
βœ“ Windows server
βœ“ RDP servers

RDP credential opslag RISICO: RDP clients kunnen credentials opslaan in .rdp configuratie bestanden voor convenience ("Remember my credentials"). SECURITY RISKS: credentials opgeslagen in .rdp files (weak versleuteling), Disk forensics kunnen credentials recoveren, Malware kan saved RDP credentials stelen, Shared .rdp files is credential leakage. fPromptForPassword is 1 FORCEERT: Altijd password prompt bij RDP verbinding, Voorkomt credential opslag in client, User moet elke keer authenticeren (tedious maar secure). BALANCE: Users willen convenience (save credentials), Security vereist fresh authentication, Modern alternative: gebruiken Azure Bastion (no RDP credentials needed), Windows Admin Center (web-based).

PowerShell Modules Vereist
Primary API: Intune / groep beleid
Connection: Registry
Required Modules:

Implementatie

Schakel in password prompt: HKLM:\SOFTWARE\beleidsregels\Microsoft\Windows NT\Terminal Services\fPromptForPassword is 1. EFFECT: RDP server altijd vraagt om password (client kan niet gebruiken saved credentials), past toe to alle RDP connections to Deze server.

Vereisten

  1. Windows server (RDP target machines)
  2. Note: Dit is server-SIDE beleid (not client)
  3. User communication: kan niet save RDP passwords

Implementatie

Gebruik PowerShell-script always-prompt-for-password-upon-connection-is-set-to-enabled.ps1 (functie Invoke-Remediation) – Schakel in RDP password prompt.

GPO: Computer Configuration β†’ Administrative Templates β†’ Windows Components β†’ Remote Desktop Services β†’ Remote Desktop sessie Host β†’ Security β†’ 'Always prompt voor password upon connection' is ingeschakeld

monitoring

Gebruik PowerShell-script always-prompt-for-password-upon-connection-is-set-to-enabled.ps1 (functie Invoke-Monitoring) – Verifieer fPromptForPassword is 1.

Compliance en Auditing

  1. CIS Windows server Benchmark
  2. BIO 09.04 - Authentication
  3. ISO 27001 A.9.4.2

Remediatie

Gebruik PowerShell-script always-prompt-for-password-upon-connection-is-set-to-enabled.ps1 (functie Invoke-Remediation) – Herstellen.

Compliance & Frameworks

Automation

Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).

PowerShell
<# .SYNOPSIS Intune Security Options: RDP Always Prompt Password .DESCRIPTION CIS - RDP moet altijd password promten. .NOTES Filename: rdp-prompt-password.ps1|Author: Nederlandse Baseline voor Veilige Cloud|Registry: HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fPromptForPassword|Expected: 1 #> #Requires -Version 5.1 #Requires -RunAsAdministrator [CmdletBinding()]param([switch]$WhatIf, [switch]$Monitoring, [switch]$Remediation, [switch]$Revert) $ErrorActionPreference = 'Stop'; $RegPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"; $RegName = "fPromptForPassword"; $ExpectedValue = 1 function Connect-RequiredServices { $p = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()); return $p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } function Test-Compliance { $r = [PSCustomObject]@{ScriptName = "rdp-prompt.ps1"; PolicyName = "RDP Password Prompt"; IsCompliant = $false; CurrentValue = $null; ExpectedValue = "Enabled"; Details = @() }; function Invoke-Revert { Remove-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue } try { if (Test-Path $RegPath) { $v = Get-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue; if ($v -and $v.$RegName -eq $ExpectedValue) { $r.IsCompliant = $true; $r.Details += "Password prompt enabled" }else { $r.Details += "Password prompt: $($v.$RegName)" } }else { $r.Details += "Niet geconfigureerd" } }catch { $r.Details += "Error: $($_.Exception.Message)" }; return $r } function Invoke-Remediation { if (-not(Test-Path $RegPath)) { New-Item -Path $RegPath -Force | Out-Null }; Set-ItemProperty -Path $RegPath -Name $RegName -Value $ExpectedValue -Type DWord -Force; Write-Host "RDP always prompt password enabled" -ForegroundColor Green } function Invoke-Monitoring { $r = Test-Compliance; Write-Host "`n$($r.PolicyName): $(if($r.IsCompliant){'COMPLIANT'}else{'NON-COMPLIANT'})" -ForegroundColor $(if ($r.IsCompliant) { 'Green' }else { 'Red' }); return $r } function Invoke-Revert { Remove-ItemProperty -Path $RegPath -Name $RegName -ErrorAction SilentlyContinue } try { if (-not(Connect-RequiredServices)) { exit 1 }; if ($Monitoring) { $r = Invoke-Monitoring; exit $(if ($r.IsCompliant) { 0 }else { 1 }) }elseif ($Remediation) { if (-not $WhatIf) { Invoke-Remediation } }elseif ($Revert) { Invoke-Revert }else { $r = Test-Compliance; exit $(if ($r.IsCompliant) { 0 }else { 1 }) } }catch { Write-Error $_; exit 1 }

Risico zonder implementatie

Risico zonder implementatie
Medium: Medium risico via saved RDP credentials. Users kunnen credentials opslaan in .rdp files wat Diefstal van inloggegevens faciliteert.

Management Samenvatting

Forceer RDP password prompt (fPromptForPassword=1). Voorkomt credential opslag. Better: gebruiken Azure Bastion (eliminates RDP entirely). Implementatie: 1-2 uur.