You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-Draft/RFCXXXX-Policy.md
+33-52Lines changed: 33 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Comments Due: 6/30/2019
12
12
13
13
## Motivation
14
14
15
-
Consumers, developers, and enterprise system administrators should be able to flexibly and reliable way to configure PowerShell 7.
15
+
Consumers, developers, and enterprise system administrators should be able to flexibly and reliable configure PowerShell 7.
16
16
17
17
## Acknowledgement
18
18
@@ -43,9 +43,12 @@ PowerShell 7 has hard-coded defaults for all configuration options.
43
43
44
44
The default values must be `secure-by-default`.
45
45
46
-
For release versions hard-coded defaults must be the same as ones in re-installed configuration files. For preview versions they may vary (ex., enable experimental features and so on).
46
+
For release versions hard-coded defaults must be the same as ones in pre-installed configuration files. For preview versions they may vary (ex., enable experimental features and so on).
47
47
48
-
If during startup PowerShell 7 cannot read system configuration files it fails to startup.
48
+
System configuration includes security sensitive setting,
49
+
and failing to read those setting could result in an insecure system.
50
+
So, if during startup, PowerShell 7 cannot read files read from the Computer-Wide scope,
51
+
it fails to startup.
49
52
50
53
If during startup PowerShell 7 cannot read user configuration files it uses _hardcoded_ defaults.
51
54
@@ -55,27 +58,28 @@ If during operation PowerShell 7 cannot read configuration files it continue to
55
58
56
59
`PowerShell 7` settings are grouped into `Policy settings` and `Regular settings`.
57
60
Regular settings are normal configuration settings.
58
-
Regular settings can be treated as default values.
59
-
Policy settings is high priority and overlap regular settings.
60
-
Policy settings are used by administrators to centrally manage applications.
61
+
Regular settings can be treated as default and recommended values.
62
+
Policy settings is higher precedence.
63
+
See [Precedence for Policy settings in descending order](#precedence-for-policy-settings-in-descending-order).
64
+
Policy settings are used by administrators to centrally manage PowerShell and hosted applications.
`$PSHome` definition from [about_powershell_config](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_powershell_config?view=powershell-6) - The $PSHOME location is defined as the same directory as the executing System.Management.Automation.dll assembly.
106
+
This applies to hosted PowerShell SDK instances as well.
101
107
#### Parameter `-settingsfile`
102
108
103
109
With `-settingsfile` parameter users can assign custom settings from the config file and overwrite user-wide and application-wide settings.
104
110
105
111
##### Computer-wide and user policy settings
106
112
113
+
Definitions:
114
+
- System Lock-down mode: When Windows Defender Application Control or AppLocker force PowerShell into Constrained Language mode and only trusted code runs in Full Language mode. See [PowerShell Constrained Language Mode](https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/)
115
+
107
116
Admin/root users can overwrite computer-wide and user policy settings using `-settingsfile`,
108
117
only when not in System Lock-down mode.
109
118
@@ -115,9 +124,9 @@ This will have performance impact on startup, but only when `-settingsfile` is s
@@ -182,53 +191,25 @@ I filed [#9632](https://github.com/PowerShell/PowerShell/issues/9632) on Updatab
182
191
"PoliciesSettings": {
183
192
...
184
193
}
185
-
},
186
-
187
-
"OtherPowerShellApplication": {
188
-
"RegularSettings": {
189
-
...
190
-
},
191
-
"PolicySettings": {
192
-
...
193
-
}
194
+
}
194
195
}
195
196
```
196
197
197
198
## Alternate Proposals and Considerations
198
199
199
200
### Automatically resolve Windows PowerShell policy conflicts
200
201
201
-
We could attempt to resolve policy conflicts between PowerShell 7 policy and Windows PowerShell policy.
202
-
This would make the `Precedence for Policy settings` not just a simple list but a complex set of rules that would not be easily understood. See [this conversation](https://github.com/PowerShell/PowerShell/issues/9309?#issuecomment-480643922).
202
+
#### Motivation
203
203
204
-
### Allowing environment variable in the JSON
204
+
This is a description of the alternative to [Policy settings Setting Fall-Back](#policy-settings-setting-fall-back).
205
+
The main purpose of describing the alternative is to describe why it should not be pursued.
205
206
206
-
A new RFC should be drafted about how to allow environment variables in the JSON.
207
-
This would allow consistent files across platforms.
207
+
#### Description
208
208
209
-
### Comment A
209
+
PowerShell could attempt to resolve policy conflicts between PowerShell 7 policy and Windows PowerShell policy.
210
+
This would make the `Precedence for Policy settings` not just a simple list but a complex set of rules that would not be easily understood. See [this conversation](https://github.com/PowerShell/PowerShell/issues/9309?#issuecomment-480643922).
210
211
211
-
Mainly for Unix we'd add `Users` section to computer wide JSON file (`/etc/powershell.config.json`) to allow administrators set policies and regular settings on user level base
212
+
### Allowing environment variable in the JSON
212
213
213
-
```json
214
-
{
215
-
"PowerShell": {
216
-
"RegularSettings": {
217
-
...
218
-
},
219
-
"PolicySettings": {
220
-
...
221
-
},
222
-
"Users": {
223
-
"Smith": {
224
-
"PowerShell": {
225
-
"RegularSettings": {
226
-
...
227
-
},
228
-
"PolicySettings": {
229
-
...
230
-
}
231
-
}
232
-
}
233
-
}
234
-
```
214
+
A new RFC should be drafted about how to allow environment variables in the values in the JSON.
215
+
This would allow consistent files across platforms.
0 commit comments