powershellscoop-installer

How to balance security (PowerShell execution policy changes) concerns around installation of Scoop on Windows?


I would like to try Scoop on Windows and its docs ask for "PowerShell must be enabled for your user account" by running

PS > Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

When I run the command I am seeing a warning saying

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"):

What measures should one do to mitigate this risk? Would resetting the policy back to Undefined` after installing Scoot and between running of Scoop commands be better?


Solution

  • There is little risk involved with setting RemoteSigned. Basically this mode lets you execute local unsigned scripts (scripts you write) while scripts from a remote source must be signed by a trusted authority. I'll leave an explanation of each execution policy below.



    As for risk mitigation? User education (if this is for a business) about not running untrusted code would be a start. You'll probably already have an A/V and anti-malware solution in place, and you should be securely storing secrets in a credential vault where they belong. RemoteSigned is a good policy to set and in most cases this will be fairly permissive while still offering you some basic security against malicious remote scripts.