Updates to the ProblemChild and DGA integration packages - #3777
Conversation
This reverts commit bf968cc.
|
@mtojek Does this update to the packages count as a new version or the same? I was hoping for this to be a sort of bug fix PR for the existing packages. P.S. I just noticed that some of the rules in the initial packages have some version 2s- maybe we want to reset those to 1? I can take care of that in this PR too- not sure if this breaks stuff for users who have the packages currently installed? Then again we're calling these packages "experimental" so might be better to focus on fixing things regardless, for now. @brokensound77 Any thoughts on this^ |
There was a problem hiding this comment.
Please check to make sure the structure of the data_stream directory in both the packages looks correct
Please make sure that CI passes for this PR. CI uses elastic-package tool to validate against the package-spec.
Is a manifest.yml file in the data_stream/predictions directory mandatory?
Manifest describes the data stream and if you want to have data stream it's mandatory. I see that you don't have much experience with package development, so you may find this blog post helpful.
What should it contain?
As I replied to you over Slack, the content is defined by package-spec. Any property that is "legal", must be defined by spec.
Since I am adding new index mappings to the packages, is there anything else required other than this integrations PR?
I don't know, not sure what are you trying to achieve. You've implemented an incomplete data stream - just added a few fields, and modified ingest pipeline and security rules. Please sync with @alvarezmelissa87 who has already successfully contributed to Integrations.
Does this update to the packages count as a new version or the same? I was hoping for this to be a sort of bug fix PR for the existing packages.
If you want to release those changes, you need to bump up the version and add a corresponding changelog entry. There is a background job set to determine if the package version has been updated and if so, it syncs changes with Package Storage.
|
@mtojek Thanks for the detailed response. Looks like CI is indeed failing on the missing manifests now. I was reading your blog post but looks like the example you walk through is for a new integration, creating a new data stream. I'm working with an existing package and existing data streams, specifically the Eitherway, I'll follow-up with @alvarezmelissa87 and see where we end up on this. Thanks! |
|
Tested the packages with |
| if (ctx.containsKey('process') && ctx['process'].containsKey('Ext') && ctx['process']['Ext'].containsKey('code_signature') && ctx['process']['Ext']['code_signature'].containsKey('exists')) { | ||
| ctx.feature_process_signed = ctx['process']['Ext']['code_signature']['exists'] | ||
| } else if (ctx.containsKey('process') && ctx['process'].containsKey('code_signature') && ctx['process']['code_signature'].containsKey('exists')) { | ||
| if (ctx.containsKey('process') && ctx['process'].containsKey('code_signature') && ctx['process']['code_signature'].containsKey('exists')) { |
There was a problem hiding this comment.
This can safely be expressed as ctx.process?.code_signature?.exists != null using the null-safe operator.
There was a problem hiding this comment.
We could cover this in a follow-up PR, since this PR only deals with bug fixes?
| "minimum_should_match": 1, | ||
| "should": [ | ||
| { | ||
| "bool": { |
There was a problem hiding this comment.
Could you explain why this filter isn't needed anymore?
There was a problem hiding this comment.
The original query basically translated to checking whether the fields ["process.name", "host.hostname", "process.command_line"] were present OR if the problemchild.prediction_probability field was present.
This is not what we want to check for, I don't think. We want to check if the events being passed to the anomaly detection jobs either have a problemchild. prediction or a blocklist_label, which is what I changed the query to.
As an aside, I also cross-checked with DGA, and the query there seems to match what's in the datafeeds as well, which is basically what I've done.
There was a problem hiding this comment.
Is that not what the query should reflect?
|
Overall LGTM. Re: the questions in the description - I don't see any |
Right, updated the description. |
|
@alvarezmelissa87 Here's screenshots to prove that things are working as expected: DGA
ProblemChild
|
| "DGA", | ||
| "ML", | ||
| "Supervised", | ||
| "Anomalies" |
There was a problem hiding this comment.
how is Anomalies meant to be used? Seems kinda generic?
same for ML vs. Supervised - are these intended for internal use, or to be exposed to the customer?
There was a problem hiding this comment.
We want to expose Anomalies vs Advanced Threats in the centralized Entity Analytics page. Anomalies would be things flagged as suspicious by individual ML jobs. Advanced Threats are things flagged as suspicious by more than one method.
For example, in ProblemChild, suspicious events are identified by a supervised model and an anomaly detection job.
ML is a generic tag for all ML jobs in the Security solution. Supervised vs Unsupervised is based on which model contributed to the event being flagged as anomalous. Now that I think about it, this might be too much information for the user.
There was a problem hiding this comment.
This helps a lot, thank you!
I think maybe it would help to write this up in a separate doc (since it might be hard to track back to this ticket later)
There was a problem hiding this comment.
ok, discussed with Sourin and put a couple comments in the spreadsheet, but the short version is that as far as the product is concerned, we only need 3 kinds of tags:
- package tags - what rules and dashboards are tied to a package
- threat category (internal vs. external threat) for future product features
- entity tag (user vs. host)
For the others, if we want internal tags for our own tracking/packaging/debugging/support purposes, that's good to know, just want to make sure we're keeping an eye on that as we along, so we don't end up with a proliferation of unused/overlapping/incorrect tag tech debt like we have on the malware pipelines.
| "ML", | ||
| "DGA" | ||
| "Unsupervised", | ||
| "Advanced Threats" |
There was a problem hiding this comment.
what constitutes an Advanced Threat? Do we have a list of what's included in those? (also, why am I having deja vu as I write this?)
There was a problem hiding this comment.
Refer to the comment above.
* Fixing some bugs, adding mappings, tags etc. * Updating version numbers * Revert "Updating version numbers" This reverts commit 9b74911. * Formatting yml files * Updating changelog and version * Update ml_dga_inference_pipeline.yml * Updated the problemchild query * Deleting data_stream folder since it's not necessary * Updating rule numbers * Updating changelog with specifics of what bugs were fixed * Updating detector descriptions and changelog * formatting changelog * Adding better tags to rules, influencers where necessary * Finalizing rule tags * Adding missing influencers Co-authored-by: Wei Wang <47184485+wwang500@users.noreply.github.com>








What does this PR do?
Changes made:
problemchild-ml.jsondga_inference_pipelinescript.Checklist
changelog.ymlfile.Related issues