constrain dir { open search } ( u1 == u2 or u1 == system_u or u1 == unconfined_u or t1 == nfs_security_domain_type or t2 != user_home_target or ( u1 == user_u and u2 == system_u ) );
constrain dir_file_class_set { create relabelto relabelfrom } ( u1 == u2 or t1 == can_change_object_identity or (t1 == user_t and t2 == user_home_dir_t) or (t1 == secadm_t and t2 == secadm_home_dir_t) or (t1 == sysadm_t and t2 == sysadm_home_dir_t) or (t1 == auditadm_t and t2 == auditadm_home_dir_t) );
constrain file { execute_no_trans } ( u1 == u2 or t1 == nfs_security_t or t1 == useradd_t or t2 != nfs_security_exec_file_type );
constrain file { read } ( u1 == u2 or u1 == system_u or u1 == unconfined_u or t2 != nfs_security_file_type or (t1 != sysadm_t and t1 != auditadm_t and t1 != user_t and t2 == security_t) or (t2 == var_log_t) or (t2 == etc_t) );
constrain file { write } ( u1 == u2 or u1 == system_u or u1 == unconfined_u or t2 != nfs_security_file_type or (t1 != sysadm_t and t1 != auditadm_t and t1 != user_t and t2 == security_t) or (t1 != secadm_t and t1 != auditadm_t and t1 != user_t and t2 == var_log_t) or ( t1 != user_t and t2 == etc_t) );
constrain process { sigkill signal } ( t2 != auditd_t );
<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <type>system</type>
<listen>unix:tmpdir=/tmp</listen>
<standard_system_servicedirs />
<policy context="default"> <!-- Allow everything to be sent --> <allow send_destination="*" eavesdrop="true"/> <!-- Allow everything to be received --> <allow eavesdrop="true"/> <!-- Allow anyone to own anything --> <allow own="*"/> <allow user="*"/> </policy>
</busconfig>
此文件中几个关键的配置说明:
system dbus 服务的bus类型,分为system和session,我们要垮用戶通信,就需要用 system总线 unix:tmpdir=/tmp 设置监听地址
<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <type>system</type>
<listen>unix:tmpdir=/tmp</listen>
<standard_system_servicedirs />
<policy context="default"> <!-- Allow everything to be sent --> <allow send_destination="*" eavesdrop="true"/> <!-- Allow everything to be received --> <allow eavesdrop="true"/> <!-- Allow anyone to own anything --> <allow own="*"/> <allow user="*"/> </policy>
</busconfig>
先将这个文件放到 /etc/dbus-1/system.d/ 下,几个关键的配置说明
system dbus 服务的bus类型,分为system和session,我们要垮用户通信,就需要用system总线
┌──(root💀kali)-[/home/kali] └─# gvmd --version 127 ⨯ Greenbone Vulnerability Manager 21.4.4 Manager DB revision 242 Copyright (C) 2009-2021 Greenbone Networks GmbH License: AGPL-3.0-or-later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
┌──(root💀kali)-[/home/kali] └─# pg_lsclusters Ver Cluster Port Status Owner Data directory Log file 13 main 5432 down postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log 14 main 5433 down postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
删除13版本的PostgreSQL
1 2
┌──(root💀kali)-[/home/kali] └─# pg_dropcluster --stop 13 main
将14设置为主要版本
1 2
┌──(root💀kali)-[/home/kali] └─# pg_upgradecluster 14 main
┌──(root💀kali)-[/home/kali/init_gvm] └─# gvm-check-setup gvm-check-setup 21.4.3 Test completeness and readiness of GVM-21.4.3 Step 1: Checking OpenVAS (Scanner)... OK: OpenVAS Scanner is present in version 21.4.3. OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem. Checking permissions of /var/lib/openvas/gnupg/* OK: _gvm owns all files in /var/lib/openvas/gnupg OK: redis-server is present. OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock OK: redis-server is running and listening on socket: /var/run/redis-openvas/redis-server.sock. OK: redis-server configuration is OK and redis-server is running. OK: _gvm owns all files in /var/lib/openvas/plugins OK: NVT collection in /var/lib/openvas/plugins contains 77525 NVTs. Checking that the obsolete redis database has been removed OK: No old Redis DB OK: ospd-OpenVAS is present in version 21.4.3. Step 2: Checking GVMD Manager ... OK: GVM Manager (gvmd) is present in version 21.4.4. Step 3: Checking Certificates ... OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem. OK: Your GVM certificate infrastructure passed validation. Step 4: Checking data ... OK: SCAP data found in /var/lib/gvm/scap-data. OK: CERT data found in /var/lib/gvm/cert-data. Step 5: Checking Postgresql DB and user ... OK: Postgresql version and default port are OK. gvmd | _gvm | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | OK: At least one user exists. Step 6: Checking Greenbone Security Assistant (GSA) ... Oops, secure memory pool already initialized OK: Greenbone Security Assistant is present in version 21.4.3. Step 7: Checking if GVM services are up and running ... Starting ospd-openvas service Waiting for ospd-openvas service OK: ospd-openvas service is active. Starting gvmd service Waiting for gvmd service OK: gvmd service is active. Starting greenbone-security-assistant service Waiting for greenbone-security-assistant service OK: greenbone-security-assistant service is active. Step 8: Checking few other requirements... OK: nmap is present in version 21.4.3. OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work. WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work. SUGGEST: Install nsis. OK: xsltproc found. WARNING: Your password policy is empty. SUGGEST: Edit the /etc/gvm/pwpolicy.conf file to set a password policy.
┌──(root💀kali)-[/home/kali/init_gvm] └─# gvm-stop ┌──(root💀kali)-[/home/kali/init_gvm] └─# gvm-start 3 ⨯ [>] Please wait for the GVM services to start. [>] [>] You might need to refresh your browser once it opens. [>] [>] Web UI (Greenbone Security Assistant): https://127.0.0.1:9392
11月 30 18:30:39 kali systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)... 11月 30 18:30:39 kali systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).