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

Win_region affected by Windows Registry Hardening #287

Closed
adam-kosseck opened this issue Aug 26, 2021 · 3 comments · Fixed by #288
Closed

Win_region affected by Windows Registry Hardening #287

adam-kosseck opened this issue Aug 26, 2021 · 3 comments · Fixed by #288

Comments

@adam-kosseck
Copy link

SUMMARY

Windows Registry editing can be blocked by changing specific settings in the Registry. When these settings are enabled win_region fails to make changes to a target system.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

win_region

ADDITIONAL INFORMATION

There are two Windows registry settings related to hardening the registry, they can be found under:
"User Configuration\Policies\Administrative Templates\System\". These settings are:
"Prevent access to registry editing tools" and "Disable regedit from running silently".

Feedback from jborean93:
It looks like this is will cause a failure when using reg.exe or regedit.exe. In the case of win_region it's doing a reg load and reg unload when copying the settings to a new profile

reg load $defaultHiveKey 'C:\Users\Default\NTUSER.DAT'
.
These can be fixed up to use the Win32 API that is in place for win_regedit which doesn't rely on reg.exe at all.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: at <ScriptBlock>, <No file>: line 348
fatal: [HOSTNAME]: FAILED! => {"changed": false, "msg": "Unhandled exception while executing module: ERROR: Registry editing has been disabled by your administrator."}

@jborean93
Copy link
Collaborator

The PR #288 should solve this issue for you. If you get a chance to test it out that would be great.

@adam-kosseck
Copy link
Author

The PR #288 should solve this issue for you. If you get a chance to test it out that would be great.

Hi Jordan, I have tested this PR in our environment.
I no longer get the error message about registry editing being disabled, and I can confirm that the settings do change successfully.

Thanks for this fix!

@jborean93
Copy link
Collaborator

Thanks for confirming, it will be part of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants