Skip to content
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] lgpo_reg state does not enforce/report registry changes #64222

Closed
twangboy opened this issue May 3, 2023 · 1 comment · Fixed by #64230
Closed

[BUG] lgpo_reg state does not enforce/report registry changes #64222

twangboy opened this issue May 3, 2023 · 1 comment · Fixed by #64230
Assignees
Labels
Bug broken, incorrect, or confusing behavior lgpo State-Module Sulfur v3006.1 Windows

Comments

@twangboy
Copy link
Contributor

twangboy commented May 3, 2023

Description
The lgpo_reg state module determines success and failure based solely on the content of the Registry.pol file. The execution module also sets the value in the registry. This allows for a scenario where the state will run and set the policy, the user will change the registry value, the state runs again and thinks everything is correct because the Registry.pol file is correct, but the registry setting is not correct. The state needs to detect the incorrect registry setting as well. It needs to be displayed in test=True and in changes made after a successful run.

Setup
Given the following state:

# content of lgpo_reg.sls
set_reg_pol_value:
  lgpo_reg.value_present:
    - key: SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
    - name: HideFileExt
    - v_data: 0

Steps to Reproduce the Behavior

Apply the state:

salt-call --local state.apply lgpo_reg

Change the registry value to something else:

salt-call --local reg.set_value HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced HideFileExt vdata=1

Apply the state again:

salt-call --local state.apply lgpo_reg

Salt thinks everything is fine... but it's not.

Expected behavior
The state should detect the registry discrepancy and change it
The changes should be displayed during test=True and in a successful run

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
3006.x branch
@twangboy twangboy self-assigned this May 3, 2023
@twangboy twangboy added this to the Sulfur v3006.1 milestone May 3, 2023
@twangboy twangboy linked a pull request May 3, 2023 that will close this issue
3 tasks
@anilsil
Copy link

anilsil commented May 4, 2023

fixed by #64230

@anilsil anilsil closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior lgpo State-Module Sulfur v3006.1 Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants