-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add a body_length
field to http_request
and http_response
#1141
Conversation
5bb3ff4
to
3233da9
Compare
This look good, but can we use |
The reason: A maliciously crafted HTTP requests can have a However, your proposal made me thought: should we just add an array of key-value pairs that represent the header name and value? |
OK. Makes sense. Perhaps put that in the description, like "actual length of body, independent of Content-Length header, if any".
OCSF generally tries to avoid open-ended up definitions like this. Instead consider a fixed set of attributes. (Also as an aside, key-value pairs would more naturally fit in an object than in any array of objects, each with a single field.) |
both http_request and http_response have a http_headers attribute which is an array of http_header object with name & value attributes. |
Signed-off-by: Matthias Vallentin <[email protected]>
Signed-off-by: Matthias Vallentin <[email protected]>
Signed-off-by: Matthias Vallentin <[email protected]>
3233da9
to
597aa8b
Compare
@rmouritzen-splunk I've pushed a commit to clarify the relationship to the
Oh right, it's already there! 🙈 |
CI complains about a |
body_length
field to http_request
body_length
field to http_request
and http_response
Attributes require a type. This one should probably be
Convention for adding attributes is to add them in the A less desirable alternative would be to add See the definition of Line 2668 in a656184
|
Also: sorry for the confusing error message from the CI job. I'll think on it. |
@mavam As @query-jeremy said, the The core idea is that all attributes used anywhere in the schema need to be defined in a dictionary. Since you're modifying objects in the base of the schema, add these to the base {
"caption": "Attribute Dictionary",
"description": "The Attribute Dictionary ...",
"name": "dictionary",
"attributes": {
// ...
"bios_ver": {
"caption": "BIOS Version",
"description": "The BIOS version. For example: <code>LENOVO G5ETA2WW (2.62)</code>.",
"type": "string_t"
},
// We typically add attributes in sorted order, so add body_length here
"body_length": {
"caption": "Request Body Length",
"description": "The actual length of the HTTP request body, in number of bytes, independent of a potentially existing Content-Length header.",
"type": "long_t"
},
"boot_time": {
"caption": "Boot Time",
"description": "The time when the system was booted.",
"type": "timestamp_t"
},
// ...
} I'm guessing This also defines the attribute's |
This will be added as a part of a separate PR by @zschmerber-atlassian. Closing this one out. |
This PR adds a new field to the
http_[request|response]
objects calledbody_length
that captures the length of the HTTP request body. The existing fieldlength
describes the entire length of the HTTP request, including headers.Delete once you have confirmed the following: