首页 > 解决方案 > AWS EC2 RHEL 7 auditd 服务正在运行但无法连接到远程服务器

问题描述

我有 3 个 RHEL-7 EC2 实例。所有人都可以使用私有IP相互连接。一个客户端和服务器在同一子网中,另一个客户端来自不同的 VPC,但可以通过 VPC 对等连接与其他两个实例连接。rsyslog 正在服务器上运行,客户端正在通过端口 514 向服务器实例发送日志(/var/log/messages 和 /var/log/secure)。为了简单起见,firewalld/iptables 已停止,selinux 已允许/禁用.

我已经在客户端上配置了 auditd,服务处于活动状态(正在运行),但审计日志没有传输到服务器。以下是客户端“systemctl status auditd”的详细信息:

[root@ip-10-0-3-159 ~]# systemctl status auditd ● auditd.service - 安全审计服务已加载:已加载(/usr/lib/systemd/system/auditd.service;已启用;供应商预设:已启用)活跃:自 2018 年 7 月 11 日星期三 19:42:48 UTC 起活跃(运行);38 秒前 文档:man:auditd(8) https://github.com/linux-audit/audit-documentation 流程:386 ExecStartPost=/sbin/augenrules --load (code=exited, status=0/SUCCESS) 流程: 375 ExecStart=/sbin/auditd (code=exited, status=0/SUCCESS) Main PID: 376 (auditd) CGroup: /system.slice/auditd.service ├─376 /sbin/auditd └─378 /sbin/audispd

7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/audisp-remote 已重新启动 7 月 11 日 19:42:48 ip-10-0-3-159 .ec2.internal audisp-remote[436]:连接到 10.0.1.238 时出错:网络无法访问 7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/ audisp-remote 意外终止 7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/audisp-remote 已重新启动 7 月 11 日 19:42:48 ip-10- 0-3-159.ec2.internal audisp-remote[451]:连接到 10.0.1.238 时出错:网络无法访问 7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378] : 插件 /sbin/audisp-remote 意外终止 7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378]: 插件 /sbin/audisp-remote 已于 7 月 11 日 19:42 重新启动: 48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/audisp-remote 意外终止 7 月 11 日 19:42:48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/audisp-remote 已超过 max_restarts 7 月 11 日 19:42: 48 ip-10-0-3-159.ec2.internal audispd[378]:插件 /sbin/audisp-remote 已重新启动

我已经在 /etc/audisp/audisp-remote.conf 中尝试了公共 ip 和私有 ip(作为 remote_server),我可以从客户端 telnet 到远程服务器的端口 60,安全组没有问题,最重要的是相同的配置在 VM 环境中成功运行。

下面是服务器的“netstat -tulpen”: [root@ip-10-0-1-238 ~]# netstat -tulpen Active Internet 连接(仅限服务器) Proto Recv-Q Send-Q 本地地址 外部地址 状态 用户 Inode PID /程序名称 tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 0 18570 1077/rsyslogd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 18464 1070/sshd tcp 0 0 127.0.0.1:25 0.0 .0.0:* LISTEN 0 17663 1032/master tcp6 0 0 :::60 ::: LISTEN 0 14041 401/auditd* tcp6 0 0 :::514 :::* LISTEN 0 18571 1077/rsyslogd tcp6 0 0 :::80 :::* LISTEN 0 17023 759/httpd tcp6 0 0 :::22 :::* LISTEN 0 18466 1070/ sshd tcp6 0 0 ::1:25 :::* LISTEN 0 17664 1032/master udp 0 0 127.0.0.1:323 0.0.0.0:* 0 14741 478/chronyd udp 0 0 0.0.0.0:68 0.0.0.0:* 0 16016 549/dhclient udp6 0 0 ::1:323 :::* 0 14742 478/chronyd

另一个困惑是所有服务都在 tcp 和 tcp6 上运行,但 auditd 仅在 tcp6 上运行。这有什么需要担心的吗?在 VM 环境中,tcp 和 tc6 行都用于 auditd。

标签: amazon-ec2rhel7

解决方案


这个大问题的非常小的修复。应该是网络有问题。我禁用了 auditd(systemctl disable auditd)。实例启动后,手动启动auditd服务(systemctl start auditd)。这是一个快速修复。我不知道根本原因。


推荐阅读