Lcv d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl
mZ d dlm
Z
d dlmZ d dlmZmZ e Zd Zd
d
Zd
dZej fdZdS ) N)Corenative)EventHookLogger) EventHook)db)run
snake_casec t j rg S t j t j | k }t
| S )N)r deferredr selectwhereeventlist)r hookss R/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/hooks/execute.py get_hooksr sB
{ $$Y_%=>>E;; Fc X t j | s"t d | |rBt j | t j s"t d | nAt j | t j s"t d | t j | } t j | }n5# t $ r(}t d | | d}~ww xY w|j t j z r"t d | t j
| }|r|dk r t j | }n5# t $ r(}t d || d}~ww xY w|j t j z r;|j t j z s)t d || dS dS dS dS )
a' Raise ValueError if path is not a safe hook file.
The original check rejected any path under /tmp, /var/tmp, /dev/shm
on the grounds that those dirs are world-writable. That blanket-
by-prefix rule was too coarse: pytest's tmp_path lives under
/tmp/pytest-of-