Skip to content

Commit

Permalink
[Security Solution] Remove Logs (#171119)
Browse files Browse the repository at this point in the history
## 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 <[email protected]>
  • Loading branch information
JDKurma and kibanamachine authored Nov 13, 2023
1 parent 8613b0f commit 2365f51
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -221,11 +219,6 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) {
)
: new Map<string, EndpointPolicyResponseDocument>();

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
Expand Down Expand Up @@ -254,10 +247,6 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) {
},
new Map<string, EndpointMetadataDocument>()
);
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type { ESClusterInfo, ESLicense } from '../types';
import {
batchTelemetryRecords,
templateExceptionList,
tlog,
createTaskMetric,
formatValueListMetaData,
} from '../helpers';
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, SafeEndpointEvent>();
for (const event of timelineEvents.hits.hits) {
const doc = event._source;
Expand Down

0 comments on commit 2365f51

Please sign in to comment.