Skip to content

Commit

Permalink
Merge remote-tracking branch 'local-from/develop' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
CI (Automated) committed Jul 18, 2018
2 parents 03f76fb + 5c3d262 commit ce3502d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FunctionsToExport = @('Install-WindowsUpdates',
'Wait-WindowsUpdates',
'Test-InstalledUpdates',
'Install-KB4056898',
'Install-KB4338825',
'Disable-AutomaticUpdates',
'Enable-CVE-2015-6161',
'Enable-CVE-2017-8529',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,26 @@ function Install-KB4056898() {
Set-Service -Name wuauserv -StartupType Manual
Start-Service -Name wuauserv

Invoke-WebRequest -UseBasicParsing -Uri 'http://download.windowsupdate.com/d/msdownload/update/software/secu/2018/01/windows8.1-kb4056898-x64_ad6c91c5ec12608e4ac179b2d15586d244f0d2f3.msu' -Outfile C:\provision\patch.msu
wusa.exe C:\provision\patch.msu /quiet
Invoke-WebRequest -UseBasicParsing -Uri 'http://download.windowsupdate.com/d/msdownload/update/software/secu/2018/01/windows8.1-kb4056898-x64_ad6c91c5ec12608e4ac179b2d15586d244f0d2f3.msu' -Outfile C:\provision\kb4056898.msu

wusa.exe C:\provision\kb4056898.msu /quiet
}

function Install-KB4338825() {
Write-Log "Preparing: KB4338825."

Set-Service -Name wuauserv -StartupType Manual
Start-Service -Name wuauserv

Write-Log "Downloading: KB4338825."

Invoke-WebRequest -UseBasicParsing -Uri 'http://download.windowsupdate.com/c/msdownload/update/software/secu/2018/07/windows10.0-kb4338825-x64_631cd7cfc1e4986e37cb727bae1ee1759a87c688.msu' -Outfile C:\provision\KB4338825.msu

Write-Log "Installing: KB4338825."
wusa.exe C:\provision\KB4338825.msu /quiet
}


function Enable-CVE-2015-6161() {
#Enable MS15-124 - Internet Explorer ASLR Bypass fix - CVE-2015-6161
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ALLOW_USER32_EXCEPTION_HANDLER_HARDENING" /t REG_DWORD /v "iexplore.exe" /d 1 /f
Expand Down
1 change: 1 addition & 0 deletions lib/packer/config/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def self.pre_provisioners(os, skip_windows_update: false, reduce_mtu: false, iaa
Provisioners.setup_proxy_settings(http_proxy, https_proxy, bypass_list),
Provisioners::NEW_PROVISIONER,
Provisioners::INSTALL_CF_FEATURES_2016,
Provisioners::INSTALL_KB4338825,
]
end
install_windows_updates = if skip_windows_update then [] else [Provisioners.install_windows_updates] end
Expand Down
6 changes: 6 additions & 0 deletions lib/packer/config/provisioners.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def self.powershell_provisioner(command)
'restart_command' => "powershell.exe -Command Install-KB4056898",
'restart_timeout' => '1h'
}
INSTALL_KB4338825 = {
'type' => 'windows-restart',
'restart_command' => "powershell.exe -Command Install-KB4338825",
'restart_timeout' => '1h'

}
INSTALL_CF_FEATURES_2016 = {
'type' => 'windows-restart',
'restart_command' => "powershell.exe -Command Install-CFFeatures",
Expand Down
1 change: 1 addition & 0 deletions spec/packer/config/aws_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
'Set-ProxySettings ']},
{"type"=>"powershell", "inline"=> ["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "New-Provisioner"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-CFFeatures", "restart_timeout"=>"1h"},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-KB4338825", "restart_timeout"=>"1h"},
{"type"=>"powershell", "inline"=> ["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Add-Account -User Provisioner -Password some-password!"]},
{"type"=>"powershell", "inline"=> ["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Register-WindowsUpdatesTask"]},
{"type"=>"windows-restart", "restart_command"=> "powershell.exe -Command Wait-WindowsUpdates -Password some-password! -User Provisioner", "restart_timeout"=>"12h"},
Expand Down
1 change: 1 addition & 0 deletions spec/packer/config/azure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
'Set-ProxySettings ']},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "New-Provisioner"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-CFFeatures", "restart_timeout"=>"1h"},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-KB4338825", "restart_timeout"=>"1h"},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Add-Account -User Provisioner -Password some-password!"]},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Register-WindowsUpdatesTask"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Wait-WindowsUpdates -Password some-password! -User Provisioner", "restart_timeout"=>"12h"},
Expand Down
1 change: 1 addition & 0 deletions spec/packer/config/gcp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
'Set-ProxySettings ']},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "New-Provisioner"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-CFFeatures", "restart_timeout"=>"1h"},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-KB4338825", "restart_timeout"=>"1h"},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Add-Account -User Provisioner -Password some-password!"]},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Register-WindowsUpdatesTask"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Wait-WindowsUpdates -Password some-password! -User Provisioner", "restart_timeout"=>"12h"},
Expand Down
1 change: 1 addition & 0 deletions spec/packer/config/vsphere_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
'Set-ProxySettings foo bar bee']},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "New-Provisioner"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-CFFeatures", "restart_timeout"=>"1h"},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Install-KB4338825", "restart_timeout"=>"1h"},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Add-Account -User Provisioner -Password some-password!"]},
{"type"=>"powershell", "inline"=>["$ErrorActionPreference = \"Stop\";", "trap { $host.SetShouldExit(1) }", "Register-WindowsUpdatesTask"]},
{"type"=>"windows-restart", "restart_command"=>"powershell.exe -Command Wait-WindowsUpdates -Password some-password! -User Provisioner", "restart_timeout"=>"12h"},
Expand Down

0 comments on commit ce3502d

Please sign in to comment.