File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
images/win/scripts/Installers Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11# ###############################################################################
22# # File: Install-Firefox.ps1
33# # Desc: Install Mozilla Firefox
4+ # # Supply chain security: Firefox browser - checksum validation
45# ###############################################################################
56
67# Install and configure Firefox browser
78Write-Host " Install latest Firefox browser..."
89$VersionsManifest = Invoke-RestMethod " https://product-details.mozilla.org/1.0/firefox_versions.json"
9- $InstallerName = " firefox-browser.exe"
1010$InstallerUrl = " https://download.mozilla.org/?product=firefox-$ ( $VersionsManifest.LATEST_FIREFOX_VERSION ) &os=win64&lang=en-US"
11- $ArgumentList = ( " /silent " , " /install " )
11+ $packagePath = Start-DownloadWithRetry - Url $InstallerUrl - Name " FirefoxSetup.exe "
1212
13- Install-Binary - Url $InstallerUrl - Name $InstallerName - ArgumentList $ArgumentList
13+ # region Supply chain security - Stack
14+ $fileHash = (Get-FileHash - Path $packagePath - Algorithm SHA256).Hash
15+ $hashUrl = " https://archive.mozilla.org/pub/firefox/releases/$ ( $VersionsManifest.LATEST_FIREFOX_VERSION ) /SHA256SUMS"
16+ $externalHash = (Invoke-RestMethod - Uri $hashURL ).ToString().Split(" `n " ).Where ({ $_ -ilike " *win64/en-US/Firefox Setup*exe*" }).Split(' ' )[0 ]
17+ Use-ChecksumComparison $fileHash $externalHash
18+ # endregion
19+
20+ Install-Binary - FilePath $packagePath - ArgumentList " /silent" , " /install"
1421
1522Write-Host " Disable autoupdate..."
1623$FirefoxDirectoryPath = Join-Path $env: ProgramFiles " Mozilla Firefox"
You can’t perform that action at this time.
0 commit comments