我正在尝试在 RHEL 8 上为 SIEM 提取进行设置。我有下面的配置,但是,正常的非 tls TCP 不起作用。
我知道问题出在全局和 imtcp 模块中都有 gtls - 这是显而易见的,但我找不到如何将此配置添加到我可以添加到每个需要规则集的单个输入模板中。这能做到吗?
我尝试将以下内容添加到我的输入模板中,但没有成功。它们似乎已被弃用。
我尝试添加:
(1)
StreamDriver.Name="gtls"
StreamDriver.Mode="1"
StreamDriver.Authmode="anon"
(2)
Tag="ssl"
(3)
tls="on"
tls.caCert="/etc/rsyslog.d/certs/CA.pem"
tls.myCert="/etc/rsyslog.d/certs/server.pem"
tls.myPrivKey="/etc/rsyslog.d/certs/Key.key"
tls.authmode="name"
任何建议将不胜感激。
########## MODULES ##########
module(load="imudp")
module(load="imtcp" MaxSessions="500"
StreamDriver.Name="gtls"
StreamDriver.Mode="1"
StreamDriver.Authmode="anon"
)
########## TEMPLATES ##########
template(name="FileFormat" type="list") {
property(name="rawmsg-after-pri")
constant(value="\n")
}
# make gtls driver the default and set certificate files
global(
DefaultNetstreamDriver="gtls"
DefaultNetstreamDriverCAFile="/etc/rsyslog.d/certs/CA.pem"
DefaultNetstreamDriverCertFile="/etc/rsyslog.d/certs/server.pem"
DefaultNetstreamDriverKeyFile="/etc/rsyslog.d/certs/Key.key"
)
# semanage port -a -t syslogd_port_t -p udp <port>
############### udp_input ###############
input(type="imudp" port="8501" ruleset="udp_input")
template(name="udp_input" type="string" string="var/log/remote/udp_input/%HOSTNAME%/%$day%_%$hour%.log")
ruleset(name="udp_input"){
action(
type="omfile"
dirCreateMode="0755"
template="FileFormat"
dynafile="udp_input"
)
}
# semanage port -a -t syslogd_port_t -p tcp <port>
############### TCP_input ###############
input(type="imtcp" port="8502" ruleset="TCP_input")
template(name="TCP_input" type="string" string="var/log/remote/TCP_input/%HOSTNAME%/%$day%_%$hour%.log")
ruleset(name="TCP_input"){
action(
type="omfile"
dirCreateMode="0755"
template="FileFormat"
dynafile="TCP_input"
)
}
# semanage port -a -t syslog_tls_port_t -p tcp <port>
############### tls_input ###############
input(type="imtcp" port="8611" ruleset="tls_input")
template(name="tls_input" type="string" string="var/log/remote/tls_input/%HOSTNAME%/%$day%_%$hour%.log")
ruleset(name="tls_input"){
action(
type="omfile"
dirCreateMode="0755"
template="FileFormat"
dynafile="tls_input"
)
}
我有模块:rsyslog.x86_64
rsyslog-gnutls.x86_64 rsyslog-gssapi.x86_64 rsyslog-relp.x86_64
答案1
您是否也尝试过通过纯文本 TCP imptcp 替换 imtcp 模块?
############### TCP_input ###############
input(type="imptcp" port="8502" ruleset="TCP_input")