AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 821929
Accepted
Thorin
Thorin
Asked: 2016-12-21 17:19:28 +0800 CST2016-12-21 17:19:28 +0800 CST 2016-12-21 17:19:28 +0800 CST

CentOS7 Redis 上的 OpenVAS 无法启动

  • 772

我正在尝试按照下面的文章让 OpenVAS 正常工作。

https://www.atlantic.net/community/howto/install-openvas-vulnerability-scanner-centos-7

但是它不起作用,当我运行 openvas-check-setup 时,我在下面收到此错误,当我检查 /var/log/redis/redis.log 时,它显示“正在打开 Unix 套接字:绑定:权限被拒绝”

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.7.
        OK: scanner (kb_location setting) is configured properly using the redis-server socket: /tmp/redis.sock
        ERROR: redis-server is not running or not listening on socket: /tmp/redis.sock
        FIX: You should start the redis-server or configure it to listen on socket: /tmp/redis.sock

 ERROR: Your OpenVAS-8 installation is not yet complete!
centos redis openvas
  • 2 2 个回答
  • 10933 Views

2 个回答

  • Voted
  1. Best Answer
    Michael Hampton
    2016-12-21T18:12:55+08:002016-12-21T18:12:55+08:00

    恭喜,您找到了一个糟糕的 Internet 教程。该教程的作者似乎从未亲自测试过它是否有效,因为它不能按原样工作。更糟糕的是,该教程似乎实际上是从官方 OpenVAS 网站链接到的,这会误导和挫败很多人。

    因此,redis 无法启动的原因是 SELinux 拒绝 redis-server 写入/tmp. 您可以在审核日志中看到这一点:

    type=AVC msg=audit(1482284806.464:112): avc:  denied  { write } for  pid=1275 comm="redis-server" name="tmp" dev="dm-0" ino=33574981 scontext=system_u:system_r:redis_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir
    type=SYSCALL msg=audit(1482284806.464:112): arch=c000003e syscall=49 success=no exit=-13 a0=5 a1=7ffe55938670 a2=6e a3=7ffe55938614 items=0 ppid=1 pid=1275 auid=4294967295 uid=997 gid=995 euid=997 suid=997 fsuid=997 egid=995 sgid=995 fsgid=995 tty=(none) ses=4294967295 comm="redis-server" exe="/usr/bin/redis-server" subj=system_u:system_r:redis_t:s0 key=(null)
    

    而不是/tmp,套接字文件应该位于/run/redis,例如:

    unixsocket /run/redis/redis.sock
    

    这允许它在 SELinux 强加的约束内运行。

    编辑/etc/redis.conf时,请务必检查文件底部是否有第二个 unixsocket指令添加openvas-setup并删除它作为多余的。

    当然,通常在启用 SELinux 的系统上,应将 redis 配置为侦听 localhost 上的 TCP 端口,而不是使用套接字,因为其他守护进程可能不允许通过套接字与 redis 通信,而只能通过 TCP。这不是一个真正的问题,因为 OpenVAS 不是(还)受 SELinux 限制的,但它也不支持通过 TCP 联系 redis。这样做的结果是,除了 OpenVAS 的本地副本之外,此 redis 安装无法与任何其他服务共享或重用。


    但是本教程的错误不止于此!

    第二件事是,OpenVAS 没有任何地方被配置为实际使用 redis。它依赖于默认编译,正如我们所见,这是错误的。要解决此问题,需要在 中设置配置指令/etc/openvas/openvassd.conf,本教程从未提及:

    kb_location = /run/redis/redis.sock
    

    第三件事是它使用了一个名为 atomic 的第三方repo,它提供的包与普通 repos 中的包冲突,例如 EPEL - 它已经提供了 redis 和 OpenVAS!不清楚为什么 atomic 会这样做,也不清楚为什么本教程使用 atomic 开始。使用包含冲突包的存储库具有潜在危险。如果您继续使用原子包,您将需要绝对确定这台(虚拟)机器不会出于任何原因用于其他任何用途。

    最后,一旦你安装了它,Web 界面实际上是不可访问的,因为指定的端口没有在防火墙中打开。你也必须自己做。

    firewall-cmd --add-port=9392/tcp    # though this opens it to the world
    firewall-cmd --runtime-to-permanent
    

    一旦你完成了,openvas-check-setup应该说,除其他外......

            OK: scanner (kb_location setting) is configured properly using the redis-server socket: /run/redis/redis.sock
            OK: redis-server is running and listening on socket: /run/redis/redis.sock.
            OK: redis-server configuration is OK and redis-server is running.
    

    具有讽刺意味的是,它还会说:

            ERROR: SELinux is enabled. For a working OpenVAS installation you need to disable it.
            FIX: Please disable SELinux.
    

    这似乎是完全免费和不必要的,因为 OpenVAS 并不受 SELinux 的限制。

    • 5
  2. Waqas Khan
    2018-01-02T21:31:14+08:002018-01-02T21:31:14+08:00

    我遇到了同样的问题。问题是在 Kali Linux OpenVas 上默认没有文件:/etc/openvas/openvassd.conf。

    所以我创建了这个文件并在下面输入了内容来覆盖 Redis 服务器的默认值。kb_location=/var/run/redis/redis.sock

    这解决了我的问题。我在这个网站上写了完整的教程: https ://waqasahmedkhan.com/openvas-bug-in-kali-linux-2017-3-5/

    • 2

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve