The reconstructed evaluation script behind this rule's OVAL check(s) — every module a compound check combines, with this rule's own concrete values and DISA's SCC tool's real per-module mechanism curated from static teardown of SCC releases.
# Windows PowerShell
# Reconstructed from oval:mil.disa.stig.firefox.windows:def:116
# Firefox must be configured to not delete data upon shutdown.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cache is set to 0 reg_dword
# registry_object (registry_test)
function test_1 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('Cache').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'Cache' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'Cache') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cookies is set to 0 reg_dword
# registry_object (registry_test)
function test_2 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('Cookies').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'Cookies' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'Cookies') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Downloads is set to 0 reg_dword
# registry_object (registry_test)
function test_3 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('Downloads').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'Downloads' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'Downloads') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\FormData is set to 0 reg_dword
# registry_object (registry_test)
function test_4 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('FormData').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'FormData' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'FormData') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\History is set to 0 reg_dword
# registry_object (registry_test)
function test_5 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('History').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'History' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'History') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Sessions is set to 0 reg_dword
# registry_object (registry_test)
function test_6 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('Sessions').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'Sessions' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'Sessions') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\SiteSettings is set to 0 reg_dword
# registry_object (registry_test)
function test_7 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('SiteSettings').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'SiteSettings' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'SiteSettings') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\OfflineApps is set to 0 reg_dword
# registry_object (registry_test)
function test_8 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('OfflineApps').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'OfflineApps' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'OfflineApps') -eq 0))
}
# Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Locked is set to 1 reg_dword
# registry_object (registry_test)
function test_9 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown').GetValueKind('Locked').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown' -Name 'Locked' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'Locked') -eq 1))
}
if ((test_1 -and test_2 -and test_3 -and test_4 -and test_5 -and test_6 -and test_7 -and test_8 -and test_9)) {
Write-Output "PASS"
} else {
Write-Output "FAIL"
}SCC Assessment
The automated check DISA's SCAP Compliance Checker runs to assess this control. Pick a release below to see exactly what it evaluates on the target system.
Not available for this version yet.
Assessment Script Powered by AISyntax-verified
A standalone PowerShell script to assess this control automatically. Review before running it in your environment.
Syntax-checked as valid PowerShell. Not executed here — running it for real needs the actual moz_firefox_windows target this check assesses.
# DISA STIG / SCAP compliance check: oval:mil.disa.stig.firefox.windows:def:116
powershell
$compliant = $true
if (Test-Path -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown") {
$tests = @(
[PSCustomObject]@{Name = "Cache"; Value = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown" -Name "Cache").Cache},
[PSCustomObject]@{Name = "Cookies"; Value = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown" -Name "Cookies").Cookies},
[PSCustomObject]@{Name = "Downloads"; Value = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown" -Name "Downloads").Downloads},
[PSCustomObject]@{Name = "FormData"; Value = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown" -Name "FormData").FormData},
[PSCustomObject]@{Name = "History"; Value = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\SanitizeOnShutdown" -Name "History").History}
)
foreach ($test in $tests) {
if ($test.Value -ne 0) {
$compliant = $false
break
}
}
} else {
$compliant = $false
}
if ($compliant) { Write-Output "PASS"; exit 0 } else { Write-Output "FAIL"; exit 1 }