Skip to content

Commit cee37b5

Browse files
authoredMay 11, 2023
Create migrating-to-events-2.0.md (microsoft#3098)
* Create migrating-to-events-2.0.md * Update migrating-to-events-2.0.md
1 parent 13b7272 commit cee37b5

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
 

‎docs/migrating-to-events-2.0.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
In an effort to increase the reliability of our event and webhook delivery, we are reducing the amount of data being sent. To account for the missing data, we added a new endpoint for downloading an event's complete payload.
2+
3+
## Example
4+
5+
### Current Event format
6+
7+
Here is an example webhook in Onefuzz version 8.1
8+
9+
```jsonc
10+
{
11+
"event": {
12+
"container": "container-name",
13+
"filename": "example.json",
14+
"report": {
15+
"asan_log": "example asan log",
16+
"call_stack": [
17+
"#0 line",
18+
"#1 line",
19+
"#2 line"
20+
],
21+
"call_stack_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
22+
"crash_site": "example crash site",
23+
"crash_type": "example crash report type",
24+
"executable": "fuzz.exe",
25+
"input_blob": {
26+
"account": "contoso-storage-account",
27+
"container": "crashes",
28+
"name": "input.txt"
29+
},
30+
"input_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
31+
"job_id": "00000000-0000-0000-0000-000000000000",
32+
"onefuzz_version": "1.2.3",
33+
"scariness_description": "example-scariness",
34+
"scariness_score": 10,
35+
"task_id": "00000000-0000-0000-0000-000000000000",
36+
"tool_name": "libfuzzer",
37+
"tool_version": "1.2.3"
38+
}
39+
},
40+
"event_id": "00000000-0000-0000-0000-000000000000",
41+
"event_type": "crash_reported",
42+
"instance_id": "00000000-0000-0000-0000-000000000000",
43+
"instance_name": "example",
44+
"webhook_id": "00000000-0000-0000-0000-000000000000",
45+
"sas_url": "https://example.com", // <------ THIS IS NEW
46+
"version": "1.0" // <------ THIS IS NEW
47+
}
48+
```
49+
50+
Notice the `sas_url` and `version` properties are new.
51+
52+
### Events 2.0 sent event format
53+
54+
When events 2.0 is released, the above event will be _sent_ like this:
55+
56+
```json
57+
{
58+
"event": {
59+
"container": "container-name",
60+
"report": {
61+
"input_blob": {
62+
"account": "contoso-storage-account",
63+
"container": "crashes",
64+
"name": "input.txt"
65+
},
66+
"job_id": "00000000-0000-0000-0000-000000000000",
67+
"task_id": "00000000-0000-0000-0000-000000000000",
68+
}
69+
},
70+
"event_id": "00000000-0000-0000-0000-000000000000",
71+
"event_type": "crash_reported",
72+
"instance_id": "00000000-0000-0000-0000-000000000000",
73+
"instance_name": "example",
74+
"webhook_id": "00000000-0000-0000-0000-000000000000",
75+
"sas_url": "https://example.com",
76+
"version": "2.0",
77+
"expiration_date": "01/01/2025"
78+
}
79+
```
80+
81+
You'll notice many fields are omitted.
82+
83+
**`event_id`, `event_type`, `instance_id`, `instance_name`, `webhook_id`, `sas_url`, `version`, `expiration_date` WILL ALWAYS BE INCLUDED**
84+
85+
### How to retrieve the full event payload
86+
87+
There are 3 options for retrieving the full event payload as it would have been sent in events 1.0
88+
89+
1. Using the `sas_url` that is included in the event
90+
2. Using the new events API at `GET https://{onefuzz instance}/api/events` with a request body `{ "event_id": "00000000-0000-0000-0000-000000000000" }`
91+
3. Using the onefuzz cli `onefuzz events get "00000000-0000-0000-0000-000000000000"`
92+
93+
The event payload data will only be retained until the expiration date. We are currently planning to retain event data for 90 days but this may change in the future.
94+
95+
_**You can migrate your event handling code today to use any of those 3 options so that you will be unaffected by the future breaking change.**_

0 commit comments

Comments
 (0)
Please sign in to comment.