Fix parsing error in CiscoSecureEmail V15#9474
Merged
pkoutsovasilis merged 11 commits intomainfrom Apr 3, 2024
Merged
Conversation
15df2e2 to
923b581
Compare
🚀 Benchmarks reportTo see the full report comment with |
…consolidated event
0e36acd to
5405909
Compare
Contributor
|
@elastic/security-service-integrations can you help with a review here? |
efd6
reviewed
Apr 2, 2024
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Outdated
Show resolved
Hide resolved
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Show resolved
Hide resolved
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Outdated
Show resolved
Hide resolved
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Outdated
Show resolved
Hide resolved
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Outdated
Show resolved
Hide resolved
..._email_gateway/data_stream/log/elasticsearch/ingest_pipeline/pipeline_consolidated_event.yml
Outdated
Show resolved
Hide resolved
…ld for better grouping
… the mail subject
efd6
reviewed
Apr 2, 2024
..._gateway/data_stream/log/_dev/test/pipeline/test-common-consolidated-event.log-expected.json
Outdated
Show resolved
Hide resolved
…lude them in the reported error
…raction to improve readability
efd6
approved these changes
Apr 2, 2024
Comment on lines
+14
to
+15
| <14>Jul 04 06:21:54 consolidated_event: CEF:0|Cisco|C100V Email Security Virtual Appliance|14.3.0-032|ESA_CONSOLIDATED_LOG_EVENT|Consolidated Log Event|5|deviceExternalId=4FEF3A4372664BCCB404-20EE1767D434 ESAMID=786324 ESAICID=35635425 ESADCID=970897 endTime=Tue Jul 4 06:21:54 2023 ESADKIMVerdict=pass ESADLPVerdict=NOT_EVALUATED dvc=81.2.69.144 ESAFriendlyFrom=Beaches <playas@example.com> ESAGMVerdict=NEGATIVE startTime=Tue Jul 4 14:42:34 2023 deviceInboundInterface=IncomingMail deviceDirection=0 ESAMailFlowPolicy=ACCEPT suser=westinghouse-thoreau\\=example.com@example.com cs1Label=MailPolicy cs1=DEFAULT cs2Label=SenderCountry cs2=NZ ESAMFVerdict=MATCH act=QUARANTINED ESAFinalActionDetails=To SPAM cs4Label=ExternalMsgID cs4='<490b2a15fa4742331779cdaa4e@example.com>' ESAMsgSize=20668 ESAOFVerdict=NEGATIVE duser=thoreau@example.com ESAHeloDomain=example.com ESAHeloIP=89.160.20.112 ESAReplyTo=lane@example.com cfp1Label=SBRSScore cfp1=None ESASDRDomainAge=30 days (or greater) cs3Label=SDRThreatCategory cs3=N/A cs6Label=SDRRepScore cs6=Neutral ESASPFVerdict={'mailfrom': {'result': 'Pass', 'sender': 'westinghouse-thoreau=example.com@example.com'}, 'helo': {'result': 'Pass', 'sender': 'postmaster@example.com'}} sourceHostName=example.com sourceAddress=89.160.20.112 msg="Totally not suspicious email subject" ESATLSInCipher=ECDHE-RSA-AES256-GCM-SHA384 ESATLSInConnStatus=Success ESATLSInProtocol=TLSv1.2 ESAAMPVerdict=SKIPPED ESAASVerdict=SUSPECT ESAAVVerdict=NOT_EVALUATED ESACFVerdict=NO_MATCH | ||
| <14>Jul 04 06:21:54 test.hostname.co consolidated_event: CEF:0|Cisco|C100V Email Security Virtual Appliance|14.3.0-032|ESA_CONSOLIDATED_LOG_EVENT|Consolidated Log Event|5|deviceExternalId=4FEF3A4372664BCCB404-20EE1767D434 ESAMID=786324 ESAICID=35635425 ESADCID=970897 endTime=Tue Jul 4 06:21:54 2023 ESADKIMVerdict=pass ESADLPVerdict=NOT_EVALUATED dvc=81.2.69.144 ESAFriendlyFrom=Beaches <playas@example.com> ESAGMVerdict=NEGATIVE startTime=Tue Jul 4 14:42:34 2023 deviceInboundInterface=IncomingMail deviceDirection=0 ESAMailFlowPolicy=ACCEPT suser=westinghouse-thoreau\\=example.com@example.com cs1Label=MailPolicy cs1=DEFAULT cs2Label=SenderCountry cs2=NZ ESAMFVerdict=MATCH act=QUARANTINED ESAFinalActionDetails=To SPAM cs4Label=ExternalMsgID cs4='<490b2a15fa4742331779cdaa4e@example.com>' ESAMsgSize=20668 ESAOFVerdict=NEGATIVE duser=thoreau@example.com ESAHeloDomain=example.com ESAHeloIP=89.160.20.112 ESAReplyTo=lane@example.com cfp1Label=SBRSScore cfp1=None ESASDRDomainAge=30 days (or greater) cs3Label=SDRThreatCategory cs3=N/A cs6Label=SDRRepScore cs6=Neutral ESASPFVerdict={'mailfrom': {'result': 'Pass', 'sender': 'westinghouse-thoreau=example.com@example.com'}, 'helo': {'result': 'Pass', 'sender': 'postmaster@example.com'}} sourceHostName=example.com sourceAddress=89.160.20.112 msg="Totally not suspicious email subject" ESATLSInCipher=ECDHE-RSA-AES256-GCM-SHA384 ESATLSInConnStatus=Success ESATLSInProtocol=TLSv1.2 ESAAMPVerdict=SKIPPED ESAASVerdict=SUSPECT ESAAVVerdict=NOT_EVALUATED ESACFVerdict=NO_MATCH |
Contributor
There was a problem hiding this comment.
For other reviewers, the escaping that is removed here was incorrectly introduced in #6879.
bhapas
reviewed
Apr 3, 2024
..._gateway/data_stream/log/_dev/test/pipeline/test-common-consolidated-event.log-expected.json
Show resolved
Hide resolved
..._gateway/data_stream/log/_dev/test/pipeline/test-common-consolidated-event.log-expected.json
Show resolved
Hide resolved
…omain, sourceHostName, and shost
💚 Build Succeeded
History
|
|
aleksmaus
approved these changes
Apr 3, 2024
|
Package cisco_secure_email_gateway - 1.23.1 containing this change is available at https://epr.elastic.co/search?package=cisco_secure_email_gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

100.0% Coverage on New Code
0.0% Duplication on New Code
Proposed commit message
This PR refactors the extraction and parsing of the fields of a consolidated event for the cisco_secure_email_gateway integration. Specifically the issue is that the order of the keys (key1=val1 key2=val) defined here is not guaranteed. Thus this PR revisits this integration and makes it parsing all the possible fields without relying in order of appearance. The fixes are present even for pre-existing testing logs like missing verdicts here, missing in tls info here, missing subject here
Checklist
changelog.ymlfile.Author's Checklist
N/A
How to test this PR locally
Related issues
Screenshots
N/A