From 2365f518cad487cc4042b00aa4c6401cca0552e5 Mon Sep 17 00:00:00 2001 From: JD Kurma Date: Mon, 13 Nov 2023 14:15:39 -0600 Subject: [PATCH] [Security Solution] Remove Logs (#171119) ## Summary Remove endpoint metadata task logs ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### 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](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../security_solution/server/lib/telemetry/sender.ts | 2 +- .../server/lib/telemetry/tasks/endpoint.ts | 11 ----------- .../server/lib/telemetry/tasks/security_lists.ts | 5 ----- .../server/lib/telemetry/tasks/timelines.ts | 1 - 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts index 848f66c3aaf0a..39af813916cdd 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts @@ -409,7 +409,7 @@ export class TelemetryEventsSender implements ITelemetryEventsSender { counterType: 'docs_sent', incrementBy: events.length, }); - tlog(this.logger, `Events sent!. Response: ${resp.status} ${JSON.stringify(resp.data)}`); + tlog(this.logger, `Events sent!. Response: ${resp.status}`); } catch (err) { tlog(this.logger, `Error sending events: ${err}`); const errorStatus = err?.response?.status; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts index d3c40b29e218f..2c5eabe612c09 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts @@ -167,12 +167,10 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { policyInfo !== undefined && !endpointPolicyCache.has(policyInfo) ) { - tlog(logger, `policy info exists as ${policyInfo}`); const agentPolicy = await receiver.fetchPolicyConfigs(policyInfo); const packagePolicies = agentPolicy?.package_policies; if (packagePolicies !== undefined && isPackagePolicyList(packagePolicies)) { - tlog(logger, `package policy exists as ${JSON.stringify(packagePolicies)}`); packagePolicies .map((pPolicy) => pPolicy as PolicyData) .forEach((pPolicy) => { @@ -221,11 +219,6 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { ) : new Map(); - tlog( - logger, - `policy responses exists as ${JSON.stringify(Object.fromEntries(policyResponses))}` - ); - /** STAGE 4 - Fetch Endpoint Agent Metadata * * Reads Endpoint Agent metadata out of the `.ds-metrics-endpoint.metadata` data stream @@ -254,10 +247,6 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { }, new Map() ); - tlog( - logger, - `endpoint metadata exists as ${JSON.stringify(Object.fromEntries(endpointMetadata))}` - ); /** STAGE 5 - Create the telemetry log records * * Iterates through the endpoint metrics documents at STAGE 1 and joins them together diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts index 68a6fb643e1ba..04312e8843e28 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts @@ -21,7 +21,6 @@ import type { ESClusterInfo, ESLicense } from '../types'; import { batchTelemetryRecords, templateExceptionList, - tlog, createTaskMetric, formatValueListMetaData, } from '../helpers'; @@ -72,7 +71,6 @@ export function createTelemetrySecurityListTaskConfig(maxTelemetryBatch: number) licenseInfo, LIST_TRUSTED_APPLICATION ); - tlog(logger, `Trusted Apps: ${trustedAppsJson}`); count += trustedAppsJson.length; const batches = batchTelemetryRecords(trustedAppsJson, maxTelemetryBatch); @@ -91,7 +89,6 @@ export function createTelemetrySecurityListTaskConfig(maxTelemetryBatch: number) licenseInfo, LIST_ENDPOINT_EXCEPTION ); - tlog(logger, `EP Exceptions: ${epExceptionsJson}`); count += epExceptionsJson.length; const batches = batchTelemetryRecords(epExceptionsJson, maxTelemetryBatch); @@ -110,7 +107,6 @@ export function createTelemetrySecurityListTaskConfig(maxTelemetryBatch: number) licenseInfo, LIST_ENDPOINT_EVENT_FILTER ); - tlog(logger, `EP Event Filters: ${epFiltersJson}`); count += epFiltersJson.length; const batches = batchTelemetryRecords(epFiltersJson, maxTelemetryBatch); @@ -128,7 +124,6 @@ export function createTelemetrySecurityListTaskConfig(maxTelemetryBatch: number) clusterInfo, licenseInfo ); - tlog(logger, `Value List Meta Data: ${JSON.stringify(valueListMetaData)}`); if (valueListMetaData?.total_list_count) { await sender.sendOnDemand(TELEMETRY_CHANNEL_LISTS, [valueListMetaData]); } diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts index b6f7a4426f0c6..bd50ffcd92817 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts @@ -115,7 +115,6 @@ export function createTelemetryTimelineTaskConfig() { // Fetch event lineage const timelineEvents = await receiver.fetchTimelineEvents(nodeIds); - tlog(logger, `Timeline Events: ${JSON.stringify(timelineEvents)}`); const eventsStore = new Map(); for (const event of timelineEvents.hits.hits) { const doc = event._source;