%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/thread-self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/win_lgpo.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l
m Z e j e
� Z d Z i d d 6Z d � Z d � Z d d d d e d
d � Z d S( u5
Manage Windows Local Group Policy
=================================
.. versionadded:: 2016.11.0
This state allows configuring local Windows Group Policy
The state can be used to ensure the setting of a single policy or multiple policies in one pass.
Single policies must specify the policy name, the setting, and the policy class (Machine/User/Both)
Example single policy configuration
.. code-block:: yaml
Ensure Account Lockout Duration:
lgpo.set:
- name: Account lockout duration
- setting: 90
- policy_class: Machine
.. code-block:: yaml
Account lockout duration:
gpo.set:
- setting: 120
- policy_class: Machine
Multiple policy configuration
.. code-block:: yaml
Company Local Group Policy:
lgpo.set:
- computer_policy:
Deny logon locally: Guest
Account lockout duration: 120
Account lockout threshold: 10
Reset account lockout counter after: 1440
Enforce password history: 24
Maximum password age: 60
Minimum password age: 1
Minimum password length: 14
Password must meet complexity requirements: Enabled
Store passwords using reversible encryption: Disabled
Configure Automatic Updates:
Configure automatic updating: 4 - Auto download and schedule the intsall
Scheduled install day: 7 - Every Saturday
Scheduled install time: 17:00
Specify intranet Microsoft update service location:
Set the intranet update service for detecting updates: http://mywsus
Set the intranet statistics server: http://mywsus
- user_policy:
Do not process the legacy run list: Enabled
.. code-block:: text
server_policy:
lgpo.set:
- computer_policy:
Maximum password age: 60
Minimum password age: 1
Minimum password length: 14
Account lockout duration: 1440
Account lockout threshold: 10
Reset account lockout counter after: 1440
Manage auditing and security log:
- "BUILTIN\Administrators"
Replace a process level token:
- "NT AUTHORITY\NETWORK SERVICE"
- "NT AUTHORITY\LOCAL SERVICE"
"Accounts: Guest account status": Disabled
"Accounts: Rename guest account": Not_4_U
"Audit: Audit the use of Backup and Restore privilege": Enabled
"Interactive logon: Do not display last user name": Enabled
"Network\DNS Client\Dynamic update": Disabled
"System\Logon\Do not display the Getting Started welcome screen at logon": Enabled
"Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections\Select RDP transport protocols":
"Select Transport Type": "Use both UDP and TCP"
"Windows Components\Windows Update\Allow Automatic Updates immediate installation": Enabled
"Windows Components\Windows Update\Allow non-administrators to receive update notifications": Disabled
"Windows Components\Windows Update\Always automatically restart at the scheduled time":
"The restart timer will give users this much time to save their work (minutes)": 15
"Windows Components\Windows Update\Automatic Updates detection frequency":
"Check for updates at the following interval (hours)": 1
"Windows Components\Windows Update\Configure Automatic Updates":
"Configure automatic updating": 4 - Auto download and schedule the install
"Install during automatic maintenance": False
"Scheduled install day": 7 - Every Saturday
"Scheduled install time": "17:00"
"Windows Components\Windows Update\Delay Restart for scheduled installations":
"Wait the following period before proceeding with a scheduled restart (minutes)": 1
"Windows Components\Windows Update\No auto-restart with logged on users for scheduled automatic updates installations": Disabled
"Windows Components\Windows Update\Re-prompt for restart with scheduled installations":
"Wait the following period before prompting again with a scheduled restart (minutes)": 30
"Windows Components\Windows Update\Reschedule Automatic Updates scheduled installations": Disabled
"Windows Components\Windows Update\Specify intranet Microsoft update service location":
"Set the intranet update service for detecting updates": http://mywsus
"Set the intranet statistics server": http://mywsus
- cumulative_rights_assignments: True
i ( t absolute_importt unicode_literalst print_functionN( t sixu lgpou setu set_c C@ s d t k r t St S( u7
load this state if the win_lgpo module exists
u lgpo.set( t __salt__t __virtualname__t False( ( ( s8 /usr/lib/python2.7/site-packages/salt/states/win_lgpo.pyt __virtual__{ s c C@ s� t | t j � r | | k St | t � r] t | t � rV t j j j | | � i k St SnA t | t � r� t | t � r� t j j j
| | � i k St Sn d S( ue
Helper function that returns ``True`` if the policies are the same,
otherwise ``False``
N( t
isinstanceR t string_typest listt saltt utilst datat
compare_listsR t dictt
compare_dicts( t
new_policyt current_policy( ( s8 /usr/lib/python2.7/site-packages/salt/states/win_lgpo.pyt _compare_policies� s
u en-USc ! C@ s� i | d 6t d 6i d 6d d 6} d d d d g } | rq | rq | rq d
} | d } t | d <| | d <| S| r� | r� d } t | d <| | d <| S| r� | s� | r� d
} | d } | d } t | d <| | d <| S| r| j � | k rd } t | d <| | d <| S| s�| r1| r1d } n | r@d } n | rOd } n | r�t | t � r�d } t | d <| | d <| S| r?t | t � r?d } t | d <| | d <| Sn� i } i } | j � d k r�| | | <| | | <nP | j � d k r| | | <n1 | j � d k s2| j � d k r?| | | <n i }
i d d 6| d 6i d 6|
d <i d d 6| d 6i d 6|
d <x� t j |
� D]� \ } } | d r�x� t j | d � D]o \ }
} t d |
| d | �} | d r| |
| d |
<q�d j | d | d g � | d <t | d <q�Wq�q�W| d sE| St d d | d | d t � } t j
d | � g } x4t j |
� D]#\ } } d: } | r�| d | k r�x�t j | d � D]�\ }
} t } |
| | d k r�t } |
} n� |
j � d! � | | d D� k rcx� | | d D]. } |
j � | j � k r.t } | } Pq.q.WnQ xN | d |
d"