-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] long setting names don't work in lgpo.set
for some policies
#62058
Comments
I started looking at this. It looks like the long name, as shown in the GUI, is not the same long name expected by the policy. For example, here is the GUI representation of There is a command you can run to get the names as expected by Salt. That function is
So, I think if you use |
Looking at
In this case, I would recommend using the Element ID: CheckBox_AllowOnlineTips rather than try to figure out what characters are before the Element name. In fact, that may be the overall recommendation here... to use the Element ID instead. We could investigate the possibility of stripping whitespace from the beginning and end of Element names. |
|
Just created a PR to handle whitespace. #62572 That should fix the |
Salt Minion 3006.1 I'm trying to enable the policy Computer Configuration//Administrative Templates//Microsoft Edge//SmartScreen settings//Prevent bypassing Microsoft Defender SmartScreen prompts for sites salt-call lgpo.get_policy_info "Microsoft Edge\SmartScreen settings\Prevent bypassing Microsoft Defender SmartScreen prompts for sites" machine I've tried to set this policy using all 3 of policy_aliases listed in the info but none of them work. I don't know if this is a bug but its been driving me insane for the past 2 days. |
Description
When using the
lgpo.set
state module, policy settings, where applicable, are passed in as a dictionary, e.gI've also noticed that you can use, what I call the "short setting" name (found by inspecting
C:\Windows\PolicyDefintions
), e.g.The short setting name seems to be a bit more reliable, however.
Here is one example of a policy that does not work with the long setting names
but works with short setting names,
The cases for which the long setting name does not work seems to be sporadic and unpredictable; nonetheless, the following is a exhaustive list of policies I've identified to fail with long setting names
Allow Online Tips
(class: Machine)Set BranchCache Hosted Cache mode
(class: Machine)Set IP-HTTPS State
(class: Machine)Warning for large Kerberos tickets
(class: Machine)Set maximum Kerberos SSPI context token buffer size
(class: Machine)Specify KDC proxy servers for Kerberos clients
(class: Machine)Allow uploads while the device is on battery while under set Battery level (percentage)
(class: Machine)Cache Server Hostname
(class: Machine)Delay Background download Cache Server fallback (in seconds)
(class: Machine)Delay Foreground download Cache Server fallback (in seconds)
(class: Machine)Maximum Background Download Bandwidth (percentage)
(class: Machine)Maximum Foreground Download Bandwidth (percentage)
(class: Machine)Max Cache Size (percentage)
(class: Machine)Select a method to restrict Peer Selection
(class: Machine)Select the source of Group IDs
(class: Machine)Enable Protected Event Logging
(class: Machine)Define device control policy groups
(class: Machine)Define device control policy rules
(class: Machine)Configure Attack Surface Reduction rules
(class: Machine)Exclude files and paths from Attack Surface Reduction Rules
(class: Machine)Configure allowed applications
(class: Machine)Configure Controlled folder access
(class: Machine)Configure protected folders
(class: Machine)Define the number of days after which a catch-up scan is forced
(class: Machine)Define security intelligence location for VDI clients.
(class: Machine)Use a common set of exploit protection settings
(class: Machine)Control rich previews for attachments
(class: Machine)Preview pane location
(class: Machine)Set large or small icon view in desktop search results
(class: Machine)Tag Windows Customer Experience Improvement data with Study Identifier
(class: Machine)Control maximum size of baseline file cache
(class: Machine)Prohibit flyweight patching
(class: Machine)Prohibit use of Restart Manager
(class: Machine)Specify the types of events Windows Installer records in its transaction log
(class: Machine)Turn off logging via package settings
(class: Machine)Turn off Windows Installer
(class: Machine)Configure auto-restart required notification for updates
(class: Machine)Configure auto-restart warning notifications schedule for updates
(class: Machine)Display options for update notifications
(class: Machine)Specify active hours range for auto-restarts
(class: Machine)Specify deadline before auto-restart for update installation
(class: Machine)Specify the order in which Windows Installer searches for installation files
(class: User)Location where all default Library definition files for users/machines reside.
(class: Both)Configure which channel of Microsoft Edge to use for opening redirected sites
(class: Both)Limit Site Discovery output by Domain
(class: Both)Limit Site Discovery output by Zone
(class: Both)Settings package size warning threshold
(class: Both)Synchronization timeout
(class: Both)Do not sync Apps
(class: Machine)Do not sync app settings
(class: Machine)Do not sync browser settings
(class: Machine)Do not sync desktop personalization
(class: Machine)Do not sync other Windows settings
(class: Machine)Do not sync passwords
(class: Machine)Do not sync personalize
(class: Machine)Do not sync start settings
(class: Machine)Setup
Install salt minion. Form a salt state using long setting names for any policy in the above list.
(Search for policy in
C:\Windows\PolicyDefinitions
or in Local Group Policy Editor to find setting names)Steps to Reproduce the behavior
Expected error is
Invalid Element name
.Then, replace the long setting names with short setting names (found in
C:\Windows\PolicyDefintions
) and re-runto observe success.
Expected behavior
For the most policies long setting names work, but for those listed above, they don't, unexpectedly.
At the very least, it is desirable to understand how / why these policies only work with short setting names.
i.e. what is the internal salt logic for identifying a valid long setting name? Is it a shortcoming of the policy definitions themselves or the way that salt parses them?
Versions Report
The text was updated successfully, but these errors were encountered: