Skip to content

Problem child ingest pipeline bug - #11367

Merged
sodhikirti07 merged 8 commits into
elastic:mainfrom
r0ot:patch-1
Jan 6, 2025
Merged

Problem child ingest pipeline bug#11367
sodhikirti07 merged 8 commits into
elastic:mainfrom
r0ot:patch-1

Conversation

@r0ot

@r0ot r0ot commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

Proposed commit message

The painless script if block serving as the entry point into the problem child inference pipeline has a bug in its logic checking for the appropriate host operating system. It separates its checks for various sub-fields of host.os and it's actual accessing of those fields from the ctx object, potentially leading to errors trying to access keys that don't exist.

For example, if a document contains host.os.family but doesn't contain host.os.type, this painless script will raise an error instead of simply failing.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@r0ot
r0ot requested review from a team as code owners October 8, 2024 19:21
@andrewkroh andrewkroh added bugfix Pull request that fixes a bug issue Integration:problemchild Living off the Land Attack Detection Team:Security-Applied ML Elastic Security Protections Machine Learning (ML) team [elastic/sec-applied-ml] labels Oct 8, 2024
@sodhikirti07

Copy link
Copy Markdown
Contributor

@r0ot Could you provide an example document that is causing the pipeline errors?

@r0ot

r0ot commented Oct 8, 2024

Copy link
Copy Markdown
Contributor Author

@r0ot Could you provide an example document that is causing the pipeline errors?

I don't have a real-world document I could provide but the example I gave in my description should be sufficient. If the user's datasource isn't elastic endpoint and only provided host.os.family or host.os.platform without host.os.type it would trigger this bug.

@susan-shu-c

susan-shu-c commented Oct 9, 2024

Copy link
Copy Markdown
Member

Hi, @r0ot we are testing this, can you also share what Elastic stack version you are using, as well as the ProblemChild/Living off the Land Detection package version you are on?

@r0ot

r0ot commented Oct 9, 2024

Copy link
Copy Markdown
Contributor Author

Upon testing, this doesn't raise an error like I thought, it rather just returns false. The notation used here could be cleaned up with ?. accesses to make the logic more concise and avoid confusion in the future. I've updated this PR with the updated notation.

So not a bug but an improvement.

Comment thread packages/problemchild/changelog.yml
@r0ot
r0ot requested a review from andrewkroh October 10, 2024 17:32
@susan-shu-c

Copy link
Copy Markdown
Member

Hi, thanks again for the PR; for now we're considering rolling this up into the next release we make for this package. Will keep you posted!

@qcorporation

qcorporation commented Nov 1, 2024

Copy link
Copy Markdown
Contributor
@botelastic

botelastic Bot commented Dec 1, 2024

Copy link
Copy Markdown

Hi! We just realized that we haven't looked into this PR 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 Dec 1, 2024
@andrewkroh

Copy link
Copy Markdown
Contributor

/test

@botelastic botelastic Bot removed the Stalled label Dec 2, 2024

@andrewkroh andrewkroh 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

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

@botelastic

botelastic Bot commented Jan 3, 2025

Copy link
Copy Markdown

Hi! We just realized that we haven't looked into this PR 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, 2025
@sodhikirti07
sodhikirti07 merged commit 45246fc into elastic:main Jan 6, 2025
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package problemchild - 2.2.0 containing this change is available at https://epr.elastic.co/package/problemchild/2.2.0/

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
Updated problem_child_ingest_pipeline.yml
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
Updated problem_child_ingest_pipeline.yml
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:problemchild Living off the Land Attack Detection Stalled Team:Security-Applied ML Elastic Security Protections Machine Learning (ML) team [elastic/sec-applied-ml]

7 participants