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

[symantec_endpoint] Parse all times relative to configured TZ offset #6509

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jun 8, 2023

What does this PR do?

Use the configured time zone offset when interpreting all times. Previously only the syslog header and log export header were interpreted using the time zone offset and other times within the event were treated as if the were UTC. Based on new information we now assume that all times are relative to the time zone offset.

Fixes #6499

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.

Use the configured time zone offset when interpreting all times. Previously
only the syslog header and log export header were interpreted using the
time zone offset and other times within the event were treated as if the were
UTC. Based on new information we now assume that all times are relative
to the time zone offset.

Fixes elastic#6499
andrewkroh added a commit to andrewkroh/integrations that referenced this pull request Jun 8, 2023
[git-generate]
cd packages/symantec_endpoint
elastic-package changelog add --link elastic#6509 --next patch --type bugfix --description "Parse all times relative to the configuretimezone offset."
@andrewkroh andrewkroh force-pushed the symantec_endpoint/bugfix/all-times-tz-offset branch from 90461ea to 273bae2 Compare June 8, 2023 02:53
[git-generate]
cd packages/symantec_endpoint
elastic-package changelog add --link elastic#6509 --next patch --type bugfix --description "Parse all times relative to the configuretimezone offset."
@andrewkroh andrewkroh force-pushed the symantec_endpoint/bugfix/all-times-tz-offset branch from 273bae2 to cffd5d0 Compare June 8, 2023 02:54
@andrewkroh andrewkroh marked this pull request as ready for review June 8, 2023 02:54
@andrewkroh andrewkroh requested a review from a team as a code owner June 8, 2023 02:54
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@elasticmachine
Copy link

elasticmachine commented Jun 8, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-08T14:17:32.099+0000

  • Duration: 17 min 2 sec

Test stats 🧪

Test Results
Failed 0
Passed 24
Skipped 0
Total 24

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

You beat me by a couple of minutes. Can we add the second case provided in the issue as a test?

@elasticmachine
Copy link

elasticmachine commented Jun 8, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚 6.25
Classes 100.0% (1/1) 💚 6.25
Methods 100.0% (19/19) 💚 14.079
Lines 98.921% (825/834) 👍 12.996
Conditionals 100.0% (0/0) 💚

@andrewkroh
Copy link
Member Author

Sorry, I should have marked myself as assigned.

@andrewkroh
Copy link
Member Author

Can we add the second case provided in the issue as a test?

Will do. Waiting on a few details. #6499 (comment)

@efd6
Copy link
Contributor

efd6 commented Jun 8, 2023

What I did was

diff --git a/packages/symantec_endpoint/data_stream/log/_dev/test/pipeline/test-policy.log b/packages/symantec_endpoint/data_stream/log/_dev/test/pipeline/test-policy.log
index e25d3a581..6f6dc0796 100644
--- a/packages/symantec_endpoint/data_stream/log/_dev/test/pipeline/test-policy.log
+++ b/packages/symantec_endpoint/data_stream/log/_dev/test/pipeline/test-policy.log
@@ -1 +1,2 @@
 Site: SEPSite,Server: exampleHostname,Domain: exampleDomain,Admin: exampleAdmin,Event Description: Policy has been edited: Edited shared Intrusion Prevention policy: SEPPolicyName,SEPPolicyName
+Jun 7 09:16:10 SERVER SymantecServer: DESKTOP,Category: 0,Smc,Event Description: Received a new policy with serial number AB13-05/30/2023 23:01:52 031 from Symantec Endpoint Protection Manager.,Event time: 2023-06-07 09:09:54

which gave sensible results.

Log sample given by the user was from SEP 14.3RU7. It was received over syslog.
It appears in the "Client Management Logs" section of the SEP client.

It looks like a "Policy log" so that's how I named the file, but I'm not confident so
I didn't not edit the pipeline to apply event.provider: Policy Log to the event.

The log contained a "group_name" field but we already have a "group" field so
I made a pipeline change so that it becomes `symantec_endpoint.log.group`.
@andrewkroh andrewkroh merged commit 037f5ab into elastic:main Jun 8, 2023
3 checks passed
@elasticmachine
Copy link

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

1 similar comment
@elasticmachine
Copy link

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

sodhikirti07 pushed a commit that referenced this pull request Jun 15, 2023
…6509)

* symantec_endpoint - parse all times relative to configured TZ offset

Use the configured time zone offset when interpreting all times. Previously
only the syslog header and log export header were interpreted using the
time zone offset and other times within the event were treated as if the were
UTC. Based on new information we now assume that all times are relative
to the time zone offset.

Fixes #6499

* Add test case

Log sample given by the user was from SEP 14.3RU7. It was received over syslog.
It appears in the "Client Management Logs" section of the SEP client.

It looks like a "Policy log" so that's how I named the file, but I'm not confident so
I didn't not edit the pipeline to apply event.provider: Policy Log to the event.

The log contained a "group_name" field but we already have a "group" field so
I made a pipeline change so that it becomes `symantec_endpoint.log.group`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[symantec_endpoint] Timezone issues when ingesting message with "Event time:"
3 participants