-
Notifications
You must be signed in to change notification settings - Fork 453
File.elf create #1077
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
Merged
Merged
File.elf create #1077
Changes from 28 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
7080358
Merge pull request #1 from elastic/master
peasead 314f9ab
Merge pull request #2 from elastic/master
peasead 1448cd6
Merge pull request #3 from elastic/master
peasead 861769b
initial commit
peasead 9b3ccc6
change log
peasead 3aae133
add PRs
peasead 6ab3898
updated fieldset description
peasead af0a6b8
updated description
peasead f601c65
Update 0000-create-file-elf.md
peasead 734c132
reorganized
peasead 4b53baf
updatd SMEs
peasead de07776
added reference to telfhash
peasead 7724689
removed number of section headers
peasead 4a04359
renamed segments
peasead c48ebf2
added arch, cpu, and byte order
peasead 0ae0a2b
removed file. from the fieldset names
peasead f43d620
added nested objects
peasead 05e8be7
Update CHANGELOG.next.md
peasead d253d6d
Merge branch 'file.elf-create' of github.com:peasead/ecs into file.el…
peasead 7988596
Update rfcs/text/0000-create-file-elf.md
peasead 0d6f15f
Merge branch 'file.elf-create' of github.com:peasead/ecs into file.el…
peasead 91a1a31
Update rfcs/text/0000-create-file-elf.md
peasead 7e86774
Update rfcs/text/0000-create-file-elf.md
peasead 21c359b
Update rfcs/text/0000-create-file-elf.md
peasead dcd9e07
removed program headers
peasead 43e598d
removed vt data
peasead fba75c1
added usage doc link and usage start
peasead 3f860e6
re-ran make
peasead 90900af
nested segment-sections
peasead 0f49778
added to sections
peasead 63934d6
updated imports and exports to flattened
peasead 645fe2a
update header info
peasead e14fbc9
Update rfcs/text/0000-create-file-elf.md
peasead cc21074
Update rfcs/text/0000-create-file-elf.md
peasead 16b5b2f
Update 0000-create-file-elf.md
peasead a279069
Update 0000-create-file-elf.md
peasead 018e7b2
Update 0000-create-file-elf.md
peasead 68eb471
ecs housekeeping edits
ebeahan 5b24ada
set advancement date and assign rfc number
ebeahan d7f4fad
update naming
ebeahan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| # 0000: Create the ELF sub-field of the File fieldset | ||
|
|
||
| - Stage: **1 (proposal)** | ||
| - Date: **TBD** | ||
|
|
||
| Create the Executable Linkable Format (ELF) sub-field, of the `file` top-level fieldset. This document metadata can be used for malware research, as well as coding and other application development efforts. | ||
|
|
||
| ## Fields | ||
|
|
||
| **Stage 0** | ||
|
|
||
| This RFC is to create the ELF sub-field within the `file.` fieldset. This will include 25 sub-fields. | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
|
|
||
| | Name | Type | Description | | ||
| | ---- | ---- | ----------- | | ||
| | elf.creation_date | date | Extracted when possible from the file's metadata. Indicates when it was built or compiled. It can also be faked by malware creators. | | ||
| | elf.exports | nested | List of exported element names and types. | | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
| | elf.exports.name | keyword | Name of exported symbol | | ||
| | elf.exports.type | keyword | Type of exported symbol | | ||
| | elf.segments | keyword | ELF object segment list. | | ||
| | elf.header | nested | Header information of the ELF file. | | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
| | elf.header.class | keyword | Header class of the ELF file. | | ||
| | elf.header.data | keyword | Data table of the ELF header. | | ||
| | elf.header.machine | keyword | Machine architecture of the ELF header. | | ||
| | elf.header.os_abi | keyword | NEED TO ADD | | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
| | elf.header.type | keyword | Header type of the ELF file. | | ||
| | elf.header.version | keyword | Version of the ELF header. | | ||
| | elf.header.abi_version | keyword | Version of the ELF Application Binary Interface (ABI). | | ||
| | elf.header.entrypoint | long | Header entrypoint of the ELF file. | | ||
| | elf.header.object_version | keyword | "0x1" for original ELF files. | | ||
| | elf.imports | nested | List of imported element names and types. | | ||
| | elf.imports.name | keyword | Name of imported symbol | | ||
|
peasead marked this conversation as resolved.
|
||
| | elf.imports.type | keyword | Type of imported symbol | | ||
| | elf.sections | nested | Section information of the ELF file. | | ||
| | elf.sections.flags | keyword | ELF Section List flags. | | ||
| | elf.sections.name | keyword | ELF Section List name. | | ||
| | elf.sections.physical_offset | keyword | ELF Section List offset. | | ||
| | elf.sections.section_type | keyword | ELF Section List type. | | ||
| | elf.sections.size | long | ELF Section List size. | | ||
| | elf.sections.virtual_address | long | ELF Section List virtual address. | | ||
| | elf.shared_libraries | keyword | List of shared libraries used by this ELF object | | ||
| | elf.telfhash | keyword | telfhash hash for ELF files. | | ||
| | elf.architecture | keyword | Machine architecture of the ELF file. | | ||
| | elf.byte_order | keyword | Byte sequence of ELF file. | | ||
| | elf.cpu_type | keyword | CPU type of the ELF file. | | ||
|
|
||
|
|
||
| **Stage 1** | ||
|
|
||
| [New `elf.yml` candidate](../schemas/elf.yml) | ||
|
|
||
| <!-- | ||
| Stage 3: Add or update all remaining field definitions. The list should now be exhaustive. The goal here is to validate the technical details of all remaining fields and to provide a basis for releasing these field definitions as beta in the schema. Use GitHub code blocks with yml syntax formatting. | ||
| --> | ||
|
|
||
| ## Usage | ||
|
|
||
|
|
||
| In performing file analysis, specifically for malware research, understanding file similarities can be used to chain together malware samples and families to identify campaigns and possibly attribution. Additionally, understanding how malware components are re-used is useful in understanding malware telemetry, especially in understanding the impact being made through the introduction of defensive countermeasures. | ||
|
|
||
| As an example, if XDR vendors deploys a new malware model to defeat a specific type of ransomware and we start observing a change and/or relationship to the headers, import tables, libraries, etc of that malware family, we can make assumptions that the changes to the malware model are making an impact against the malware family. | ||
|
|
||
| As another example, tracking file metadata for specific families is useful in predicting new campaigns if we see similar file metadata being used for new samples. [Example](https://www.bleepingcomputer.com/news/security/maze-ransomware-is-shutting-down-its-cybercrime-operation/), the Maze ransomware family shutting down and re-purposing as Egregor (this is for Windows malware, but the concept is the same). | ||
|
|
||
| ## Source data | ||
|
|
||
| **Stage 1** | ||
|
|
||
| This type of data can be provided by logs from VirusTotal, Reversing Labs, Lockheed Martin's LAIKABOSS, Emerson's File Scanning Framework, Target's Strelka, or other file/malware analysis platforms. | ||
|
|
||
| * [VirusTotal Filebeat module PR](https://github.com/elastic/beats/pull/21815) | ||
| * [VirusTotal API](https://developers.virustotal.com/v3.0/reference) | ||
| * [Emerson FSF](https://github.com/EmersonElectricCo/fsf) | ||
| * [Target Strelka](https://github.com/target/strelka) | ||
| * [Lockheed Martin LAIKABOSS](https://github.com/lmco/laikaboss) | ||
|
|
||
| <!-- | ||
| Stage 1: Provide a high-level description of example sources of data. This does not yet need to be a concrete example of a source document, but instead can simply describe a potential source (e.g. nginx access log). This will ultimately be fleshed out to include literal source examples in a future stage. The goal here is to identify practical sources for these fields in the real world. ~1-3 sentences or unordered list. | ||
| --> | ||
|
|
||
| **Stage 2** | ||
|
|
||
| ### Real world examples | ||
|
|
||
| <!-- | ||
| Stage 2: Included a real world example source document. Ideally this example comes from the source(s) identified in stage 1. If not, it should replace them. The goal here is to validate the utility of these field changes in the context of a real world example. Format with the source name as a ### header and the example document in a GitHub code block with json formatting. | ||
| --> | ||
|
|
||
| <!-- | ||
| Stage 3: Add more real world example source documents so we have at least 2 total, but ideally 3. Format as described in stage 2. | ||
| --> | ||
|
|
||
| ## Scope of impact | ||
|
|
||
| **Stage 2** | ||
|
|
||
| There should be no breaking changes, depreciation strategies, or significant refactoring as this is creating a sub-field for the existing `file.` fieldset. | ||
|
|
||
| While likely not a large-scale ECS project, there would be documentation updates needed to explain the new fields. | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
|
|
||
| <!-- | ||
| Stage 2: Identifies scope of impact of changes. Are breaking changes required? Should deprecation strategies be adopted? Will significant refactoring be involved? Break the impact down into: | ||
| * Ingestion mechanisms (e.g. beats/logstash) | ||
| * Usage mechanisms (e.g. Kibana applications, detections) | ||
| # https://github.com/elastic/ecs/tree/master/docs/usage#usage-docs | ||
| * ECS project (e.g. docs, tooling) | ||
| The goal here is to research and understand the impact of these changes on users in the community and development teams across Elastic. 2-5 sentences each. | ||
| --> | ||
|
|
||
| ## Concerns | ||
|
|
||
| <!-- | ||
| Stage 1: Identify potential concerns, implementation challenges, or complexity. Spend some time on this. Play devil's advocate. Try to identify the sort of non-obvious challenges that tend to surface later. The goal here is to surface risks early, allow everyone the time to work through them, and ultimately document resolution for posterity's sake. | ||
| --> | ||
|
|
||
| <!-- | ||
| Stage 2: Document new concerns or resolutions to previously listed concerns. It's not critical that all concerns have resolutions at this point, but it would be helpful if resolutions were taking shape for the most significant concerns. | ||
| --> | ||
|
|
||
| <!-- | ||
| Stage 3: Document resolutions for all existing concerns. Any new concerns should be documented along with their resolution. The goal here is to eliminate the risk of churn and instability by resolving outstanding concerns. | ||
| --> | ||
|
|
||
| <!-- | ||
| Stage 4: Document any new concerns and their resolution. The goal here is to eliminate risk of churn and instability by ensuring all concerns have been addressed. | ||
| --> | ||
|
|
||
| ## Real-world implementations | ||
|
|
||
| <!-- | ||
| Stage 4: Identify at least one real-world, production-ready implementation that uses these updated field definitions. An example of this might be a GA feature in an Elastic application in Kibana. | ||
| --> | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## People | ||
|
|
||
| The following are the people that consulted on the contents of this RFC. | ||
|
|
||
| * @peasead | author | ||
| * @devonakerr | sponsor | ||
| * @dcode, @peasead | subject matter expert | ||
|
|
||
| ## References | ||
|
|
||
| <!-- Insert any links appropriate to this RFC in this section. --> | ||
|
|
||
| ### RFC Pull Requests | ||
|
|
||
| <!-- An RFC should link to the PRs for each of it stage advancements. --> | ||
|
|
||
| * Stage 1: https://github.com/elastic/ecs/pull/1077 | ||
|
|
||
| <!-- | ||
| * Stage 1: https://github.com/elastic/ecs/pull/NNN | ||
| ... | ||
| --> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| [[ecs-elf-ussage]] | ||
| === ELF Usage | ||
|
|
||
| --Description-- | ||
|
|
||
| [discrete] | ||
| === ELF Field Details | ||
| | Field | Description | Level | | ||
| | ---- | ---- | ----------- | | ||
| | elf.creation_date | Extracted when possible from the file's metadata. Indicates when it was built or compiled. It can also be faked by malware creators. | extended | | ||
| | ... | ... | ... | | ||
| | ... | ... | ... | | ||
| | ... | ... | ... | | ||
|
|
||
| [discrete] | ||
| === Field Reuse | ||
| The `elf` fields are expected to be nested at: `dll.elf`, `file.elf`, `process.elf`. | ||
|
|
||
| Note also that the `elf` fields are not expected to be used directly at the root of the events. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| --- | ||
| - name: elf | ||
| title: ELF Header | ||
| group: 2 | ||
| description: > | ||
| These fields contain Linux Executable Linkable Format (ELF) metadata. | ||
| type: group | ||
| reusable: | ||
| top_level: false | ||
| expected: | ||
| - file | ||
| - process | ||
|
peasead marked this conversation as resolved.
Outdated
|
||
| fields: | ||
| - name: creation_date | ||
| short: Build or compile date. | ||
| description: > | ||
| Extracted when possible from the file's metadata. Indicates when it was | ||
| built or compiled. It can also be faked by malware creators. | ||
| type: date | ||
| level: extended | ||
|
|
||
| - name: architecture | ||
| description: > | ||
| Machine architecture of the ELF file. | ||
| type: keyword | ||
| level: extended | ||
| example: ARM, x86-64, etc | ||
|
|
||
| - name: byte_order | ||
| description: > | ||
| Byte sequence of ELF file. | ||
| type: keyword | ||
| level: extended | ||
| example: Little Endian, Big Endian | ||
|
|
||
| - name: cpu_type | ||
| description: > | ||
| CPU type of the ELF file. | ||
| type: keyword | ||
| level: extended | ||
| example: Intel, PowerPC, RISC, etc. | ||
|
|
||
| - name: header | ||
| level: extended | ||
| description: > | ||
| Header information of the ELF file. | ||
| type: object | ||
| fields: | ||
| - name: class | ||
| description: > | ||
| Header class of the ELF file. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: data | ||
| description: > | ||
| Data table of the ELF header. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: os_abi | ||
| description: > | ||
| Application Binary Interface (ABI) of the Linux OS. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: type | ||
| description: > | ||
| Header type of the ELF file. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: version | ||
| description: > | ||
| Version of the ELF header. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: abi_version | ||
| type: keyword | ||
| level: extended | ||
| description: > | ||
| Version of the ELF Application Binary Interface (ABI). | ||
|
|
||
| - name: entrypoint | ||
| format: string | ||
| level: extended | ||
| type: long | ||
| description: > | ||
| Header entrypoint of the ELF file. | ||
|
|
||
| - name: object_version | ||
| type: keyword | ||
| level: extended | ||
| description: > | ||
| "0x1" for original ELF files. | ||
|
|
||
| - name: sections | ||
| description: > | ||
| Section information of the ELF file. | ||
| type: object | ||
| level: extended | ||
| fields: | ||
| - name: flags | ||
| description: > | ||
| ELF Section List flags. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: name | ||
| description: > | ||
| ELF Section List name. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: physical_offset | ||
| description: > | ||
| ELF Section List offset. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: section_type | ||
| description: > | ||
| ELF Section List type. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: size | ||
| description: > | ||
| ELF Section List size. | ||
| format: bytes | ||
| type: long | ||
| level: extended | ||
|
|
||
| - name: virtual_address | ||
| description: > | ||
| ELF Section List virtual address. | ||
| format: string | ||
| type: long | ||
| level: extended | ||
|
|
||
| - name: exports | ||
| description: > | ||
| List of exported element names and types. | ||
| level: extended | ||
| type: object | ||
| fields: | ||
| - name: name | ||
| description: > | ||
| Name of exported symbol | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: type | ||
| description: > | ||
| Type of exported symbol | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: imports | ||
| description: > | ||
| List of imported element names and types. | ||
| type: object | ||
| level: extended | ||
| fields: | ||
| - name: name | ||
| description: > | ||
| Name of imported symbol | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: type | ||
| description: > | ||
| Type of imported symbol | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: shared_libraries | ||
| description: > | ||
| List of shared libraries used by this ELF object | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: telfhash | ||
| short: telfhash hash for ELF files | ||
| description: > | ||
| telfhash is symbol hash for ELF files, just like imphash is imports hash for PE files. Learn more at https://github.com/trendmicro/telfhash. | ||
| type: keyword | ||
| level: extended | ||
|
|
||
| - name: segments | ||
| description: > | ||
| ELF object segment list. | ||
| type: keyword | ||
| level: extended | ||
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.
Uh oh!
There was an error while loading. Please reload this page.