OSSEC Host-based Intrusion Detection System
repository·main·Indexed 26 days ago
https://github.com/ossec/ossec-hidsAn open-source host-based intrusion detection system (HIDS) providing log monitoring and SIEM capabilities. Documentation covers installation of the Ossec-agent SELinux module, management of agents via the manage_agents CLI, and Debian/Ubuntu package builds. Also includes technical details for the integrated cJSON ultralightweight JSON parser, including build options with CMake, data structures, and parsing/printing functions.
What's inside OSSEC-HIDS
- OSSEC is a comprehensive platform designed to monitor and control systems. It integrates Host-based Intrusion Detection (HIDS), log monitoring, and SIM/SIEM capabilities into a single open-source solution.
Overview of cJSON
maincJSON is an ultralightweight JSON parser written in ANSI C. It is designed for simplicity and minimal footprint.Capabilities of the OSSEC Windows Agent
mainThe OSSEC Windows Agent performs the following security and monitoring tasks on the host system:
- Real-time Event Log Monitoring: Monitors the Windows event log in real time.
- Real-time Log Monitoring: Monitors IIS logs (Web, FTP, SMTP) and other system logs (e.g., Symantec Anti-Virus, MySQL, Apache) in real time.
- Registry Monitoring: Periodically checks the Windows Registry for changes.
- File Integrity Monitoring: Periodically or in real-time checks Windows folders for changes.
- Policy Verification: Periodically performs policy verifications to ensure the system is configured according to defined security policies.
Use DotZLib for .NET compression and checksums
mainDotZLib is a .NET wrapper class library for
ZLib1.dll. It provides functionality for:- Inflating and deflating memory buffers.
- .NET streaming wrappers for
gzstreams (zlib streams). - Wrappers for the checksum components of zlib.
For implementation examples, refer to
DotZLib/UnitTests.cs.Get the development version of OSSEC
mainThe development version of OSSEC is hosted on GitHub and can be obtained by cloning the repository.Download OSSEC-HIDS Debian/Ubuntu packages
mainPre-built OSSEC-HIDS packages for Debian and Ubuntu can be downloaded from the official OSSEC website or directly from the Wazuh APT repository.
Available packages:
ossec-hids: Includes both the server and the agent.ossec-hids-agent: Includes only the agent.
http://www.ossec.net/?page_id=19 http://ossec.wazuh.com/repos/apt/Install and build cJSON
maincJSON can be integrated into projects using several methods:
Copying Source
Since the library consists of only
cJSON.handcJSON.c, you can copy these files directly into your project source.Using CMake
CMake (version 2.8.5 or higher) is the recommended build system. For Unix platforms, it is recommended to perform an out-of-tree build:
mkdir build cd build cmake .. makeUsing Makefile
Note: This method is deprecated. If CMake is unavailable, you can use the provided Makefile:
make allUsing Meson
Include
libcjsonas a dependency in yourmeson.buildfile:project('c-json-example', 'c') cjson = dependency('libcjson') example = executable('example', 'example.c', dependencies: [cjson])Using Vcpkg
git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install vcpkg install cjsonmkdir build cd build cmake .. makeBuild ZLib.Ada using Aonix ObjectAda for Win32 7.2.2
mainFollow these steps to build ZLib.Ada in an Aonix ObjectAda environment:
- Create a project containing all
*.adsand*.adbfiles from the distribution. - Build the
libz.alibrary from the original ZLib C sources. - Rename
libz.atoz.lib. - Add
z.libto your Ada project. - Add the
libc.liblibrary from the ObjectAda distribution to the project. - Build the executable using
test.adbas the main procedure.
- Create a project containing all
Use ZLib.Ada functionality
mainZLib.Ada provides Ada-style access to the ZLib C library. For implementation examples and demonstrations of the main functionality, refer to the source filestest.adbandread.adbincluded in the distribution. The package specifications contain commented routines explaining their usage.Install the Ossec-agent SELinux module
mainTo provide additional security protection for the OSSEC application using SELinux, follow these steps on a running SELinux installation:
- Install the SELinux policy module:
semodule -i ossec_agent.pp.bz2 - Restore the security contexts for the OSSEC directory:
restorecon -R /var/ossec - Restart the OSSEC agent using your system's service manager (e.g.,
systemd,init). - Verify that the agent has the correct security context by running
ps -AZ.
- Install the SELinux policy module:
Use the zlibpas Pascal interface
mainThe
zlibpas.pasunit provides a Pascal (Delphi, Kylix) interface to the zlib data compression library.Key Compatibility and Usage Notes:
- Naming Conflict: Do not confuse this unit with Borland's built-in
ZLibunit. Borland's unit is a suite of class wrappers that lacks essential features like checksums. Usezlibpasfor full-fledged zlib functionality. - Calling Convention: The interface uses the
cdeclkeyword. This means it is not compatible with old Turbo Pascal. It is designed for environments using__pascal(DOS/Windows16) or__fastcall(Windows32). - Type Mapping: C types are translated to Pascal types of similar sizes to avoid namespace pollution (e.g.,
inttoInteger,longtoLongInt). Note that unsigned integers are not explicitly converted to Pascal unsigned integers. - Limitations: The
gz*function interfaces are not translated to avoid C runtime library interfacing problems. Specifically,gzprintfcannot be used via this Pascal interface.
- Naming Conflict: Do not confuse this unit with Borland's built-in
Access OSSEC documentation and support
mainFor detailed information, installation guides, and troubleshooting, use the following resources:
- Official Manual: http://www.ossec.net/doc/manual/index.html
- FAQ: http://www.ossec.net/doc/faq/index.html
- Main Website: http://www.ossec.net
- Support: http://www.ossec.net/main/support/