/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
/opt/cloudlinux/venv/lib/python3.11/site-packages
mkdir
upload
Name
Size
Mode
Actions
aiohttp/
-
0755
rm
aiohttp-3.9.2.dist-info/
-
0755
rm
aiohttp_jinja2/
-
0755
rm
aiohttp_jinja2-1.5.dist-info/
-
0755
rm
aiohttp_security/
-
0755
rm
aiohttp_security-0.4.0.dist-info/
-
0755
rm
aiohttp_session/
-
0755
rm
aiohttp_session-2.9.0.dist-info/
-
0755
rm
aiosignal/
-
0755
rm
aiosignal-1.3.1.dist-info/
-
0755
rm
alembic/
-
0755
rm
alembic-1.11.1.dist-info/
-
0755
rm
astroid/
-
0755
rm
astroid-2.15.6.dist-info/
-
0755
rm
attr/
-
0755
rm
attrs/
-
0755
rm
attrs-23.1.0.dist-info/
-
0755
rm
backports/
-
0755
rm
certifi/
-
0755
rm
certifi-2023.7.22.dist-info/
-
0755
rm
cffi/
-
0755
rm
cffi-1.15.1.dist-info/
-
0755
rm
chardet/
-
0755
rm
chardet-5.2.0.dist-info/
-
0755
rm
charset_normalizer/
-
0755
rm
charset_normalizer-2.1.1.dist-info/
-
0755
rm
clcagefslib/
-
0755
rm
clcommon/
-
0755
rm
clconfig/
-
0755
rm
clconfigure/
-
0755
rm
cldashboard/
-
0755
rm
clevents/
-
0755
rm
clflags/
-
0755
rm
cllicense/
-
0755
rm
cllimits/
-
0755
rm
cllimitslib_v2/
-
0755
rm
cllimits_validator/
-
0755
rm
cllvectl/
-
0755
rm
clpackages/
-
0755
rm
clquota/
-
0755
rm
clselect/
-
0755
rm
clselector/
-
0755
rm
clsentry/
-
0755
rm
clsummary/
-
0755
rm
clveconfig/
-
0755
rm
clwizard/
-
0755
rm
clwpos/
-
0755
rm
cl_dom_collector/
-
0755
rm
cl_website_collector/
-
0755
rm
configparser-5.0.2.dist-info/
-
0755
rm
contextlib2/
-
0755
rm
contextlib2-21.6.0.dist-info/
-
0755
rm
coverage/
-
0755
rm
coverage-7.2.7.dist-info/
-
0755
rm
cryptography/
-
0755
rm
cryptography-41.0.2.dist-info/
-
0755
rm
ddt-1.4.4.dist-info/
-
0755
rm
dill/
-
0755
rm
dill-0.3.7.dist-info/
-
0755
rm
distlib/
-
0755
rm
distlib-0.3.8.dist-info/
-
0755
rm
docopt-0.6.2.dist-info/
-
0755
rm
dodgy/
-
0755
rm
dodgy-0.2.1.dist-info/
-
0755
rm
filelock/
-
0755
rm
filelock-3.13.1.dist-info/
-
0755
rm
flake8/
-
0755
rm
flake8-5.0.4.dist-info/
-
0755
rm
flake8_polyfill/
-
0755
rm
flake8_polyfill-1.0.2.dist-info/
-
0755
rm
frozenlist/
-
0755
rm
frozenlist-1.4.0.dist-info/
-
0755
rm
future/
-
0755
rm
future-0.18.3.dist-info/
-
0755
rm
git/
-
0755
rm
gitdb/
-
0755
rm
gitdb-4.0.10.dist-info/
-
0755
rm
GitPython-3.1.32.dist-info/
-
0755
rm
guppy/
-
0755
rm
guppy3-3.1.3.dist-info/
-
0755
rm
idna/
-
0755
rm
idna-3.4.dist-info/
-
0755
rm
iniconfig/
-
0755
rm
iniconfig-2.0.0.dist-info/
-
0755
rm
isort/
-
0755
rm
isort-5.12.0.dist-info/
-
0755
rm
jinja2/
-
0755
rm
Jinja2-3.0.3.dist-info/
-
0755
rm
jsonschema/
-
0755
rm
jsonschema-3.2.0.dist-info/
-
0755
rm
jwt/
-
0755
rm
lazy_object_proxy/
-
0755
rm
lazy_object_proxy-1.9.0.dist-info/
-
0755
rm
libfuturize/
-
0755
rm
libpasteurize/
-
0755
rm
lvemanager/
-
0755
rm
lvestats/
-
0755
rm
lve_stats-2.0.dist-info/
-
0755
rm
lve_utils/
-
0755
rm
lxml/
-
0755
rm
lxml-4.9.2.dist-info/
-
0755
rm
mako/
-
0755
rm
Mako-1.2.4.dist-info/
-
0755
rm
markupsafe/
-
0755
rm
MarkupSafe-2.1.3.dist-info/
-
0755
rm
mccabe-0.7.0.dist-info/
-
0755
rm
mock/
-
0755
rm
mock-5.1.0.dist-info/
-
0755
rm
multidict/
-
0755
rm
multidict-6.0.4.dist-info/
-
0755
rm
numpy/
-
0755
rm
numpy-1.25.1.dist-info/
-
0755
rm
numpy.libs/
-
0755
rm
packaging/
-
0755
rm
packaging-23.1.dist-info/
-
0755
rm
past/
-
0755
rm
pep8_naming-0.10.0.dist-info/
-
0755
rm
pip/
-
0755
rm
pip-24.3.1.dist-info/
-
0755
rm
pkg_resources/
-
0755
rm
platformdirs/
-
0755
rm
platformdirs-3.11.0.dist-info/
-
0755
rm
pluggy/
-
0755
rm
pluggy-1.2.0.dist-info/
-
0755
rm
prettytable/
-
0755
rm
prettytable-3.8.0.dist-info/
-
0755
rm
prometheus_client/
-
0755
rm
prometheus_client-0.8.0.dist-info/
-
0755
rm
prospector/
-
0755
rm
prospector-1.10.2.dist-info/
-
0755
rm
psutil/
-
0755
rm
psutil-5.9.5.dist-info/
-
0755
rm
psycopg2/
-
0755
rm
psycopg2_binary-2.9.6.dist-info/
-
0755
rm
psycopg2_binary.libs/
-
0755
rm
pycodestyle-2.9.1.dist-info/
-
0755
rm
pycparser/
-
0755
rm
pycparser-2.21.dist-info/
-
0755
rm
pydocstyle/
-
0755
rm
pydocstyle-6.3.0.dist-info/
-
0755
rm
pyfakefs/
-
0755
rm
pyfakefs-5.10.2.dist-info/
-
0755
rm
pyflakes/
-
0755
rm
pyflakes-2.5.0.dist-info/
-
0755
rm
PyJWT-2.8.0.dist-info/
-
0755
rm
pylint/
-
0755
rm
pylint-2.17.4.dist-info/
-
0755
rm
pylint_celery/
-
0755
rm
pylint_celery-0.3.dist-info/
-
0755
rm
pylint_django/
-
0755
rm
pylint_django-2.5.3.dist-info/
-
0755
rm
pylint_flask/
-
0755
rm
pylint_flask-0.6.dist-info/
-
0755
rm
pylint_plugin_utils/
-
0755
rm
pylint_plugin_utils-0.7.dist-info/
-
0755
rm
pylve-2.1-py3.11.egg-info/
-
0755
rm
pymysql/
-
0755
rm
PyMySQL-1.1.0.dist-info/
-
0755
rm
pyparsing/
-
0755
rm
pyparsing-3.0.9.dist-info/
-
0755
rm
pyrsistent/
-
0755
rm
pyrsistent-0.19.3.dist-info/
-
0755
rm
pytest/
-
0755
rm
pytest-7.4.0.dist-info/
-
0755
rm
pytest_check/
-
0755
rm
pytest_check-2.5.3.dist-info/
-
0755
rm
pytest_snapshot/
-
0755
rm
pytest_snapshot-0.9.0.dist-info/
-
0755
rm
pytest_subprocess/
-
0755
rm
pytest_subprocess-1.5.3.dist-info/
-
0755
rm
pytest_tap/
-
0755
rm
pytest_tap-3.5.dist-info/
-
0755
rm
python_pam-1.8.4.dist-info/
-
0755
rm
pyvirtualdisplay/
-
0755
rm
PyVirtualDisplay-3.0.dist-info/
-
0755
rm
PyYAML-6.0.1.dist-info/
-
0755
rm
raven/
-
0755
rm
raven-6.10.0.dist-info/
-
0755
rm
requests/
-
0755
rm
requests-2.31.0.dist-info/
-
0755
rm
requirements_detector/
-
0755
rm
requirements_detector-1.2.2.dist-info/
-
0755
rm
schema-0.7.5.dist-info/
-
0755
rm
semver/
-
0755
rm
semver-3.0.1.dist-info/
-
0755
rm
sentry_sdk/
-
0755
rm
sentry_sdk-1.29.2.dist-info/
-
0755
rm
setoptconf/
-
0755
rm
setoptconf_tmp-0.3.1.dist-info/
-
0755
rm
setuptools/
-
0755
rm
setuptools-81.0.0.dist-info/
-
0755
rm
simplejson/
-
0755
rm
simplejson-3.19.1.dist-info/
-
0755
rm
six-1.16.0.dist-info/
-
0755
rm
smmap/
-
0755
rm
smmap-5.0.0.dist-info/
-
0755
rm
snowballstemmer/
-
0755
rm
snowballstemmer-2.2.0.dist-info/
-
0755
rm
sqlalchemy/
-
0755
rm
sqlalchemy-1.3.24.dist-info/
-
0755
rm
ssa/
-
0755
rm
svgwrite/
-
0755
rm
svgwrite-1.4.3.dist-info/
-
0755
rm
tap/
-
0755
rm
tap_py-3.2.1.dist-info/
-
0755
rm
testfixtures/
-
0755
rm
testfixtures-7.1.0.dist-info/
-
0755
rm
toml/
-
0755
rm
toml-0.10.2.dist-info/
-
0755
rm
tomlkit/
-
0755
rm
tomlkit-0.11.8.dist-info/
-
0755
rm
typing_extensions-4.7.1.dist-info/
-
0755
rm
unshare-0.22.dist-info/
-
0755
rm
urllib3/
-
0755
rm
urllib3-2.0.4.dist-info/
-
0755
rm
vendors_api/
-
0755
rm
virtualenv/
-
0755
rm
virtualenv-20.21.1.dist-info/
-
0755
rm
wcwidth/
-
0755
rm
wcwidth-0.2.6.dist-info/
-
0755
rm
websiteisolation/
-
0755
rm
wmt/
-
0755
rm
wrapt/
-
0755
rm
wrapt-1.15.0.dist-info/
-
0755
rm
xray/
-
0755
rm
yaml/
-
0755
rm
yarl/
-
0755
rm
yarl-1.9.2.dist-info/
-
0755
rm
_distutils_hack/
-
0755
rm
_pytest/
-
0755
rm
_yaml/
-
0755
rm
__pycache__/
-
0755
rm
clcontrollib.py
53042
0644
edit
dl
rm
cldetectlib.py
18843
0644
edit
dl
rm
cldiaglib.py
49660
0644
edit
dl
rm
clhooklib.py
1296
0644
edit
dl
rm
cli_utils.py
1698
0644
edit
dl
rm
cllicenselib.py
11864
0644
edit
dl
rm
clsetuplib.py
5193
0644
edit
dl
rm
clsudo.py
23586
0644
edit
dl
rm
cl_proc_hidepid.py
4638
0644
edit
dl
rm
configparser.py
1546
0644
edit
dl
rm
ddt.py
12733
0644
edit
dl
rm
distutils-precedence.pth
151
0644
edit
dl
rm
docopt.py
19946
0644
edit
dl
rm
lveapi.py
23294
0644
edit
dl
rm
lvectllib.py
136479
0644
edit
dl
rm
lvestat.py
6997
0644
edit
dl
rm
mccabe.py
10654
0644
edit
dl
rm
pam.py
7556
0644
edit
dl
rm
pep8ext_naming.py
19052
0644
edit
dl
rm
py.py
263
0644
edit
dl
rm
pycodestyle.py
103501
0644
edit
dl
rm
pylve.cpython-311-x86_64-linux-gnu.so
29528
0755
edit
dl
rm
remove_ubc.py
5864
0755
edit
dl
rm
schema.py
30221
0644
edit
dl
rm
secureio.py
20037
0644
edit
dl
rm
simple_rpm.so
15544
0755
edit
dl
rm
six.py
34549
0644
edit
dl
rm
typing_extensions.py
111082
0644
edit
dl
rm
unshare.cpython-311-x86_64-linux-gnu.so
16704
0755
edit
dl
rm
_cffi_backend.cpython-311-x86_64-linux-gnu.so
274048
0755
edit
dl
rm
_lvdmap.cpython-311-x86_64-linux-gnu.so
18800
0755
edit
dl
rm
_pyrsistent_version.py
23
0644
edit
dl
rm
Edit:
/opt/cloudlinux/venv/lib/python3.11/site-packages/clsetuplib.py
(5193B)
# -*- 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 import grp import os import pwd import subprocess import sys import cldetectlib from cl_proc_hidepid import remount_proc from clcommon.sysctl import SYSCTL_CL_CONF_FILE, SysCtlConf # Kernel Version Class class KernelVersion: _SECURELINKS_MIN_KERNEL = ['1','1','95'] _system_kernel = '' _cl_kernel = True def __init__(self): with subprocess.Popen( ['/usr/bin/uname', '-r'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) as proc: out, _ = proc.communicate() if proc.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: return ( self._system_kernel >= self._SECURELINKS_MIN_KERNEL and os.path.isfile('/proc/sys/fs/symlinkown_gid') ) 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 CLOS-4594/F-54: this creates-or-reuses the proc-super group, whose members get the hidepid /proc bypass. lve-utils cannot validate the group's members here (clsupergid is intentionally populated with regular-uid panel admins, which are indistinguishable from tenants by uid alone). Membership integrity -- evicting any tenant that slipped into a reused pre-existing group -- is owned by lvemanager, which knows the authoritative cpapi admin/user sets: see cpanel-lvemanager commons/lib/lvemanager/sudoers.py::_remove_tenants_from_group. NOTE: that eviction runs only on hosts lvemanager manages; on an lve-utils-only host it does not run, so a pre-existing externally-populated group is not reconciled (pre-seeding it requires root). """ 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(['/usr/sbin/groupadd', '-f', sgid_name], check=False) 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(['/usr/sbin/usermod', '-a', '-G', str(proc_super_gid), user], check=False) 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()
Save
cmd:
run