Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auditbeat under k8s fails to enrich short-lived processes #22238

Closed
adriansr opened this issue Oct 28, 2020 · 5 comments
Closed

Auditbeat under k8s fails to enrich short-lived processes #22238

adriansr opened this issue Oct 28, 2020 · 5 comments
Labels
Auditbeat bug containers Related to containers use case discuss Issue needs further discussion. Stalled Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team

Comments

@adriansr
Copy link
Contributor

Please include configurations and logs if available.

For confirmed bugs, please report:

  • Version: n/a
  • Operating System: Linux
  • Discuss Forum URL: n/a
  • Steps to Reproduce:

The sample manifest for k8s provided in deploy/kubernetes/auditbeat-kubernetes.yaml uses the add_process_metadata and add_kubernetes_metadata to enrich events based on the process.pid field:

processors:
- add_cloud_metadata:
- add_process_metadata:
match_pids: ['process.pid']
include_fields: ['container.id']
- add_kubernetes_metadata:
host: ${NODE_NAME}
default_indexers.enabled: false
default_matchers.enabled: false
indexers:
- container:
matchers:
- fields.lookup_fields: ['container.id']

    processors:
      - add_cloud_metadata:
      - add_process_metadata:
          match_pids: ['process.pid']
          include_fields: ['container.id']
      - add_kubernetes_metadata:
          host: ${NODE_NAME}
          default_indexers.enabled: false
          default_matchers.enabled: false
          indexers:
            - container:
          matchers:
            - fields.lookup_fields: ['container.id']

The drawback of this approach is that it's sensitive to timing. If the process identified by process.pid has terminated by the time the add_process_metadata processor runs, the container.id lookup will fail and no k8s metadata will be added to the event.

This is causing some processes to not be to associated to a container at all, or the association to happen randomly.

@adriansr adriansr added bug discuss Issue needs further discussion. Auditbeat containers Related to containers use case Team:Integrations Label for the Integrations team labels Oct 28, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@ChrsMark ChrsMark added the Team:Platforms Label for the Integrations - Platforms team label Oct 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@efd6
Copy link
Contributor

efd6 commented Jan 3, 2022

Following up comment in 29410, because of the variety of contexts in /proc/N/cgroup and interactions with other parts of the ingest pipeline, I think an approach here would be to capture a copy of the cgroup file for a started process and allow the ingest pipeline to process out what it wants from there in much the same way that add_process_metadata does now.

@botelastic
Copy link

botelastic bot commented Jan 3, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Jan 3, 2023
@botelastic botelastic bot closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auditbeat bug containers Related to containers use case discuss Issue needs further discussion. Stalled Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

No branches or pull requests

4 participants