首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >打开VAS -服务暂时关闭(证书过期)

打开VAS -服务暂时关闭(证书过期)
EN

Stack Overflow用户
提问于 2016-12-05 20:41:57
回答 1查看 11.4K关注 0票数 3

所以我的证书在我的Open VAS安装中过期了。正因为如此,当我尝试运行扫描时,我得到了以下错误。

操作:开始任务状态代码: 503状态消息:服务暂时关闭

我已尝试重新创建证书:

代码语言:javascript
复制
me@ovas:~$ sudo /usr/sbin/openvas-mkcert -q -f
[sudo] password for me:


me@ovas:~$ sudo /usr/bin/openvas-mkcert-client -n -i
Generating RSA private key, 4096 bit long modulus
........................++
..................................................................................++
e is 65537 (0x10001)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [DE]:State or Province Name (full name) [Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) [Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) []:Common Name (eg, your name or your server's hostname) []:Email Address []:Using configuration from /tmp/openvas-mkcert-client.28853/stdC.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'DE'
localityName          :ASN.1 12:'Berlin'
commonName            :ASN.1 12:'om'
Certificate is to be certified until Dec  5 12:38:09 2017 GMT (365 days)

Write out database with 1 new entries
Data Base Updated
me@ovas:~$

然后重启..。

然后web界面的一个被正确地切换出来了,但是扫描仪的那个似乎不是?

这是日志中的内容:

lib服务器:警告:2016-12-05 12h41.23 UTC:1533:无法与对等设备握手: TLS连接未正确终止。事件task:MESSAGE:2016-12-05 12h41.23 UTC:1533:管理员无法启动target.me (3aca3163-3de2-4519-92af-f649f6bedd7c)的任务扫描

选中打开VAS脚本输出:

代码语言:javascript
复制
openvas-check-setup 2.3.7
  Test completeness and readiness of OpenVAS-8
  (add '--v6' or '--v7' or '--v9'
   if you want to check for another OpenVAS version)

  Please report us any non-detected problems and
  help us to improve this check routine:
  http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss

  Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.

  Use the parameter --server to skip checks for client tools
  like GSD and OpenVAS-CLI.

Step 1: Checking OpenVAS Scanner ...
        OK: OpenVAS Scanner is present in version 5.0.7.
        OK: OpenVAS Scanner CA Certificate is present as /var/lib/openvas/CA/cacert.pem.
        OK: redis-server is present in version v=3.0.6.
        OK: scanner (kb_location setting) is configured properly using the redis-server socket: /var/run/redis/redis.sock
        OK: redis-server is running and listening on socket: /var/run/redis/redis.sock.
        OK: redis-server configuration is OK and redis-server is running.
        OK: NVT collection in /var/lib/openvas/plugins contains 50525 NVTs.
        WARNING: Signature checking of NVTs is not enabled in OpenVAS Scanner.
        SUGGEST: Enable signature checking (see http://www.openvas.org/trusted-nvts.html).
        OK: The NVT cache in /var/cache/openvas contains 50548 files for 50525 NVTs.
Step 2: Checking OpenVAS Manager ...
        OK: OpenVAS Manager is present in version 6.0.9.
        OK: OpenVAS Manager client certificate is present as /var/lib/openvas/CA/clientcert.pem.
        OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db.
        OK: Access rights for the OpenVAS Manager database are correct.
        OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled.
        OK: OpenVAS Manager database is at revision 146.
        OK: OpenVAS Manager expects database at revision 146.
        OK: Database schema is up to date.
        OK: OpenVAS Manager database contains information about 49328 NVTs.
        OK: At least one user exists.
        OK: OpenVAS SCAP database found in /var/lib/openvas/scap-data/scap.db.
        OK: OpenVAS CERT database found in /var/lib/openvas/cert-data/cert.db.
        OK: xsltproc found.
Step 3: Checking user configuration ...
        WARNING: Your password policy is empty.
        SUGGEST: Edit the /etc/openvas/pwpolicy.conf file to set a password policy.
Step 4: Checking Greenbone Security Assistant (GSA) ...
        OK: Greenbone Security Assistant is present in version 6.0.11.
Step 5: Checking OpenVAS CLI ...
        OK: OpenVAS CLI version 1.4.4.
Step 6: Checking Greenbone Security Desktop (GSD) ...
        SKIP: Skipping check for Greenbone Security Desktop.
Step 7: Checking if OpenVAS services are up and running ...
        OK: netstat found, extended checks of the OpenVAS services enabled.
        OK: OpenVAS Scanner is running and listening on all interfaces.
        OK: OpenVAS Scanner is listening on port 9391, which is the default port.
        OK: OpenVAS Manager is running and listening on all interfaces.
        OK: OpenVAS Manager is listening on port 9390, which is the default port.
        OK: Greenbone Security Assistant is running and listening on all interfaces.
        OK: Greenbone Security Assistant is listening on port 443, which is the default port.
Step 8: Checking nmap installation ...
        WARNING: Your version of nmap is not fully supported: 7.01
        SUGGEST: You should install nmap 5.51 if you plan to use the nmap NSE NVTs.
Step 10: Checking presence of optional tools ...
        OK: pdflatex found.
        WARNING: PDF generation failed, most likely due to missing LaTeX packages. The PDF report format will not work.
        SUGGEST: Install required LaTeX packages.
        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work.
        OK: rpm found, LSC credential package generation for RPM based targets is likely to work.
        OK: alien found, LSC credential package generation for DEB based targets is likely to work.
        OK: nsis found, LSC credential package generation for Microsoft Windows targets is likely to work.

It seems like your OpenVAS-8 installation is OK.

If you think it is not OK, please report your observation
and help us to improve this check routine:
http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss
Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-18 08:11:47

这个答案对于OP来说可能有点晚了,但以防未来的Googlers用户最终来到这里,以下是对我有效的方法:

我还得出结论,当我的OpenVAS扫描突然停止运行时,过期的证书是问题所在。使用openvas-check-setup命令告诉我一切正常,但当我尝试手动运行扫描时,我会得到相同的503服务不可用消息。查看日志(location for me: /var/log/openvas/openvasmd.log)给了我一些线索,包括:

警告:2017-05-16 19h04.51utc:3687: Failed to gnutls_bye:推流功能错误。警告:2017-05-16 19h04.52utc:3686: openvas_server_verify:证书不可信警告:2017-05-16 19h04.52utc:3686: openvas_server_verify:证书已过期

我从解决gnutls_bye消息开始,因为错误这个词往往比警告引起更多的注意,但最终证书才是问题所在。

我使用了OP的mkcert命令的一个变体来生成新证书,但我认为s/he缺少的一步是使用这些新证书更新扫描仪配置。

因此,我导航到更靠近cert文件位置(cd /var/lib/openvas/)并运行以下命令:

代码语言:javascript
复制
openvasmd --modify-scanner <UUID> --scanner-ca-pub CA/cacert.pem --scanner-key-pub CA/clientcert.pem --scanner-key-priv private/CA/clientkey.pem 

您需要替换为正在修改的扫描仪的实际UUID。要获取扫描仪列表,请执行以下操作:

代码语言:javascript
复制
openvasmd --get-scanners

作为最后的检查,您可以使用verify命令:

代码语言:javascript
复制
openvasmd --verify-scanner <UUID>

当它坏了的时候,我得到了一个非常无用的响应

无法验证扫描仪。

但是,一旦您成功地更新了证书并将其与您的扫描仪相关联(并且您可能需要重新启动相关的服务,或者像我一样使用惰性/核心方法并重新启动服务器),那么验证命令应该返回类似以下内容的内容

扫描器版本: OTP/2.0.

或者您正在运行的任何类型/版本。

如果你在这里搜索“更新扫描仪证书”,那么修改扫描仪的步骤就隐藏在OpenVAS文档中了:http://www.openvas.org/src-doc/openvas-manager/index.html

希望这对某些人有帮助!

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40974546

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档