← Back
Editing: audit.cpython-312.opt-1.pyc
� �j�U � �. � d dl Z d dlZddlmZ ddlmZ ddlmZ d� Zd� Zd� Z G d � d � Z G d� de � Z G d � de � Zd dlm Z i Z G d� de � Z G d� de � Z G d� de � Z G d� de � Z G d� d� Z G d� d� Z G d� d� Zy)� N� )� refpolicy)�access)�utilc �� � ddl } ddl}t dd� }t |j � j � d � }|j |j |j � |z � }|j d|� }|j d|� }| j ddd d ||g| j �� j � d }t j rt j |� }|S )� Obtain all of the avc and policy load messages from the audit log. This function uses ausearch and requires that the current process have sufficient rights to run ausearch. Returns: string contain all of the audit messages returned by ausearch. r Nz/proc/uptime�rz%xz%X�/sbin/ausearch�-m�5AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERRz-ts��stdout)� subprocess�time�open�float�read�split�close� localtime�strftime�Popen�PIPE�communicater �PY3�decode_input)r r �fd�off�s�bootdate�boottime�outputs �3/usr/lib/python3.12/site-packages/sepolgen/audit.py�get_audit_boot_msgsr$ s� � � ���N�C� �B� �b�g�g�i�o�o���"�#�C��H�H����t�y�y�{�S�(�)�A��}�}�T�1�%�H��}�}�T�1�%�H� � � �/��7n�pu�w� BJ� K�%/�_�_� � 6�6A�k�m�A�G�F��x�x��"�"�6�*���M� c � � ddl } | j g d�| j �� j � d }t j rt j |� }|S )r r N)r r r r �r r r r r r r �r r"