Skip to content

[system] Populate event.action for Linux IAM auth events and sudo systemctl - #21042

Open
marc-gr wants to merge 3 commits into
elastic:mainfrom
marc-gr:fix/system-auth-event-action-iam-systemctl
Open

[system] Populate event.action for Linux IAM auth events and sudo systemctl#21042
marc-gr wants to merge 3 commits into
elastic:mainfrom
marc-gr:fix/system-auth-event-action-iam-systemctl

Conversation

@marc-gr

@marc-gr marc-gr commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

The system.auth pipeline already treated useradd/userdel/groupadd/groupdel as IAM events but left event.action empty. Sudo systemctl start|stop|restart also omitted service.name.

This fills event.action (user-created, user-deleted, group-created, group-deleted), extracts group.name from /etc/group and /etc/gshadow lines, and sets service.name plus service-start/service-stop/service-restart for sudo systemctl.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices (no dashboard was added).

How to test this PR locally

cd packages/system
elastic-package test pipeline --data-streams auth

Related issues

…temctl

The system.auth pipeline categorized useradd/userdel/groupadd/groupdel as IAM
events but left event.action empty, and sudo systemctl start/stop did not set
service.name. Fill those ECS fields and extract group.name from gshadow lines.
Copilot AI lite review requested due to automatic review settings September 3, 2026 06:54
@marc-gr
marc-gr requested review from a team as code owners September 3, 2026 06:54
@marc-gr marc-gr added Integration:system System bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Sep 3, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

Copilot AI 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.

🟡 Changes recommended

The new sudo systemctl parsing logic can mis-extract service.name when flags appear after the verb, and the service-stop typing is inconsistent with the stated goal of matching system.syslog semantics.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves the system.auth data stream parsing so Linux IAM and sudo systemctl events are enriched with more complete ECS fields (notably event.action, plus service.name for service lifecycle commands).

Changes:

  • Populate event.action for useradd/userdel/groupadd/groupdel-style IAM events and extend grok coverage for /etc/group and /etc/gshadow messages.
  • Add sudo systemctl start|stop|restart enrichment to set service.name and service lifecycle event.action.
  • Update exported fields documentation, add pipeline test fixtures, and bump package version + changelog.
File summaries
File Description
packages/system/manifest.yml Bumps the System package version to 2.23.5.
packages/system/docs/README.md Documents service.name as an exported field for system.auth.
packages/system/data_stream/auth/fields/fields.yml Declares service.name (ECS external) for the auth data stream.
packages/system/data_stream/auth/elasticsearch/ingest_pipeline/message.yml Adds grok patterns for group file lines; adds IAM event.action script; adds sudo systemctl service enrichment script.
packages/system/data_stream/auth/_dev/test/pipeline/test-userdel.log-expected.json Updates expected output to include event.action.
packages/system/data_stream/auth/_dev/test/pipeline/test-iam-systemctl.log-expected.json Adds expected outputs for IAM + sudo systemctl parsing.
packages/system/data_stream/auth/_dev/test/pipeline/test-iam-systemctl.log-config.yml Adds pipeline test config for the new fixture.
packages/system/data_stream/auth/_dev/test/pipeline/test-iam-systemctl.log Adds new pipeline test input covering IAM + sudo systemctl.
packages/system/data_stream/auth/_dev/test/pipeline/test-host-syslog-processor.json-expected.json Updates expected output to include event.action.
packages/system/data_stream/auth/_dev/test/pipeline/test-auth.log-expected.json Updates expected output to include event.action.
packages/system/data_stream/auth/_dev/test/pipeline/test-auth-ubuntu1204.log-expected.json Updates expected output (including event.action, and additional group fields where parsed).
packages/system/data_stream/auth/_dev/test/pipeline/test-auth-rhel79.log-expected.json Updates expected output to include event.action.
packages/system/data_stream/auth/_dev/test/pipeline/test-auth-debian11.json-expected.json Updates expected output to include event.action.
packages/system/data_stream/auth/_dev/test/pipeline/test-auth-debian11-preserve-original.json-expected.json Updates expected output to include event.action.
packages/system/changelog.yml Adds a 2.23.5 bugfix changelog entry with PR link.
Review details
  • Files reviewed: 14/15 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

….type

Take the next non-flag token as service.name so forms like
`systemctl start --no-block rsyslog` parse correctly, and set event.type
to end/start/change to match system.syslog service lifecycle events.
Copilot AI review requested due to automatic review settings September 3, 2026 11:05

Copilot AI 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.

🟢 Approval recommended

The ingest pipeline updates are covered by updated and newly added pipeline test fixtures that validate the new event.action and service.name behavior.

Review details
  • Files reviewed: 14/15 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@vera-review-bot

Copy link
Copy Markdown

🟢 No issues across the latest commits eda1230.

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot - v0.3.0 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:system System Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[System] : event.action field not populated for account/group management and log service activation/deactivation events

2 participants