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

Fix issue with parsing out endpoint package policy. #123287

Merged
merged 3 commits into from
Jan 18, 2022

Conversation

pjhampton
Copy link
Contributor

Summary

We found an edge case on customer deployments where the telemetry was going dark due to a type error. While the root cause of why this is happening hasn't been established, the optional chaining and defaulting circumvents the reproducible type error.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@pjhampton pjhampton requested a review from a team as a code owner January 18, 2022 19:07
@pjhampton pjhampton self-assigned this Jan 18, 2022
@pjhampton pjhampton added auto-backport Deprecated - use backport:version if exact versions are needed Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.17.0 v8.0.0 v8.1.0 labels Jan 18, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@pjhampton pjhampton added release_note:skip Skip the PR/issue when compiling release notes bug Fixes for quality problems that affect the customer experience Feature:Telemetry labels Jan 18, 2022
@pjhampton pjhampton enabled auto-merge (squash) January 18, 2022 19:53
Copy link
Contributor

@donaherc donaherc left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -145,11 +146,11 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) {
packagePolicies
.map((pPolicy) => pPolicy as PolicyData)
.forEach((pPolicy) => {
if (pPolicy.inputs[0].config !== undefined) {
if (pPolicy.inputs[0]?.config !== undefined && pPolicy.inputs[0]?.config !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, can see how this would error.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @pjhampton

@pjhampton pjhampton merged commit 4d98af8 into main Jan 18, 2022
@pjhampton pjhampton deleted the pjhampton/fix-ep-policy-extraction branch January 18, 2022 22:04
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 18, 2022
* Fix issue with parsing out endpoint package policy.

* revert schedule.

(cherry picked from commit 4d98af8)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.0
7.17 Backport failed because of merge conflicts

How to fix

Re-run the backport manually:

node scripts/backport --pr 123287

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

pjhampton added a commit that referenced this pull request Jan 19, 2022
…123351)

* Fix branch divergence.

* Fix 7.17 telemetry branch divergence.

* Update formatting.
kibanamachine added a commit that referenced this pull request Jan 20, 2022
* Fix issue with parsing out endpoint package policy.

* revert schedule.

(cherry picked from commit 4d98af8)

Co-authored-by: Pete Hampton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience Feature:Telemetry release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.17.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants