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

[jamf_pro] Various minor improvements and fixes #11065

Merged
merged 13 commits into from
Sep 15, 2024

Conversation

chrisberkhout
Copy link
Contributor

@chrisberkhout chrisberkhout commented Sep 10, 2024

Proposed commit message

[jamf_pro] Various minor improvements and fixes

Mostly tidying of the README and pipelines, but also some small fixes.

Reviews should probably focus on the pipelines.

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.

Related issues

@chrisberkhout chrisberkhout added bugfix Pull request that fixes a bug issue Integration:jamf_pro Jamf Pro labels Sep 10, 2024
@chrisberkhout chrisberkhout self-assigned this Sep 10, 2024
@chrisberkhout chrisberkhout requested a review from a team as a code owner September 10, 2024 16:59
@andrewkroh andrewkroh added dashboard Relates to a Kibana dashboard bug, enhancement, or modification. and removed Integration:jamf_pro Jamf Pro labels Sep 10, 2024
@chrisberkhout chrisberkhout added the Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] label Sep 10, 2024
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@chrisberkhout chrisberkhout enabled auto-merge (squash) September 11, 2024 12:24
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @chrisberkhout

Copy link

Quality Gate failed Quality Gate failed

Failed conditions
73.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@chrisberkhout chrisberkhout merged commit 2eea5ec into elastic:main Sep 15, 2024
4 of 5 checks passed
@elasticmachine
Copy link

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

@chrisberkhout
Copy link
Contributor Author

Here is a summary of the main things that came up in this PR, which will help with future integration development.

Aligning input config, pipeline test input and pipeline logic:

  • There was some config missing from http_endpoint.yml.hbs which meant that the rename at the start of the events pipeline wasn't being run, because the json key was never populated. It's tricky but very important to make sure that the pipeline test input data and the live events arrive at the pipeline in the same format.

  • There was a related data structure/pipeline start error in the inventory pipeline where fingerprinting was attempted on fields in root that were actually nested in "message".

Painless and the null-safe operator

  • The null-safe operator, and Painless in general, can only be used if a processor option allows it. It's okay for if options, but values for field or copy_from options should be plain names, not Painless fragments. If you need to account for a name not existing, you can use options like ignore_missing or add an if condition so the processor only runs under the correct conditions.

  • Use the null-safe operator after a thing that may or may not exist (not before). It's okay to use one key that doesn't exist (that will return null). So, in the example ctx.jamf_pro.events.event?.ip_address != null, if event exists the null-safe operator is redundant.

Append to make arrays

The related.* ECS fields should be arrays regardless of how many items they have, so use append rather than set.

CEL formatting

There is a new tool for formatting CEL programs: https://github.com/efd6/celfmt We encourage using this now. I recommend using it via this bash alias.

README

I tidied up the README a bit. I added a little bit of text but mostly it was about cleaning up the formatting. Below there is an image showing the rendered versions side-by-side. The red arrows mark some of the more significant formatting improvements. The goal is to use structure, emphasis, etc. consistently to make it easier to read. Ideally the unrendered markdown will also be nicely formatted and readable.

readme-side-by-side-marked-up

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 dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:jamf_pro Jamf Pro Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants