File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,6 @@ $ErrorActionPreference = "Stop"
60
60
$ProgressPreference = " SilentlyContinue"
61
61
$LicensePath = Convert-Path $LicensePath
62
62
63
- Import-Module $PSScriptRoot \modules\C4B- Environment
64
-
65
63
$ChocoInstallScript = Join-Path $PSScriptRoot " scripts\ChocolateyInstall.ps1"
66
64
if (-not (Test-Path $ChocoInstallScript )) {
67
65
Invoke-WebRequest - Uri ' https://chocolatey.org/install.ps1' - OutFile $ChocoInstallScript
@@ -80,6 +78,8 @@ if ($Signature.Status -eq 'Valid' -and $Signature.SignerCertificate.Subject -eq
80
78
Write-Error " ChocolateyInstall.ps1 script signature is not valid. Please investigate." - ErrorAction Stop
81
79
}
82
80
81
+ Import-Module $PSScriptRoot \modules\C4B- Environment - Force
82
+
83
83
# Initialize environment, ensure Chocolatey For Business, etc.
84
84
$Licensed = ($ ($ (choco.exe )[0 ] -match " ^Chocolatey (?<Version>\S+)\s*(?<LicenseType>Business)?$" ) -and $Matches.LicenseType )
85
85
$InstalledLicensePath = " $env: ChocolateyInstall \license\chocolatey.license.xml"
Original file line number Diff line number Diff line change 24
24
{ "name" : " KB3035131" , "internalize" : false },
25
25
{ "name" : " microsoft-edge" },
26
26
{ "name" : " nexus-repository" },
27
- { "name" : " pester" },
27
+ { "name" : " pester" , "internalize" : false },
28
28
{ "name" : " sql-server-express" },
29
29
{ "name" : " temurin21jre" },
30
30
{ "name" : " vcredist140" }
Original file line number Diff line number Diff line change @@ -2319,4 +2319,14 @@ function Install-ChocolateyAgent {
2319
2319
}
2320
2320
# endregion
2321
2321
2322
+ # Check for and configure FIPS enforcement, if required.
2323
+ if (
2324
+ (Get-ItemPropertyValue - Path " HKLM:\System\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy" - Name Enabled) -eq 1 -and
2325
+ $env: ChocolateyInstall -and
2326
+ -not [bool ]::Parse(([xml ](Get-Content $env: ChocolateyInstall \config\chocolatey.config)).chocolatey.features.feature.Where{$_.Name -eq ' useFipsCompliantChecksums' }.Enabled)
2327
+ ) {
2328
+ Write-Warning - Message " FIPS is enabled on this system. Ensuring Chocolatey uses FIPS compliant checksums"
2329
+ Invoke-Choco feature enable -- name= ' useFipsCompliantChecksums'
2330
+ }
2331
+
2322
2332
Export-ModuleMember - Function " *"
Original file line number Diff line number Diff line change @@ -105,6 +105,13 @@ $script = $webClient.DownloadString("https://${hostAddress}/repository/choco-ins
105
105
# Run the Chocolatey Install script with the parameters provided
106
106
& ([scriptblock ]::Create($script )) @params
107
107
108
+ # If FIPS is enabled, configure Chocolatey to use FIPS compliant checksums
109
+ $fipsStatus = Get-ItemProperty - Path " HKLM:\System\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy" - Name Enabled
110
+ if ($fipsStatus.Enabled -eq 1 ) {
111
+ Write-Warning - Message " FIPS is enabled on this system. Ensuring Chocolatey uses FIPS compliant checksums"
112
+ choco feature enable -- name= ' useFipsCompliantChecksums'
113
+ }
114
+
108
115
choco config set cacheLocation $env: ChocolateyInstall \choco- cache
109
116
choco config set commandExecutionTimeoutSeconds 14400
110
117
You can’t perform that action at this time.
0 commit comments