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

Osquerybeat: add extension uptycs/kubequery #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yashtewari
Copy link

What does this PR do?

This is a candidate PR to integrate https://github.com/Uptycs/kubequery into osquerybeat as an extension.

This is a work in progress.

Why is it important?

There are some teams, such as Cloud Security Posture, who need Kube API information to be sent from client clusters to Elasticsearch. Leveraging the existing open source extension https://github.com/Uptycs/kubequery and combining it with osquerybeat is a good way to achieve this.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

The changes done to achieve this are broadly as follows. Please advise for each of them if its the best way forward.

  1. Bring the https://github.com/Uptycs/kubequery repository into osquerybeat as a submodule.
  2. Add an option WorkDir to the beats build library. This allows for running Go build in a specific working directory, an option that I couldn't find in the library.
  3. Update the Mage build to include building the new extensions.
  4. Update osquerybeat's runtime extension handling to have multiple "mandatory beats", rather than just one.

How to test this PR locally

mage build for osquerybeat should show that it's building kubequery as well, and the binary for the extension should show up in the osquerybeat directory.

Running the osquerybeat binary should show debug logs for kubequery plugins being registered, or errors if for example the Kube configuration file is not present/doesn't work.

Related issues

Use cases

Screenshots

Logs

This submodule includes the uptycs/kubequery repository within
beats. This repository implements an osquery extension for Kube
API information, and will be used by osquerybeat for this purpose.
The new WorkDir option added to the build library gives an option
to change the current working directory before performing builds.
Also added kubequery binaries and such to .gitignore
Minor changes allow osquerybeat to support multiple 'required'
extensions instead of just osquery-extension`.

kubequery is added as a required extension.
@yashtewari yashtewari added the enhancement New feature or request label Nov 3, 2021
@amirbenun amirbenun force-pushed the master branch 2 times, most recently from 11f3b3c to e8023f6 Compare January 18, 2022 14:20
@amirbenun
Copy link

Can we close it? @yashtewari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants