Skip to content

Enhance auditd log recognition by making "node=" optional#22178

Merged
vikman90 merged 2 commits into
4.8.2from
fix/22066-auditd-decoder-prematch
Feb 27, 2024
Merged

Enhance auditd log recognition by making "node=" optional#22178
vikman90 merged 2 commits into
4.8.2from
fix/22066-auditd-decoder-prematch

Conversation

@vikman90

Copy link
Copy Markdown
Member
Related issue
Closes #22066

This PR addresses a bug in our product where logs starting with "node=" were not being recognized properly. I've modified the <prematch> regex option to make the presence of "node=" at the beginning of the log optional. This change ensures that logs both with and without "node=" are correctly identified.

Additionally, I've updated the tests to accommodate this modification, ensuring robustness in our testing suite.

Tests

  • Extend ruleset ini tests.
  • wazuh-logtest.

🟢 Unchanged

type=PROCTITLE msg=audit(1708637434.880:672): proctitle="su"

Result:
**Phase 2: Completed decoding.
        name: 'auditd'
        audit.id: '672'
        audit.type: 'PROCTITLE'

**Phase 3: Completed filtering (rules).
        id: '80700'
        level: '0'
        description: 'Audit: Messages grouped.'
        groups: '['audit']'
        firedtimes: '1'
        mail: 'False'

🟢 Fixed

node=localhost type=PROCTITLE msg=audit(1708637434.880:672): proctitle="su"

Result:
**Phase 2: Completed decoding.
        name: 'auditd'
        audit.id: '672'
        audit.type: 'PROCTITLE'

**Phase 3: Completed filtering (rules).
        id: '80700'
        level: '0'
        description: 'Audit: Messages grouped.'
        groups: '['audit']'
        firedtimes: '1'
        mail: 'False'

@vikman90 vikman90 added type/bug Something isn't working feed/rules Rules related issues labels Feb 27, 2024
@vikman90
vikman90 requested a review from ooniagbi February 27, 2024 10:52
@vikman90 vikman90 self-assigned this Feb 27, 2024

@ooniagbi ooniagbi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vikman90
vikman90 merged commit 93d074b into 4.8.2 Feb 27, 2024
@vikman90
vikman90 deleted the fix/22066-auditd-decoder-prematch branch February 27, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feed/rules Rules related issues type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants