Skip to content

[Beaconing] Packaging Network Beaconing Detection - #7418

Merged
sodhikirti07 merged 28 commits into
mainfrom
packaging_beaconing
Oct 4, 2023
Merged

[Beaconing] Packaging Network Beaconing Detection#7418
sodhikirti07 merged 28 commits into
mainfrom
packaging_beaconing

Conversation

@sodhikirti07

@sodhikirti07 sodhikirti07 commented Aug 16, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

Package the beaconing detection model previously installed via dreml repo.

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

Points to review:

  • The README covers the description and steps to configure this package
  • Check for transform.yml and dashboard objects
  • Manifest has the right license version and description. Changelog points to correct PR.

How to test this PR locally

Use elastic-package build to build the package and stand up the stack locally using the following command:

                                    elastic-package stack up -d -v --version 8.8.0

Make sure the transform is installed and started before checking the dashboards.

Related issues

Screenshots

Screenshots are tracked in the comments below.

@sodhikirti07
sodhikirti07 requested a review from a team August 16, 2023 15:04
@elasticmachine

elasticmachine commented Aug 16, 2023

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-04T16:21:20.744+0000

  • Duration: 17 min 52 sec

Test stats 🧪

Test Results
Failed 0
Passed 4
Skipped 0
Total 4

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@sodhikirti07

sodhikirti07 commented Aug 16, 2023

Copy link
Copy Markdown
Contributor Author

Screenshots:

  • Package's README

image

  • Transform installed and collecting data successfully

image

  • Destination index of transform collecting data

image

  • Dashboards installed
image
  • Network Beaconing
image
  • Beaconing Drilldown

image

  • Hosts Affected Over Time By Process Name
image

@sodhikirti07
sodhikirti07 requested a review from a team August 16, 2023 15:14
Comment thread packages/beaconing/docs/README.md Outdated
- Name: `ml_beaconing_default`
- Custom data view ID: `ml_beaconing_default`
## Licensing
Usage in production requires that you have a license key that permits use of machine learning features. No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we didn't use to do it, but it might be good to start linking back to this page (or equivalent)
https://www.elastic.co/subscriptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Re-thinking: Guess we can remove this line as this package isn't using any ML features.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, true

Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
process.name: ["lsass.exe", "Microsoft Outlook", "omadmclient.exe", "OUTLOOK.EXE", "SettingSyncHost.exe", "SIHClient.exe", "POWERPNT.EXE", "svchost.exe", "uhssvc.exe"]
must_not:
terms:
destination.ip: ["10.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "127.0.0.0/8", "192.0.0.0/24", "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10", "192.175.48.0/24", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10", "FF00::/8", "13.64.0.0/11", "13.104.0.0/14", "13.96.0.0/13", "18.209.113.128/26", "20.33.0.0/16", "20.34.0.0/15", "20.36.0.0/14", "20.40.0.0/13", "20.48.0.0/12", "20.64.0.0/10", "20.128.0.0/16", "20.36.0.0/14", "20.34.0.0/15", "20.40.0.0/13", "20.128.0.0/16", "20.48.0.0/12", "20.33.0.0/16", "20.180.0.0/14", "20.184.0.0/13", "23.64.0.0/14", "23.32.0.0/11", "40.74.0.0/15", "40.76.0.0/14", "40.80.0.0/12", "40.96.0.0/12", "40.112.0.0/13", "40.120.0.0/14", "40.124.0.0/16", "40.126.0.0/18", "40.125.0.0/17", "52.132.0.0/14", "52.136.0.0/13", "52.148.0.0/14", "52.145.0.0/16", "52.146.0.0/15", "52.160.0.0/11", "52.152.0.0/13", "52.224.0.0/11"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Quick spot check: did we run linting on this package?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! I assumed you did, but hard to tell how the packages gets formatted (in terms of line breaks, lists etc.) as we've seen in the past xD

sodhikirti07 and others added 3 commits August 16, 2023 13:08
Co-authored-by: Susan <23287722+susan-shu-c@users.noreply.github.com>
Co-authored-by: Susan <23287722+susan-shu-c@users.noreply.github.com>

@ajosh0504 ajosh0504 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.

Awesome work, @sodhikirti07! Thanks for doing this! 🚀

Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
Comment thread packages/beaconing/docs/README.md Outdated
1. Ensure the pivot transform is installed and running.
2. Go to **Management > Stack Management > Kibana > Data Views**. Click on **Create data view** button and enable **Allow hidden and system indices** under the **Show Advanced settings**.
3. Create a data view with the following settings:
- Index pattern : `ml_beaconing_default`

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.

Same comment as above re: including space in the index name.

@ajosh0504

Copy link
Copy Markdown
Contributor

Wonder if we should also include a link to the Beaconing blog if users are curious about the inner workings of the transform itself, and the signals it produces?

sodhikirti07 and others added 9 commits August 22, 2023 10:26
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
…ee-b990-0d17f5be0d77.json

Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
@qn895
qn895 self-requested a review August 22, 2023 15:27
@qn895

qn895 commented Aug 22, 2023

Copy link
Copy Markdown
Member

Transform yml formats LGTM 🎉 Please note that with the use of the ingest pipeline in the transform, every package version update will also require a change in the transform version. This is because the ingest pipeline is named automatically by default by Fleet (e.g. in package version 2.0.0, the pipeline will be named 2.0.0-ml_beaconing_ingest_pipeline). So, even if the content of the ingest pipeline and transform rename the same in future versions, the names in the yml file will still have to be updated.

@sodhikirti07

Copy link
Copy Markdown
Contributor Author

Please note that with the use of the ingest pipeline in the transform, every package version update will also require a change in the transform version.

@qn895 I understand that upgrading the package will install a new ingest pipeline and transform named 2.0.0-ml_beaconing_ingest_pipeline and logs-beaconing.pivot_transform-default-2.0.0 respectively, but what would happen to the data collected by the previous transform given that the destination index remains the same?

@susan-shu-c

susan-shu-c commented Aug 23, 2023

Copy link
Copy Markdown
Member

Curious about this too

what would happen to the data collected by the previous transform given that the destination index remains the same?

If the destination index is set to index-name.all, then would the data just be put into the same index as before? Based on my understanding of the best practices document

@sodhikirti07

Copy link
Copy Markdown
Contributor Author

@qn895 Could you take a final look at the transform.yml? I tested the aliases by upgrading and downgrading the package and everything is working as expected.

@qn895

qn895 commented Aug 24, 2023

Copy link
Copy Markdown
Member

Latest changes with the aliases and format version LGTM 🎉 To clarify regarding:

If the destination index is set to index-name.all, then would the data just be put into the same index as before? Based on my understanding of the best practices document

The .all postfix is for index aliases. So for the following settings:

  aliases:
    - alias: ml_beaconing.latest
      move_on_creation: true
    - alias: ml_beaconing.all
      move_on_creation: false

In the next version upgrade (let's say for package v2.0.0 and transform version v2.0.0), ml_beaconing.latest alias will be updated to refer to ml_beaconing-2.0.0 index and ml_beaconing.all will refer to both ml_beaconing-1.0.0 and ml_beaconing-2.0.0 indices.

@sodhikirti07

Copy link
Copy Markdown
Contributor Author

There's a bug in the latest version release of elastic-package where aliases for the transforms aren't working as intended. Discussed it with @qn895 and she has opened a PR to fix the bug from fleet's end. She'll also spend some time troubleshooting it with the engineer responsible for elasticsearch/backend side of things.

@sodhikirti07
sodhikirti07 requested a review from ajosh0504 October 4, 2023 13:31
@sodhikirti07

Copy link
Copy Markdown
Contributor Author

Tested and installed the package in a serverless environment. The following screenshots confirm that all assets have been successfully installed without encountering any errors.

image

image

image

@ajosh0504 ajosh0504 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! 🚀

Comment thread packages/beaconing/manifest.yml
Comment thread packages/beaconing/docs/README.md
Comment thread packages/beaconing/docs/README.md
Comment thread packages/beaconing/changelog.yml Outdated
sodhikirti07 and others added 3 commits October 4, 2023 12:19
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Co-authored-by: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
@sodhikirti07
sodhikirti07 merged commit e199608 into main Oct 4, 2023
@elasticmachine

Copy link
Copy Markdown

Package beaconing - 1.0.0 containing this change is available at https://epr.elastic.co/search?package=beaconing

@andrewkroh andrewkroh added the Integration:beaconing Network Beaconing Identification label Jul 22, 2024
@andrewkroh andrewkroh added the New Integration Issue or pull request for creating a new integration package. label Aug 13, 2024
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
* Packaging network beaconing (with serverless support)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:beaconing Network Beaconing Identification New Integration Issue or pull request for creating a new integration package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants