✏️ 编辑:audit.cpython-39.opt-1.pyc
路径:
/usr/lib/python3.9/site-packages/sepolgen/__pycache__/audit.cpython-39.opt-1.pyc
大小:16.9 KB · 修改:2026-04-05 11:05:56 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a B�i�U � @ s� d dl Z d dlZddlmZ ddlmZ ddlmZ dd� Zdd � Zd d� ZG dd � d �Z G dd� de �Z G dd� de �Zd dlm Z i ZG dd� de �ZG dd� de �ZG dd� de �ZG dd� de �ZG dd� d�ZG dd� d�ZG dd� d�ZdS ) � N� )� refpolicy)�access)�utilc C s� ddl } ddl}tdd�}t|�� �� d �}|j |�|�� | �}|�d|�}|�d|�}| j ddd d ||g| j d��� d }tj r�t�|�}|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 �fdZoff�sZbootdateZboottime�output� r �2/usr/lib/python3.9/site-packages/sepolgen/audit.py�get_audit_boot_msgs s �� r c C s8 ddl } | jg d�| jd��� d }tjr4t�|�}|S )r r N)r r r r �r r r r r r r �r r r r r �get_audit_msgs2 s �� r# c C s6 ddl } | jdg| jd��� d }tjr2t�|�}|S )z�Obtain all of the avc and policy load messages from /bin/dmesg. Returns: string contain all of the audit messages returned by dmesg. r Nz /bin/dmesgr r! r"