Convert Figma logo to code with AI

Neo23x0 logoauditd

Best Practice Auditd Configuration

1,546
272
1,546
45

Top Related Projects

13,708

Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.

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.

7,530

Cloud Native Runtime Security

11,490

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

3,724

Linux Runtime Security and Forensics using eBPF

Quick Overview

Neo23x0/auditd is a GitHub repository containing configuration files and rules for the Linux Auditing System (auditd). It provides a comprehensive set of audit rules to enhance system security monitoring and compliance with various security standards. The project aims to help system administrators and security professionals implement robust auditing practices on Linux systems.

Pros

  • Comprehensive set of pre-configured audit rules
  • Aligned with security best practices and compliance standards
  • Regularly updated and maintained
  • Easy to implement and customize

Cons

  • May require fine-tuning for specific environments
  • Can generate large volumes of log data
  • Potential performance impact on heavily loaded systems
  • Requires understanding of Linux auditing concepts for effective use

Getting Started

To implement the auditd rules from this repository:

  1. Clone the repository:

    git clone https://github.com/Neo23x0/auditd.git
    
  2. Copy the audit rules file to the appropriate location:

    sudo cp auditd/audit.rules /etc/audit/rules.d/audit.rules
    
  3. Restart the auditd service:

    sudo service auditd restart
    
  4. Verify that the rules are loaded:

    sudo auditctl -l
    

Note: Always review and test the rules in a non-production environment before implementing them on critical systems. Adjust the rules as needed to fit your specific security requirements and system performance considerations.

Competitor Comparisons

13,708

Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.

Pros of Lynis

  • Comprehensive security auditing tool for Unix/Linux systems
  • Extensive plugin system for customization and extensibility
  • Active development and regular updates

Cons of Lynis

  • Requires more setup and configuration compared to auditd
  • May have a steeper learning curve for beginners

Code Comparison

Lynis (main scanning function):

lynis audit system

auditd (basic rule configuration):

-w /etc/passwd -p wa -k passwd_changes
-w /etc/group -p wa -k group_changes
-w /etc/shadow -p wa -k shadow_changes

Key Differences

  • Lynis is a comprehensive security auditing tool, while auditd focuses specifically on system auditing and logging
  • Lynis provides a more user-friendly interface and reporting system
  • auditd is more lightweight and integrated into most Linux distributions by default

Use Cases

  • Lynis: Ideal for comprehensive security assessments and compliance checks
  • auditd: Better suited for continuous system monitoring and event logging

Community and Support

  • Lynis has a larger community and more extensive documentation
  • auditd benefits from being a core part of many Linux distributions, with built-in support

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

  • Comprehensive host-based intrusion detection system (HIDS) with file integrity monitoring, log analysis, and active response capabilities
  • Cross-platform support for various operating systems, including Windows, Linux, and macOS
  • Large and active community with regular updates and contributions

Cons of ossec-hids

  • More complex setup and configuration compared to auditd
  • Higher resource usage due to its comprehensive 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>

auditd (audit.rules):

-w /etc -p wa
-w /usr/bin -p wa
-w /usr/sbin -p wa

Both projects aim to enhance system security, but they differ in scope and implementation. ossec-hids offers a more comprehensive solution with broader functionality, while auditd focuses specifically on system auditing and is more lightweight. The code examples demonstrate the different approaches to configuration, with ossec-hids using XML and auditd using a simpler rule-based format.

7,530

Cloud Native Runtime Security

Pros of Falco

  • More comprehensive system monitoring, covering a wider range of events and activities
  • Real-time threat detection with customizable rules and alerts
  • Better performance and lower overhead, especially for high-volume environments

Cons of Falco

  • Steeper learning curve and more complex configuration
  • Requires kernel module or eBPF probe, which may not be suitable for all environments
  • Potentially higher resource usage for extensive rule sets

Code Comparison

Auditd configuration example:

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

Falco rule example:

- rule: Modify passwd file
  desc: Detect modifications to /etc/passwd
  condition: >
    open_write and file.path = /etc/passwd
  output: "passwd file modified (user=%user.name file=%fd.name)"
  priority: WARNING

Falco offers more flexible and expressive rules, allowing for complex conditions and detailed output. Auditd's configuration is simpler but less powerful, focusing primarily on system call monitoring.

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 capabilities
  • Active community and regular updates
  • Scalable architecture suitable for large enterprises

Cons of Wazuh

  • More complex setup and configuration compared to auditd
  • Higher resource consumption due to its extensive feature set

Code Comparison

auditd configuration example:

-w /etc/passwd -p wa -k passwd_changes
-w /etc/group -p wa -k group_changes
-w /etc/shadow -p wa -k shadow_changes

Wazuh agent configuration example:

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

Summary

While auditd is a lightweight and focused Linux auditing system, Wazuh offers a more comprehensive security solution with additional features. auditd is easier to set up and consumes fewer resources, making it suitable for simpler environments or specific auditing needs. Wazuh, on the other hand, provides a broader range of security capabilities but requires more setup effort and system resources. The choice between the two depends on the specific security requirements and scale of the infrastructure being protected.

3,724

Linux Runtime Security and Forensics using eBPF

Pros of tracee

  • More comprehensive system monitoring, covering both system calls and eBPF events
  • Provides real-time event streaming and analysis capabilities
  • Offers a more modern, container-aware approach to system tracing

Cons of tracee

  • Higher resource overhead due to its extensive tracing capabilities
  • Steeper learning curve for configuration and customization
  • May require more setup and configuration for specific use cases

Code Comparison

tracee:

func main() {
    cfg := config.New()
    events := make(chan trace.Event)
    tracer := trace.New(cfg, events)
    tracer.Start()
    // ... event processing logic
}

auditd:

# /etc/audit/rules.d/audit.rules
-w /etc/passwd -p wa -k passwd_changes
-a always,exit -F arch=b64 -S execve -k exec_calls
# ... additional audit rules

Summary

tracee offers a more comprehensive and modern approach to system tracing, with real-time event streaming and container awareness. However, it comes with higher resource requirements and a steeper learning curve. auditd, while more traditional, provides a simpler configuration and lower overhead, making it suitable for specific auditing needs. The choice between the two depends on the specific requirements of the monitoring task and the available system resources.

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

Actively Maintained

    ___             ___ __      __
   /   | __  ______/ (_) /_____/ /
  / /| |/ / / / __  / / __/ __  / 
 / ___ / /_/ / /_/ / / /_/ /_/ /  
/_/  |_\__,_/\__,_/_/\__/\__,_/   

Best Practice Auditd Configuration

Idea

The idea of this auditd configuration is to provide a basic configuration that

  • works out-of-the-box on all major Linux distributions
  • fits most use cases
  • produces a reasonable amount of log data
  • covers security relevant activity
  • is easy to read (different sections, many comments)

Sources

The configuration is based on the following sources

Gov.uk auditd rules https://github.com/gds-operations/puppet-auditd/pull/1

CentOS 7 hardening https://highon.coffee/blog/security-harden-centos-7/#auditd---audit-daemon

Linux audit repo https://github.com/linux-audit/audit-userspace/tree/master/rules

Auditd high performance linux auditing https://linux-audit.com/tuning-auditd-high-performance-linux-auditing/

Further rules

Not all of these rules have been included.

For PCI DSS compliance see: https://github.com/linux-audit/audit-userspace/blob/master/rules/30-pci-dss-v31.rules

For NISPOM compliance see: https://github.com/linux-audit/audit-userspace/blob/master/rules/30-nispom.rules

Video Explanations by IppSec

IppSec captured a video that explains how to detect the exploitation of the OMIGOD vulnerability using auditd. In that video, he walks you through the audit configuration maintained in this repo and explains how to use it. I highly recommend this video to get a better understanding of what is happening in the config.

https://www.youtube.com/watch?v=lc1i9h1GyMA

Contribution

Please contribute your changes as pull requests