Convert Figma logo to code with AI

microsoft logoSysmonForLinux

Sysmon for Linux

1,797
191
1,797
32

Top Related Projects

7,530

Cloud Native Runtime Security

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.

11,490

Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.

22,160

SQL powered operating system instrumentation, monitoring, and analytics.

4,484

A binary authorization and monitoring system for macOS

1,546

Best Practice Auditd Configuration

Quick Overview

Sysmon for Linux is an open-source system monitoring tool developed by Microsoft, designed to provide detailed logging of system activity on Linux systems. It is a port of the popular Windows Sysmon tool, offering similar functionality for Linux environments to enhance security monitoring and threat detection capabilities.

Pros

  • Provides detailed system activity logging, including process creation, network connections, and file changes
  • Offers consistent logging format across Windows and Linux systems, facilitating cross-platform analysis
  • Integrates well with existing security information and event management (SIEM) systems
  • Highly configurable, allowing users to tailor logging to their specific needs

Cons

  • Relatively new project, which may lead to potential stability issues or bugs
  • Limited documentation compared to its Windows counterpart
  • May have a performance impact on the system, especially with extensive logging enabled
  • Requires root privileges to install and run, which may be a security concern for some organizations

Getting Started

To get started with Sysmon for Linux:

  1. Clone the repository:

    git clone https://github.com/microsoft/SysmonForLinux.git
    
  2. Build and install Sysmon:

    cd SysmonForLinux
    ./build.sh
    sudo make install
    
  3. Start Sysmon service:

    sudo systemctl start sysmon
    
  4. Check Sysmon status:

    sudo systemctl status sysmon
    
  5. View logs:

    sudo tail -f /var/log/sysmon.log
    

For more detailed configuration and usage instructions, refer to the project's documentation on GitHub.

Competitor Comparisons

7,530

Cloud Native Runtime Security

Pros of Falco

  • More mature and widely adopted in the cloud-native ecosystem
  • Extensive rule set and customization options for threat detection
  • Strong community support and regular updates

Cons of Falco

  • Steeper learning curve for configuration and rule writing
  • Higher resource consumption, especially in large-scale deployments
  • Limited integration with Windows environments

Code Comparison

Falco rule example:

- rule: Detect Suspicious File Access
  desc: Detect access to sensitive files
  condition: >
    open_read and sensitive_files and not trusted_programs
  output: "Sensitive file accessed by untrusted program (user=%user.name file=%fd.name)"
  priority: WARNING

SysmonForLinux configuration example:

<EventFiltering>
  <RuleGroup name="file_events">
    <FileCreate onmatch="include">
      <TargetFilename condition="contains">/etc/passwd</TargetFilename>
    </FileCreate>
  </RuleGroup>
</EventFiltering>

Both projects aim to provide system monitoring and security event detection for Linux environments. Falco offers a more comprehensive and flexible approach, while SysmonForLinux provides a familiar configuration format for Windows Sysmon users transitioning to Linux environments.

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.

Pros of OSSEC-HIDS

  • More comprehensive security solution, including intrusion detection, log analysis, and file integrity monitoring
  • Cross-platform support for various operating systems, not limited to Linux
  • Large and active community with extensive documentation and support

Cons of OSSEC-HIDS

  • More complex setup and configuration compared to SysmonForLinux
  • Higher resource consumption due to its broader feature set
  • Steeper learning curve for new users

Code Comparison

OSSEC-HIDS (ossec.conf):

<ossec_config>
  <syscheck>
    <directories check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
    <ignore>/etc/mtab</ignore>
  </syscheck>
</ossec_config>

SysmonForLinux (sysmon.xml):

<Sysmon schemaversion="4.81">
  <EventFiltering>
    <FileCreate onmatch="include">
      <TargetFilename condition="contains">/etc/</TargetFilename>
    </FileCreate>
  </EventFiltering>
</Sysmon>

The code snippets show configuration examples for both tools. OSSEC-HIDS focuses on directory monitoring and file integrity checks, while SysmonForLinux provides more granular event filtering capabilities for specific file operations.

11,490

Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.

Pros of Wazuh

  • Comprehensive security platform with SIEM, IDS, and vulnerability management
  • Cross-platform support for Windows, Linux, macOS, and cloud environments
  • Large active community and extensive documentation

Cons of Wazuh

  • More complex setup and configuration compared to SysmonForLinux
  • Higher resource consumption due to its broader feature set

Code Comparison

SysmonForLinux:

int main(int argc, char **argv)
{
    return sysmon_main(argc, argv);
}

Wazuh:

int main(int argc, char **argv)
{
    OS_SetName(ARGV0);
    w_init_signal_handling();
    return local_start();
}

Key Differences

  • SysmonForLinux focuses specifically on system monitoring for Linux, while Wazuh offers a more comprehensive security solution
  • Wazuh provides a web-based user interface, whereas SysmonForLinux is primarily command-line driven
  • SysmonForLinux is designed to be lightweight and efficient, while Wazuh offers more advanced features at the cost of increased complexity

Use Cases

  • SysmonForLinux: Ideal for organizations looking for a lightweight, Linux-specific system monitoring tool
  • Wazuh: Better suited for enterprises requiring a full-featured security platform across multiple operating systems and environments
22,160

SQL powered operating system instrumentation, monitoring, and analytics.

Pros of osquery

  • Cross-platform support (Windows, macOS, Linux, FreeBSD)
  • Extensive querying capabilities with SQL-like syntax
  • Large community and ecosystem of extensions

Cons of osquery

  • Steeper learning curve for SQL-style queries
  • Higher resource usage, especially for complex queries

Code Comparison

SysmonForLinux:

static void print_event_data(struct pt_regs *regs, long id)
{
    char comm[TASK_COMM_LEN];
    get_task_comm(comm, current);
    bpf_trace_printk("syscall=%d comm=%s\n", id, comm);
}

osquery:

QueryData genProcesses(QueryContext& context) {
  QueryData results;
  auto processes = osquery::getProcList(context);
  for (const auto& process : processes) {
    Row r;
    r["pid"] = INTEGER(process.pid);
    r["name"] = SQL_TEXT(process.name);
    results.push_back(r);
  }
  return results;
}

Summary

SysmonForLinux is a Linux port of the popular Windows Sysmon tool, focusing on system monitoring and event logging. It's designed specifically for Linux environments and integrates well with existing Windows Sysmon deployments.

osquery, on the other hand, is a versatile, cross-platform tool that allows users to query system information using SQL-like syntax. It offers broader functionality and platform support but may require more resources and have a steeper learning curve.

Both tools are valuable for system monitoring and security, with the choice depending on specific requirements, existing infrastructure, and team expertise.

4,484

A binary authorization and monitoring system for macOS

Pros of Santa

  • Specifically designed for macOS, offering deep integration with the platform
  • Includes a GUI component for easier management and user interaction
  • Supports both binary and certificate-based rules for more flexible policy enforcement

Cons of Santa

  • Limited to macOS, while Sysmon for Linux supports multiple Linux distributions
  • Less comprehensive event logging compared to Sysmon's extensive logging capabilities
  • Smaller community and fewer third-party integrations than Sysmon

Code Comparison

Santa configuration example:

{
  "whitelist_regex": "^/Applications/.*",
  "blacklist_regex": "^/Users/.*\\.sh$",
  "mode": "MONITOR"
}

Sysmon for Linux configuration example:

<Sysmon schemaversion="4.30">
  <EventFiltering>
    <RuleGroup name="process_creation">
      <ProcessCreate onmatch="include">
        <Image condition="contains">/bin/bash</Image>
      </ProcessCreate>
    </RuleGroup>
  </EventFiltering>
</Sysmon>

Both projects aim to enhance system security, but they differ in their target platforms and configuration approaches. Santa focuses on macOS with a more straightforward JSON-based configuration, while Sysmon for Linux uses XML and offers more granular control over event logging across various Linux distributions.

1,546

Best Practice Auditd Configuration

Pros of auditd

  • More mature and established project with a longer history in the Linux ecosystem
  • Wider community support and integration with existing Linux tools and practices
  • Lighter resource footprint, as it's built into the Linux kernel

Cons of auditd

  • Less detailed event information compared to SysmonForLinux
  • Configuration can be more complex and less user-friendly
  • Limited cross-platform compatibility (Linux-specific)

Code Comparison

auditd configuration example:

-a always,exit -F arch=b64 -S execve -k exec_calls
-w /etc/passwd -p wa -k passwd_changes
-w /etc/shadow -p wa -k shadow_changes

SysmonForLinux configuration example:

<EventFiltering>
  <RuleGroup name="process_creation_events">
    <ProcessCreate onmatch="include"/>
  </RuleGroup>
  <FileCreateTime onmatch="include"/>
</EventFiltering>

Both systems allow for fine-grained control over event monitoring, but SysmonForLinux uses an XML-based configuration format, while auditd uses a more traditional Unix-style configuration syntax. SysmonForLinux's configuration may be more familiar to Windows administrators, while auditd's approach aligns with typical Linux practices.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Build Status

Sysmon for Linux

Sysmon for Linux is a tool that monitors and logs system activity including process lifetime, network connections, file system writes, and more. Sysmon works across reboots and uses advanced filtering to help identify malicious activity as well as how intruders and malware operate on your network. Sysmon for Linux is part of Sysinternals.

Sysmon in use

Installation

The packages are available in the official Microsoft Linux repositories and instructions on how to install the packages for the different Linux distributions can be found in the Installation instructions.

This project contains the code for build and installing Sysmon on Linux.

Build

Please see build instructions here.

Autodiscovery of Offsets

On systems that are BTF enabled, Sysmon will use BTF for accurate kernel offsets. Sysmon also supports specifying standalone BTF files (using /BTF switch). There are several ways to generate BTF files and BTFHub has a number of standalone BTF files for different distributions/kernels.

If BTF isn't available, Sysmon attempts to automatically discover the offsets of some members of some kernel structs. If this fails, please provide details of the kernel version (and config if possible) plus the error message to the GitHub issues page.

You can then generate a configuration file to override the autodiscovery by building the getOffsets module in the /opt/sysinternals/getOffsets directory. See the README.md in that directory for more information.

Manual Page

A man page for Sysmon can be found in the package directory, and is installed by both deb and rpm packages.

Use 'find' on the package directory to locate it manually.

Output

sudo tail -f /var/log/syslog

or more human-readable

sudo tail -f /var/log/syslog | sudo /opt/sysmon/sysmonLogView

SysmonLogView has options to filter the output to make it easy to identify specific events or reduce outputted fields for brevity.

SysmonLogView is built when Sysmon is built and is installed into /opt/sysmon when sysmon is installed.

Important: You may wish to modify your Syslogger config to ensure it can handle particularly large events (e.g. >64KB, as defaults are often between 1KB and 8KB), and/or use the FieldSizes configuration entry to limit the length of output for some fields, such as CommandLine, Image, CurrentDirectory, etc.

Example:

Add <FieldSizes>CommandLine:100,Image:20</FieldSizes> under <Sysmon> in your configuration file.

Developer Details

See DEVELOP.md

License

Sysmon For Linux is licensed under MIT, with the eBPF programs licensed under GPL2. SysinternalsEBPF (on which Sysmon For Linux depends) is licensed under LGPL2.1, with the eBPF code library licensed under GPL2.