dsccommunity / SecurityPolicyDsc

A wrapper around secedit.exe to configure local security policies
MIT License
177 stars 53 forks source link

DscSecurityOption: Ensure that Get returns name #159

Closed michaeltlombardi closed 3 years ago

michaeltlombardi commented 3 years ago

Prior to this commit, invoking the SecurityPolicy resource with the Get method would always return $Null for the Name property; though this property is itself never used by the resource, integrating tools are unable to tell as the Name property is also the Key (as defined in the MOF) for this resource; meaning when comparing the existing state of the resource it will always cause a mismatch between the specified Name and the "actual" representation of the resource on the machine, as reported by the Get-TargetResource function.

This commit modifies the Get-TargetResource function for the SecurityPolicy DSC resource to always return the specified Name for the resource in order to prevent churn in secondary tools such as Puppet, Ansible, or Chef.

This mirrors the change in #152 to AccountPolicy.

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

codecov[bot] commented 3 years ago

Codecov Report

Merging #159 (558e7fd) into master (bd72347) will increase coverage by 0%. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #159   +/-   ##
=====================================
  Coverage      89%    89%           
=====================================
  Files           5      5           
  Lines         576    577    +1     
=====================================
+ Hits          516    517    +1     
  Misses         60     60           
bwilcox commented 3 years ago

Tested this and it resolved issues we've had using this module for setting security options.

gaelcolas commented 3 years ago

Sorry I forgot about this PR. Will try to rebase, resolve conflict and merge. Ping me today if it's not done.

gaelcolas commented 3 years ago

Please try 3.0.0-preview0006 and let know if any issue.