-
Notifications
You must be signed in to change notification settings - Fork 32
Function SecurityOption
Mark Wragg edited this page May 10, 2019
·
1 revision
Test a Local Security Policy Security Option.
Test the setting of a particular Local Security Policy Security Option, as visible in the Local Security Policy MMC under Local Policies > Security Options.
[Parameter(
Mandatory = $true,
Position = 1
)]The value provided to -Target needs to be one of the following:
Accounts: Administrator account statusAccounts: Block Microsoft accountsAccounts: Guest account statusAccounts: Limit local account use of blank passwords to console logon onlyAccounts: Rename administrator accountAccounts: Rename guest accountAudit: Audit the access of global system objectsAudit: Audit the use of Backup and Restore privilegeAudit: Force audit policy subcategory settings Windows Vista or later to override audit policy category settingsAudit: Shut down system immediately if unable to log security auditsDCOM: Machine Access Restrictions in Security Descriptor Definition Language SDDL syntaxDCOM: Machine Launch Restrictions in Security Descriptor Definition Language SDDL syntaxDevices: Allow undock without having to log onDevices: Allowed to format and eject removable mediaDevices: Prevent users from installing printer driversDevices: Restrict CD ROM access to locally logged on user onlyDevices: Restrict floppy access to locally logged on user onlyDomain controller: Allow server operators to schedule tasksDomain controller: LDAP server signing requirementsDomain controller: Refuse machine account password changesDomain member: Digitally encrypt or sign secure channel data alwaysDomain member: Digitally encrypt secure channel data when possibleDomain member: Digitally sign secure channel data when possibleDomain member: Disable machine account password changesDomain member: Maximum machine account password ageDomain member: Require strong Windows 2000 or later session keyInteractive logon: Display user information when the session is lockedInteractive logon: Do not display last user nameInteractive logon: Do not require CTRL ALT DELInteractive logon: Machine account lockout thresholdInteractive logon: Machine inactivity limitInteractive logon: Message text for users attempting to log onInteractive logon: Message title for users attempting to log onInteractive logon: Number of previous logons to cache in case domain controller is not availableInteractive logon: Prompt user to change password before expirationInteractive logon: Require Domain Controller authentication to unlock workstationInteractive logon: Require smart cardInteractive logon: Smart card removal behaviorMicrosoft network client: Digitally sign communications alwaysMicrosoft network client: Digitally sign communications if server agreesMicrosoft network client: Send unencrypted password to third party SMB serversMicrosoft network server: Amount of idle time required before suspending sessionMicrosoft network server: Attempt S4U2Self to obtain claim informationMicrosoft network server: Digitally sign communications alwaysMicrosoft network server: Digitally sign communications if client agreesMicrosoft network server: Disconnect clients when logon hours expireMicrosoft network server: Server SPN target name validation levelNetwork access: Allow anonymous SID Name translationNetwork access: Do not allow anonymous enumeration of SAM accountsNetwork access: Do not allow anonymous enumeration of SAM accounts and sharesNetwork access: Do not allow storage of passwords and credentials for network authenticationNetwork access: Let Everyone permissions apply to anonymous usersNetwork access: Named Pipes that can be accessed anonymouslyNetwork access: Remotely accessible registry pathsNetwork access: Remotely accessible registry paths and subpathsNetwork access: Restrict anonymous access to Named Pipes and SharesNetwork access: Restrict clients allowed to make remote calls to SAMNetwork access: Shares that can be accessed anonymouslyNetwork access: Sharing and security model for local accountsNetwork security: Allow Local System to use computer identity for NTLMNetwork security: Allow LocalSystem NULL session fallbackNetwork Security: Allow PKU2U authentication requests to this computer to use online identitiesNetwork security: Configure encryption types allowed for KerberosNetwork security: Do not store LAN Manager hash value on next password changeNetwork security: Force logoff when logon hours expireNetwork security: LAN Manager authentication levelNetwork security: LDAP client signing requirementsNetwork security: Minimum session security for NTLM SSP based including secure RPC clientsNetwork security: Minimum session security for NTLM SSP based including secure RPC serversNetwork security: Restrict NTLM Add remote server exceptions for NTLM authenticationNetwork security: Restrict NTLM Add server exceptions in this domainNetwork Security: Restrict NTLM Incoming NTLM TrafficNetwork Security: Restrict NTLM NTLM authentication in this domainNetwork Security: Restrict NTLM Outgoing NTLM traffic to remote serversNetwork Security: Restrict NTLM Audit Incoming NTLM TrafficNetwork Security: Restrict NTLM Audit NTLM authentication in this domainRecovery console: Allow automatic administrative logonRecovery console: Allow floppy copy and access to all drives and foldersShutdown: Allow system to be shut down without having to log onShutdown: Clear virtual memory pagefileSystem cryptography: Force strong key protection for user keys stored on the computerSystem cryptography: Use FIPS compliant algorithms for encryption hashing and signingSystem objects: Require case insensitivity for non Windows subsystemsSystem objects: Strengthen default permissions of internal system objects eg Symbolic LinksSystem settings: Optional subsystemsSystem settings: Use Certificate Rules on Windows Executables for Software Restriction PoliciesUser Account Control: Admin Approval Mode for the Built in Administrator accountUser Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktopUser Account Control: Behavior of the elevation prompt for administrators in Admin Approval ModeUser Account Control: Behavior of the elevation prompt for standard usersUser Account Control: Detect application installations and prompt for elevationUser Account Control: Only elevate executables that are signed and validatedUser Account Control: Only elevate UIAccess applications that are installed in secure locationsUser Account Control: Run all administrators in Admin Approval ModeUser Account Control: Switch to the secure desktop when prompting for elevationUser Account Control: Virtualize file and registry write failures to per user locations
[Parameter(
Mandatory = $true,
Position = 2,
)]You need to test against the friendly version of the result (as visible in the Local Security Policy MMC). For example Disabled or Enabled not 1 or 0 (per the registry).
If you want to validate that a setting is in a "Not Defined" state (e.g unset) you should test for $null.
Assertions: Be, BeExactly, Match, MatchExactly
SecurityOption 'Accounts: Administrator account status' {
Should -Be Disabled
}SecurityOption 'Domain member: Maximum machine account password age' {
Should -Be 30
}SecurityOption 'Accounts: Block Microsoft accounts' {
Should -Be $null
}SecurityOption 'Network access: Sharing and security model for local accounts' {
Should -Be 'Classic - local users authenticate as themselves'
}Getting Started
Contributing
Functions