-
Notifications
You must be signed in to change notification settings - Fork 531
proofpoint_tap: ensure cursor state is published when a query has been made #11475
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
Conversation
…n made When we receive no event from the Proofpoint TAP API, we need to publish an event even though there is no event to publish. The mechanics of cursor updates in the HTTPJSON input are that the cursor is updated when an event is published, so if we get a response with no event, the input assumes that there has been no new event and so (incorrectly) no progress, but we know that having received an empty response from the API, there is definitively no event in the requested time slice. So we can and should avoid querying that time slice again, and should update the cursor to the end of the time slice. This HTTPJSON behaviour is not documented, but is visible in the source code and is experimentally verified. So, publish the parent object in the case that there is no actual event in order to update the cursor, and adjust the ingest pipeline to allow it to tolerate an empty response.
b6d2cfa to
75d4376
Compare
🚀 Benchmarks reportPackage
|
| Data stream | Previous EPS | New EPS | Diff (%) | Result |
|---|---|---|---|---|
clicks_permitted |
4329 | 2777.78 | -1551.22 (-35.83%) | 💔 |
To see the full report comment with /test benchmark fullreport
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nits only
| {"url":"https://www.example.com/url?q=httpabc12345","classification":"spam","clickTime":"2022-03-30T07:10:19.000Z","threatTime":"2022-03-29T09:27:21.000Z","userAgent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36","campaignId":"46x01x8x-x899-404x-xxx9-111xx393d1x7","id":"85219a90-1234-1234-1234-axx5xx4xxxfxxxx","clickIP":"89.160.20.112","sender":"abc123@example.com","recipient":"b81458bb9f757994e79a9287b8447622@example.com","senderIP":"81.2.69.143","GUID":"JXXXXaXehXHXzX-XxXhXyXXXXX7","threatID":"eaxxxxxxxxxxxx6376xxxxxxxxxxx1cba65xxx9x7xxxxxxxxxxfbbxx4x0","threatURL":"https://threatinsight.proofpoint.com/a2abc123-1234-1234-1234-babcded1234/threat/email/eaxxxxxa6597fd3xxxxxxxxx92e4xxxxxxxxxx27c98052fxxxxxxxxxx1234","threatStatus":"active","messageID":"12345678912345.12345.mail@example.com"} | ||
| {"url":"https://www.example.org/abcdabcd123?query=0","classification":"malware","clickTime":"2022-03-30T10:11:12.000Z","threatTime":"2022-03-21T14:40:31.000Z","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/199.0.427504638 Mobile/15E148 Safari/604.1","campaignId":"46x01x8x-x899-404x-xxx9-111xx393d1x7","id":"a5c9f8bb-1234-1234-1234-dxx9xcxxxx8xxxc","clickIP":"89.160.20.112","sender":"abc123@example.com","recipient":"9c52aa64228824247c48df69b066e5a7@example.com","senderIP":"81.2.69.143","GUID":"XXcXXxXDXVXXXXXXXXXXXX4XXXXX","threatID":"502bxxxxxxxxxxx70513b6cxxxxxxxxxxxxebc7fc699xxxxxxxxxxxxxxxxd5f","threatURL":"https://threatinsight.proofpoint.com/a2abc123-1234-1234-1234-babcded1234/threat/email/502xxxxxxxxxcebxxxxxxxxxxa04277xxxxx5dxc6xxxxxxxxx5f","threatStatus":"active","messageID":"12345678912345.12345.mail@example.com"} | ||
| {"url":"https://www.example.org","classification":"spam","clickTime":"2022-03-30T10:01:01.000Z","threatTime":"2022-03-14T05:59:12.000Z","userAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36","campaignId":"46x01x8x-x899-404x-xxx9-111xx393d1x7","id":"d35cc5fc-1234-1234-1234-2xxx0xaxbxcxx","clickIP":"89.160.20.112","sender":"abc123@example.com","recipient":"xyz@example.com","senderIP":"81.2.69.143","GUID":"uHXXXJXTXlXDXmXgXTX3XOXLNXVXNX3XXXHX","threatID":"47580xdx0x2x5x2xfx8x3x3x7x7xxxxcx6x7x4x4x1xexcx5cx9x3xfxfxxx1","threatURL":"https://threatinsight.proofpoint.com/a2abc123-1234-1234-1234-babcded1234/threat/email/4xxxxd02xxxxxxxxxxxxcacf9da3xxxxxxxxxxx9a947xxxxxxxxxx1","threatStatus":"active","messageID":"12345678912345.12345.mail@example.com"} | ||
| {"queryEndTime":"2024-10-11T14:34:53Z","clicksBlocked":[]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline ?
💚 Build Succeeded
History
cc @efd6 |
|
|
Package proofpoint_tap - 1.24.2 containing this change is available at https://epr.elastic.co/search?package=proofpoint_tap |
…n made (elastic#11475) When we receive no event from the Proofpoint TAP API, we need to publish an event even though there is no event to publish. The mechanics of cursor updates in the HTTPJSON input are that the cursor is updated when an event is published, so if we get a response with no event, the input assumes that there has been no new event and so (incorrectly) no progress, but we know that having received an empty response from the API, there is definitively no event in the requested time slice. So we can and should avoid querying that time slice again, and should update the cursor to the end of the time slice. This HTTPJSON behaviour is not documented, but is visible in the source code and is experimentally verified. So, publish the parent object in the case that there is no actual event in order to update the cursor, and adjust the ingest pipeline to allow it to tolerate an empty response.
…n made (elastic#11475) When we receive no event from the Proofpoint TAP API, we need to publish an event even though there is no event to publish. The mechanics of cursor updates in the HTTPJSON input are that the cursor is updated when an event is published, so if we get a response with no event, the input assumes that there has been no new event and so (incorrectly) no progress, but we know that having received an empty response from the API, there is definitively no event in the requested time slice. So we can and should avoid querying that time slice again, and should update the cursor to the end of the time slice. This HTTPJSON behaviour is not documented, but is visible in the source code and is experimentally verified. So, publish the parent object in the case that there is no actual event in order to update the cursor, and adjust the ingest pipeline to allow it to tolerate an empty response.




Proposed commit message
When we receive no event from the Proofpoint TAP API, we need to publish an event even though there is no event to publish. The mechanics of cursor updates in the HTTPJSON input are that the cursor is updated when an event is published, so if we get a response with no event, the input assumes that there has been no new event and so (incorrectly) no progress, but we know that having received an empty response from the API, there is definitively no event in the requested time slice. So we can and should avoid querying that time slice again, and should update the cursor to the end of the time slice. This HTTPJSON behaviour is not documented, but is visible in the source code and is experimentally verified. So, publish the parent object in the case that there is no actual event in order to update the cursor, and adjust the ingest pipeline to allow it to tolerate an empty response.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots