Onionr/static-data/official-plugins/bigbrother/ministry/ofdisk.py

37 lines
1.2 KiB
Python
Raw Normal View History

2021-01-15 21:36:57 +00:00
"""Onionr - Private P2P Communication.
Log (not block) read/write of non-user data files and non-python lib files
"""
2020-03-31 05:15:24 +00:00
from utils.identifyhome import identify_home
import logger
2021-01-15 21:36:57 +00:00
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
2020-03-31 05:15:24 +00:00
def detect_disk_access(info):
if type(info[0]) is int: return
if '/dev/null' == info[0]: return
whitelist = [identify_home(), 'onionr/src/', '/site-packages/', '/usr/lib64/', '/usr/local/lib/python']
2020-03-31 05:15:24 +00:00
for item in whitelist:
if item in info[0]:
return
if identify_home() not in info[0]:
2020-07-31 01:15:36 +00:00
if 'proc' not in info[0]: # if it is, it is onionr stats
2020-03-31 05:15:24 +00:00
logger.warn(f'[DISK MINISTRY] {info}')