[RFC] Create Mach-O - Stage 1 Proposal#1346
[RFC] Create Mach-O - Stage 1 Proposal#1346peasead wants to merge 49 commits intoelastic:mainfrom peasead:file.macho-create
Conversation
rebasing
Prepare link to Logs docs changing with the 7.10 release in "products…
Prepare link to Logs docs changing with the 7.10 release in "getting-…
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
Co-authored-by: Eric Beahan <ebeahan@gmail.com>
Co-authored-by: Derek Ditch <dcode@users.noreply.github.com>
Co-authored-by: Derek Ditch <dcode@users.noreply.github.com>
|
Thanks for the update @dcode |
|
Since we're losing some context from the original PR #1097, was there ever a final resolution for this discussion? #1097 (comment) |
rfcs/text/0000-create-file-macho.md
Outdated
| | macho.headers.flags | keyword | Flags set in the Mach-O header. | | ||
| | macho.segments | nested | Segment information for the file. | | ||
| | macho.segments.name | keyword | Name of this segment. | | ||
| | macho.segments.physical_offset | long | File offset of this segment. | |
There was a problem hiding this comment.
The macho.segments fields in the sample field definitions are using:
macho.segments.fileoffmacho.segments.filesizemacho.segments.flagsmacho.segments.namemacho.segements.offsetmacho.segments.sectionsmacho.segements.sizemacho.segments.vmaddrmacho.segments.vmsize
Looks like there's some alignment, but some fields are mismatched. I prefer the more verbose naming here in the table.
There was a problem hiding this comment.
Agree, the more verbose naming is better. We'll get that cleaned up.
devonakerr
left a comment
There was a problem hiding this comment.
LGTM - sorry for the delayed approval.
|
Thanks, @devonakerr, for reviewing. The one item I still have is the fields list doesn't match the definitions. Once that's addressed, I believe we'll be in good shape to advance this one. |
@ebeahan I think we're cleaned up now. |
|
|
||
| **Stage 0** | ||
|
|
||
| This RFC is to create the Mach-O sub-field within the `file.` fieldset. This will include 35 sub-fields. `macho` itself is a nested |
There was a problem hiding this comment.
I'd prefer to leave the top-level ECS fields all as objects.
What about defining macho.architectures as nested and having each architecture's fields defined underneath? Borrowing from what @andrewstucki proposed in elastic/beats#24195.
- name: macho
title: Mach-O file information.
type: group
description: These fields contain macOS Mach Object (Mach-O) metadata.
fields:
- name: architectures
description: Object files contained inside this file by architecture
type: nested
fields:
- name: cpu
description: CPU architecture target for the file.
type: keyword
example: 64-bit
- name: byte_order
description: Byte order for the file.
type: keyword
example: little-endian
- name: type
description: Mach-O file type.
type: keywordThere was a problem hiding this comment.
So, you're suggesting changing:
macho.cpu.{architecture,byte_order,type,...}tomacho.architecture.{cpu,byte_order,type,...}?macho.*being a group instead of nested andmacho.architecture.cpu{cpu,byte_order,type,...}being nested?
There was a problem hiding this comment.
Yes, mostly. One difference - I'm proposing macho.architecture being the nested field that all the other fields would fall under for each architecture type.
There was a problem hiding this comment.
The goal is that the "interface" to ELF, MachO, and PE have a similar feel. This will make building analytics and understanding of the data model. I discussed with @andrewstucki a while back about means to do that. The problem is that MachO fat binaries are literally two fully, self-sufficient executables in one big MachO wrapper. This means that any field that we decide to nest as architecture specific will have to contain all the architecture-dependent data. The result of this discussion is that it probably made the most sense to make file.macho as a nested type, which drastically simplifies the data.
We should meet to discuss.
Co-authored-by: Eric Beahan <ebeahan@gmail.com>
|
Closing until ready to revisit this. |
RFC Preview
Resolves #1096
make test? NA at this stagemakeand committed those changes? NA at this stage