File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_auditpol.cpython-310.pyc
Back
o ;j� � @ s6 d Z ddlZdZdd� Zd dd�Zd d � Zdd� ZdS )a` A salt module for modifying the audit policies on the machine Though this module does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via local or domain group policy. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.1 This module allows you to view and modify the audit settings as they are applied on the machine. Implementation uses the ``auditpol`` execution utility (``__utils__['auditpol']``), which reads and writes policy through Windows ``advapi32`` audit APIs with English subcategory names, independent of the host display language. The audit settings are broken down into nine categories: - Account Logon - Account Management - Detailed Tracking - DS Access - Logon/Logoff - Object Access - Policy Change - Privilege Use - System The ``get_settings`` function will return the subcategories for all nine of the above categories in one dictionary along with their auditing status. To modify a setting you only need to specify the subcategory name and the value you wish to set. Valid settings are: - No Auditing - Success - Failure - Success and Failure CLI Example: .. code-block:: bash # Get current state of all audit settings salt '*' auditpol.get_settings # Get the current state of all audit settings in the "Account Logon" # category salt '*' auditpol.get_settings category="Account Logon" # Get current state of the "Credential Validation" setting salt '*' auditpol.get_setting name="Credential Validation" # Set the state of the "Credential Validation" setting to Success and # Failure salt '*' auditpol.set_setting name="Credential Validation" value="Success and Failure" # Set the state of the "Credential Validation" setting to No Auditing salt '*' auditpol.set_setting name="Credential Validation" value="No Auditing" � NZauditpolc C s t jj�� sdS tS )z' Only works on Windows systems )Fz5Module win_auditpol: module only available on Windows)�salt�utils�platformZ is_windows�__virtualname__� r r �M/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_auditpol.py�__virtual__D s r �Allc C � t d | d�S )a� Get the current configuration for all audit settings specified in the category Args: category (:obj:`str`, optional): One of the nine categories to return. Can also be ``All`` to return the settings for all categories. Valid options are: - Account Logon - Account Management - Detailed Tracking - DS Access - Logon/Logoff - Object Access - Policy Change - Privilege Use - System - All Default is ``All``. Returns: dict: A dictionary containing all subcategories for the specified category along with their current configuration (English names and value labels). Raises: KeyError: On invalid category CommandExecutionError: If an error is encountered retrieving the settings from the underlying Windows API. CLI Example: .. code-block:: bash # Get current state of all audit settings salt '*' auditipol.get_settings # Get the current state of all audit settings in the "Account Logon" # category salt '*' auditpol.get_settings 'Account Logon' zauditpol.get_settings��category�Z __utils__r r r r �get_settingsN s ,r c C r )a5 Get the current configuration for the named audit setting Args: name (str): The name of the setting to retrieve Returns: str: The current configuration for the named setting Raises: KeyError: On invalid setting name CommandExecutionError: If an error is encountered retrieving the settings from the underlying Windows API. CLI Example: .. code-block:: bash # Get current state of the "Credential Validation" setting salt '*' auditpol.get_setting 'Credential Validation' zauditpol.get_setting��namer r r r r �get_setting} s r c C s t d | |d�S )a� Set the configuration for the named audit setting Args: name (str): The name of the setting to configure value (str): The configuration for the named value. Valid options are: - No Auditing - Success - Failure - Success and Failure Returns: bool: ``True`` if successful Raises: KeyError: On invalid ``name`` or ``value`` CommandExecutionError: If an error is encountered modifying the setting (for example insufficient privilege for ``AuditSetSystemPolicy``). CLI Example: .. code-block:: bash # Set the state of the "Credential Validation" setting to Success and # Failure salt '*' auditpol.set_setting 'Credential Validation' 'Success and Failure' # Set the state of the "Credential Validation" setting to No Auditing salt '*' auditpol.set_setting 'Credential Validation' 'No Auditing' zauditpol.set_setting�r �valuer r r r r �set_setting� s $r )r )�__doc__Zsalt.utils.platformr r r r r r r r r r �<module> s = /
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings