Hackfut Security File Manager
Current Path:
/opt/alt/python37/lib/python3.7/site-packages
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
📁
..
📁
Babel-2.9.1-py3.7.egg-info
📁
Jinja2-3.0.3-py3.7.egg-info
📁
Mako-1.1.0-py3.7.egg-info
📁
PyJWT-1.7.1-py3.7.egg-info
📄
PySocks-1.5.7-py3.7.egg-info
(322 B)
📁
__pycache__
📁
_distutils_hack
📁
aiosignal
📁
aiosignal-1.2.0a0-py3.7.egg-info
📁
alembic
📁
alembic-0.8.3-py3.7.egg-info
📁
async_timeout
📁
async_timeout-4.0.2-py3.7.egg-info
📁
attr
📁
attrs-17.4.0-py3.7.egg-info
📁
babel
📁
beautifulsoup4-4.5.1-py3.7.egg-info
📁
bs4
📁
certifi
📁
certifi-2018.4.16-py3.7.egg-info
📁
chardet
📁
chardet-3.0.4-py3.7.egg-info
📁
charset_normalizer
📁
charset_normalizer-2.0.12-py3.7.egg-info
📁
cl_dom_collector
📄
cl_proc_hidepid.py
(4.44 KB)
📁
clcommon
📁
clconfig
📁
clconfigure
📄
clcontrollib.py
(51.88 KB)
📁
cldashboard
📄
cldetectlib.py
(18.31 KB)
📄
cldiaglib.py
(47.53 KB)
📁
clevents
📄
clhooklib.py
(1.4 KB)
📄
cli_utils.py
(1.73 KB)
📁
cllicense
📄
cllicenselib.py
(8.03 KB)
📁
cllimits
📁
cllimits_validator
📁
cllimitslib_v2
📁
clpackages
📁
clquota
📁
clselect
📁
clselector
📁
clsentry
📄
clsetuplib.py
(4.32 KB)
📄
clsudo.py
(14.7 KB)
📁
clsummary
📁
clveconfig
📁
clwizard
📁
clwpos
📄
cpanel.py
(28.99 KB)
📁
cssselect
📁
cssselect-0.9.2-py3.7.egg-info
📁
distlib
📄
distlib-0.3.4-py3.7.egg-info
(1.13 KB)
📄
distutils-precedence.pth
(152 B)
📁
docopt-0.6.2-py3.7.egg-info
📄
docopt.py
(19.48 KB)
📄
editor.py
(2.49 KB)
📄
editor.pyc
(3.6 KB)
📄
editor.pyo
(3.6 KB)
📁
filelock
📁
filelock-0.0.0-py3.7.egg-info
📁
future
📁
future-0.17.0-py3.7.egg-info
📁
html5lib
📁
html5lib-1.0.1-py3.7.egg-info
📁
idna
📁
idna-2.5-py3.7.egg-info
📁
importlib_metadata
📁
importlib_metadata-0.0.0-py3.7.egg-info
📁
jinja2
📁
jsonschema
📁
jsonschema-3.2.0-py3.7.egg-info
📁
jwt
📁
libfuturize
📁
libpasteurize
📄
lve_stats-2.0-py3.7.egg-info
(185 B)
📁
lve_utils
📄
lveapi.py
(19.24 KB)
📄
lvectllib.py
(92.33 KB)
📁
lvemanager
📄
lvestat.py
(6.94 KB)
📁
lvestats
📁
mako
📁
nose
📁
nose-1.3.7-py3.7.egg-info
📁
past
📁
pip
📁
pip-20.2.4.dist-info
📁
pkg_resources
📁
platformdirs
📁
platformdirs-0.0.0-py3.7.egg-info
📁
prettytable-0.7.2-py3.7.egg-info
📄
prettytable.py
(52.93 KB)
📁
pyparsing-2.1.10-py3.7.egg-info
📄
pyparsing.py
(224.48 KB)
📁
python_editor-0.4-py3.7.egg-info
📁
pytz
📁
pytz-2017.2-py3.7.egg-info
📁
raven
📁
raven-6.3.0-py3.7.egg-info
📄
remove_ubc.py
(5.54 KB)
📁
requests
📁
requests-2.26.0-py3.7.egg-info
📁
schema-0.7.1-py3.7.egg-info
📄
schema.py
(28.51 KB)
📄
secureio.py
(16.98 KB)
📁
sentry_sdk
📁
sentry_sdk-0.19.4-py3.7.egg-info
📁
setuptools
📁
setuptools-58.3.0.dist-info
📁
six-1.15.0-py3.7.egg-info
📄
six.py
(33.36 KB)
📄
socks.py
(29.25 KB)
📄
sockshandler.py
(2.84 KB)
📁
svgwrite
📁
svgwrite-1.3.0-py3.7.egg-info
📁
typing_extensions-3.7.4.3-py3.7.egg-info
📄
typing_extensions.py
(81.76 KB)
📁
urllib3
📁
urllib3-1.26.6-py3.7.egg-info
📁
vendors_api
📁
virtualenv
📁
virtualenv-20.13.0-py3.7.egg-info
📁
webencodings
📁
webencodings-0.5.1-py3.7.egg-info
📁
wmt
📁
zipp-0.0.0-py3.7.egg-info
📄
zipp.py
(8.23 KB)
Editing: clsetuplib.py
# -*- coding: utf-8 -*- # CLSETUP python lib # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT # Classes: # # Kernel # check min kernel for securelinks # Setup: # # setup apache gid for securelinks # setup nagios from __future__ import print_function from __future__ import absolute_import import sys, subprocess, os, grp, pwd import cldetectlib from cl_proc_hidepid import remount_proc from clcommon.sysctl import SysCtlConf, SYSCTL_CL_CONF_FILE # Kernel Version Class class KernelVersion: _SECURELINKS_MIN_KERNEL = ['1','1','95'] _system_kernel = '' _cl_kernel = True def __init__(self): p = subprocess.Popen(['uname', '-r'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() if (p.returncode != 0): print('error: subprocess call error. Cant\'t get current kernel version') sys.exit(1) if (out.find('lve') != -1): self._system_kernel = out.split('lve')[1].split('el')[0][:-1].strip().split('.') print(self._system_kernel) else: self._cl_kernel = False # Check if system kernel newer then securelinks min kernel def securelinks_kernel_requirement(self): if self._cl_kernel: if (self._system_kernel >= self._SECURELINKS_MIN_KERNEL) and os.path.isfile('/proc/sys/fs/symlinkown_gid'): return True else: return False else: print('error: Feature is not supported on non CL kernel.') sys.exit(1) # return _SECURELINKS_MIN_KERNEL def get_securelinks_min_kernel(self): return 'lve' + '.'.join(self._SECURELINKS_MIN_KERNEL) sysctl = SysCtlConf(config_file=SYSCTL_CL_CONF_FILE) def set_securelinks_gid(apache_gid): """ Change /etc/sysctl.conf for apache gid :param apache_gid: id of apache's group :return: None """ symlink_command = 'fs.symlinkown_gid' sysctl.set(symlink_command, apache_gid) def _add_to_super_gid(user): """ Add user to the group specified by fs.proc_super_gid. If fs.proc_super_gid is 0 (means undefined) or group doesn't really exists then create "clsupergid" group, configure it as fs.proc_super_gid and add user to this group """ sgid_key = 'fs.proc_super_gid' try: # sysctl.get may return empty string in some cases like cldeploy # when CL kernel is not loaded yet and proc has no such param proc_super_gid = int(sysctl.get(sgid_key)) except ValueError: proc_super_gid = 0 try: # Check that group with this gid really exists, and if not, then reset # it to undefined so it will be replaced with clsupergid below grp.getgrgid(proc_super_gid).gr_name except KeyError: proc_super_gid = 0 if proc_super_gid == 0: # Create and configure group if it was undefined sgid_name = 'clsupergid' subprocess.run('groupadd -f ' + sgid_name, shell=True, executable='/bin/bash') proc_super_gid = grp.getgrnam(sgid_name).gr_gid sysctl.set(sgid_key, proc_super_gid) # If user already in this group or it's primary group == proc_super_gid # this will do nothing subprocess.run('usermod -a -G {} {}'.format(proc_super_gid, user), shell=True, executable='/bin/bash') def setup_nagios(do_remount_proc=True): """ Add nagios to configured fs.proc_super_gid group """ if not cldetectlib.get_nagios(): return # Nothing to do _add_to_super_gid('nagios') # CAG-796: use hidepid=2 when mounting /proc if do_remount_proc: remount_proc() def setup_mailman(): """ Detect "mailman" and add it to fs.proc_super_gid group """ if not os.path.isdir('/usr/local/cpanel/3rdparty/mailman'): return try: pwd.getpwnam('mailman') except KeyError: return _add_to_super_gid('mailman') def setup_supergids(): """ Configure "special" users to be in fs.proc_super_gid group, if it's necessary. If this GID was undefined(0) then create and setup special clsupergid group """ setup_nagios(do_remount_proc=False) setup_mailman() # CAG-796: use hidepid=2 when mounting /proc remount_proc()
Upload File
Create Folder