Understanding Powershell Security Flashcards

1
Q

What three purposes do Powershell execution policies serve?

A

1, safety feature to control conditions a script can run
2. Prevent execution of malicious scripts
3. Scope execution of scripts to specific sessions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are Powershell execution policies?

A

Local Computer and Current user are stored in the registry

Is not a security system to restrict user actions, just certain types of execution

Can be set for Workstation, Current user, or particular session

Default exec policy on non’Windows is unrestricted and cannot be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What Execution Policies are available?

A

All signed - execute scripts with an SSL cert
Bypass - ignores all policies
Remote signed - like all signed
Restricted - block and potentially not allow scripts to execute
Unrestricted - can run scripts with no questions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the All signed policy

A

Scripts can execute. Requires all scripts and config files be signed by a trusted published

Prompts you before running scripts not yet classified

Risk running signed malicious scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Bypass policy

A

Nothing is blocked, no warning or prompts

Designed for config where ps script is what it is, and the foundation for a program that has its own security model. Adminless, no need to touch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Remote signed policy

A

Scripts can execute

Requires digital sig from trusted publisher

Doesn’t required digital signs on scripts that are written locally

Run scripts that are not signed, if the scripts are unblocked

Risk running unsigned and signed scripts that could be malicious

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

restricted policy

A

Default exec policy for Win clients

Permits inidividual commands but does not allow scripts

Prevents running of all script files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Unrestricted policy

A

Default policy for non’Win computers

Unsigned scripts can execute

Risk of running Mali scripts

Warns user before running scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Powershell scopes

A

Process - Powershell session
Current user
Local machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the two Group policy based scopes?

A

Machine policy - set by a group policy for all users of the pc
User policy - set for current user of computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Review exec policy precedence

A
  1. Process
  2. Current User
  3. Machine
  4. Restricted (default policy)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the ps command to get the execution policy precedence?

A

Get-ExecutionPolicy -List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Setting execution policies

A

Can be assigned to the default scope or a specific scope

The default scope is LocalMachine, which affects everyone who uses the PC

Exec policies can be used for a single ps session

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to set default exec policy?

A

Set-ExecutionPolicy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Set an exec policy for the local machine scope

A

Set-ExecutionPolicy
- ExectionPolicy RemoteSigned
- Scope LocalMachine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Set exec policy from a remote computer to a local computer

A

Invoke-Command
-ComputerName Computer
- ScriptBlock { Get-ExecutionPolicy } | Set-ExecutionPolicy

17
Q

What is invoke command?

A

Used to run a command on a remote machine

18
Q

Set exec policy for a single session

A

Set-ExecutionPolicy