ossec / ossec-hids

OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.
http://www.ossec.net
Other
4.41k stars 1.03k forks source link

os_maild/sendmail.c:12:19: fatal error: event.h: No such file or directory #1785

Closed nodesocket closed 4 years ago

nodesocket commented 4 years ago

Trying to upgrade from v3.3.0 to v3.4.0 and when running PCRE2_SYSTEM=yes ./install.sh I am getting:

os_maild/sendmail.c:12:19: fatal error: event.h: No such file or directory
 #include <event.h>
                   ^
compilation terminated.
Makefile:926: recipe for target 'os_maild/sendmail.o' failed
make: *** [os_maild/sendmail.o] Error 1

Full install commands are:

cat <<EOF > etc/preloaded-vars.conf
USER_LANGUAGE="en"
USER_NO_STOP="y"
USER_INSTALL_TYPE="local"
USER_DIR="/var/ossec"
USER_DELETE_DIR="y"
USER_ENABLE_ACTIVE_RESPONSE="y"
USER_ENABLE_SYSCHECK="y"
USER_ENABLE_ROOTCHECK="y"
USER_UPDATE="y"
USER_UPDATE_RULES="y"
USER_ENABLE_EMAIL="y"
USER_EMAIL_ADDRESS="ops@domain.com"
USER_EMAIL_SMTP="localhost"
USER_ENABLE_SYSLOG="n"
USER_ENABLE_FIREWALL_RESPONSE="y"
USER_ENABLE_PF="n"
USER_WHITE_LIST="127.0.0.1"
EOF

PCRE2_SYSTEM=yes ./install.sh

Any ideas?

ddpbsd commented 4 years ago

Install the libevent dev package

nodesocket commented 4 years ago

Was this a change in v3.4.0 needing libevent dev upgrading from v3.3.0? Previously did not need that package.

ddpbsd commented 4 years ago

I think so. It helps with dns resolution.

Nono-m0le commented 4 years ago

Sorry to hijack the thread but I'm having the same error trying to upgrade from 3.3.0 to 3.4.0. I install libevent-dev but now, even with the latest openssl / libssl package to date (ubuntu Server 18.04 LTS) still having the following error :

5- Installing the system
 - Running the Makefile
cc -I./external/compat -DMAX_AGENTS=2048 -DOSSECHIDS -DDEFAULTDIR=\"/var/ossec\" -DUSER=\"ossec\" -DREMUSER=\"ossecr\" -DGROUPGLOBAL=\"ossec\" -DMAILUSER=\"ossecm\" -DLinux -DINOTIFY_ENABLED -DZLIB_SYSTEM -DUSE_PCRE2_JIT -DLOCAL -Wall -Wextra -I./ -I./headers/ os_maild/sendmail.o os_maild/sendcustomemail.o os_maild/config.o os_maild/os_maild_client.o os_maild/maild.o os_maild/mail_list.o os_dns/os_dns.o os_crypto.a config.a shared.a os_net.a os_regex.a os_xml.a  -lm -lpthread -lpcre2-8 -lz  -levent ./external/compat/imsg.c ./external/compat/imsg-buffer.c -o ossec-maild
In file included from ./external/compat/imsg.c:21:0:
./external/compat/includes.h:65:10: fatal error: openssl/opensslv.h: No such file or directory
 #include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ./external/compat/imsg-buffer.c:21:0:
./external/compat/includes.h:65:10: fatal error: openssl/opensslv.h: No such file or directory
 #include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:929: recipe for target 'ossec-maild' failed
make: *** [ossec-maild] Error 1

 Error 0x5.
 Building error. Unable to finish the installation.

I'm using sudo but same install command as @nodesocket : sudo PCRE2_SYSTEM=yes ./install.sh

$ dpkg -l |grep ssl
ii  libevent-openssl-2.1-6:amd64          2.1.8-stable-4build1              amd64        Asynchronous event notification library (openssl)
ii  libio-socket-ssl-perl                 2.056-1                           all          Perl module implementing object oriented interface to SSL sockets
ii  libnet-ssleay-perl                    1.84-1build1                      amd64        Perl module for Secure Sockets Layer (SSL)
ii  libssl1.0.0:amd64                     1.0.2n-1ubuntu5.3                 amd64        Secure Sockets Layer toolkit - shared libraries
ii  libssl1.1:amd64                       1.1.1-1ubuntu2.1~18.04.4          amd64        Secure Sockets Layer toolkit - shared libraries
ii  libxmlsec1-openssl:amd64              1.2.25-1build1                    amd64        Openssl engine for the XML security library
ii  libzstd1:amd64                        1.3.3+dfsg-2ubuntu1               amd64        fast lossless compression algorithm
ii  openssl                               1.1.1-1ubuntu2.1~18.04.4          amd64        Secure Sockets Layer toolkit - cryptographic utility
ii  perl-openssl-defaults:amd64           3build1                           amd64        version compatibility baseline for Perl OpenSSL packages
ii  python3-openssl                       17.5.0-1ubuntu1                   all          Python 3 wrapper around the OpenSSL library

$ dpkg -l |grep libevent
ii  libevent-2.1-6:amd64                  2.1.8-stable-4build1              amd64        Asynchronous event notification library
ii  libevent-core-2.1-6:amd64             2.1.8-stable-4build1              amd64        Asynchronous event notification library (core)
ii  libevent-dev                          2.1.8-stable-4build1              amd64        Asynchronous event notification library (development files)
ii  libevent-extra-2.1-6:amd64            2.1.8-stable-4build1              amd64        Asynchronous event notification library (extra)
ii  libevent-openssl-2.1-6:amd64          2.1.8-stable-4build1              amd64        Asynchronous event notification library (openssl)
ii  libevent-pthreads-2.1-6:amd64         2.1.8-stable-4build1              amd64        Asynchronous event notification library (pthreads)
Nono-m0le commented 4 years ago

I actually solved my issue by doing

sudo apt install libssl1.0-dev
sudo PCRE2_SYSTEM=yes ./install.sh
chuckyinfotec commented 4 years ago

I resolved with: apt install libz-dev libssl-dev libpcre2-dev libevent-dev build-essential

upengan78 commented 4 years ago

5- Installing the system

Oracle Linux 7.7

rpm -qa | grep libevent libevent-2.0.21-4.el7.x86_64 libev-libevent-devel-4.15-3.el7.x86_64

ddpbsd commented 4 years ago

@upengan78 Is there a libevent-devel package you can install?

upengan78 commented 4 years ago

I only see libev-libevent-devel and it's installed. yum search libevent-devel libev-libevent-devel.x86_64 : Compatibility development header with libevent for libev.

rpm -ql libev-libevent-devel.x86_64 /usr/include/event.h (This file is available)

ddpbsd commented 4 years ago

You could run ldconfig -p | grep event to see if it's different on that system. But I don't really have access to oracle linux, so I can't do much investigation.

upengan78 commented 4 years ago

@ddpbsd Thank you for helping out. I can run commands/similar commands on my platform per your hints. Thanks!! . Here is what I see ldconfig -p | grep event libverto-tevent.so.1 (libc6,x86-64) => /lib64/libverto-tevent.so.1 libtevent.so.0 (libc6,x86-64) => /lib64/libtevent.so.0 libtevent-util.so.0 (libc6,x86-64) => /lib64/libtevent-util.so.0 libparsevent.so (libc6,x86-64) => /lib64/libparsevent.so libevent_pthreads-2.0.so.5 (libc6,x86-64) => /lib64/libevent_pthreads-2.0.so.5 libevent_openssl-2.0.so.5 (libc6,x86-64) => /lib64/libevent_openssl-2.0.so.5 libevent_extra-2.0.so.5 (libc6,x86-64) => /lib64/libevent_extra-2.0.so.5 libevent_core-2.0.so.5 (libc6,x86-64) => /lib64/libevent_core-2.0.so.5 libevent-2.0.so.5 (libc6,x86-64) => /lib64/libevent-2.0.so.5 libdmraid-events-isw.so.1 (libc6,x86-64) => /lib64/libdmraid-events-isw.so.1 libdmraid-events-isw.so (libc6,x86-64) => /lib64/libdmraid-events-isw.so libdevmapper-event.so.1.02 (libc6,x86-64) => /lib64/libdevmapper-event.so.1.02 libdevmapper-event-lvm2vdo.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2vdo.so libdevmapper-event-lvm2thin.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2thin.so libdevmapper-event-lvm2snapshot.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2snapshot.so libdevmapper-event-lvm2raid.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2raid.so libdevmapper-event-lvm2mirror.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2mirror.so libdevmapper-event-lvm2.so.2.02 (libc6,x86-64) => /lib64/libdevmapper-event-lvm2.so.2.02

ddpbsd commented 4 years ago

Oh, I should have noticed. That's libevent2. Is there a libevent1 package?

upengan78 commented 4 years ago

@ddpbsd No, that was available for Cent OS release 6 but any more > 7.x,

upengan78 commented 4 years ago

@ddpbsd I edited the src/Makefile and replaced all occurences of -levent with -lev and ./install.sh worked successfully till the end. Thank you for keeping me motivated and commands you provided helped me with better understanding how to approach. Take care.....No sure why I am not emails about updates but I am refreshing this page.. ;)

ddpbsd commented 4 years ago

@upengan78 I've opened issue #1860 to remind myself to get back to this. Thanks for pointing it out!