Skip to content
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 origin_referrer_url, origin_url and zone_identifier to the file attribute #1430

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
968e8c2
add modified registry.yaml and generated files
AsuNa-jp Sep 24, 2024
ec834e6
add changelog
AsuNa-jp Sep 25, 2024
160b7ee
reflect the feedback
AsuNa-jp Sep 27, 2024
37c9710
reflect the feedback
AsuNa-jp Sep 27, 2024
4a2fed9
format fix
AsuNa-jp Sep 27, 2024
481bd1c
Merge branch 'main' into file_originevents
AsuNa-jp Sep 30, 2024
a2b4b35
Merge branch 'main' into file_originevents
AsuNa-jp Sep 30, 2024
4b11936
Merge branch 'main' into file_originevents
AsuNa-jp Oct 3, 2024
a1a4867
Merge branch 'main' into file_originevents
AsuNa-jp Oct 10, 2024
e8256e6
add file.zone_identifier
AsuNa-jp Oct 10, 2024
c55cb2b
Merge branch 'file_originevents' of github.com:AsuNa-jp/semantic-conv…
AsuNa-jp Oct 10, 2024
130bf61
re-generated the docs
AsuNa-jp Oct 25, 2024
1f6663a
Merge branch 'main' into file_originevents
AsuNa-jp Oct 28, 2024
329df10
Merge branch 'main' into file_originevents
trisch-me Oct 29, 2024
ba508e4
Merge branch 'main' into file_originevents
AsuNa-jp Oct 30, 2024
f4ad750
Merge branch 'main' into file_originevents
AsuNa-jp Oct 30, 2024
d82f261
add note of zoneID
AsuNa-jp Oct 30, 2024
c6b8d78
Merge branch 'file_originevents' of github.com:AsuNa-jp/semantic-conv…
AsuNa-jp Oct 30, 2024
b0016f6
Merge branch 'main' into file_originevents
AsuNa-jp Oct 31, 2024
7d5331c
Merge branch 'open-telemetry:main' into file_originevents
AsuNa-jp Oct 31, 2024
ed796cc
fixed the typo
AsuNa-jp Oct 31, 2024
f4e241c
Merge branch 'main' into file_originevents
AsuNa-jp Nov 1, 2024
264fd13
Merge branch 'main' into file_originevents
AsuNa-jp Nov 1, 2024
b590595
Merge branch 'main' into file_originevents
AsuNa-jp Nov 7, 2024
0793ef9
Merge branch 'main' into file_originevents
AsuNa-jp Nov 8, 2024
17107e4
Merge branch 'main' into file_originevents
AsuNa-jp Nov 11, 2024
a3dfd75
Merge branch 'main' into file_originevents
AsuNa-jp Nov 11, 2024
daa081e
Merge branch 'main' into file_originevents
AsuNa-jp Nov 13, 2024
22d06ab
Merge branch 'main' into file_originevents
AsuNa-jp Nov 18, 2024
088e959
resolve merge conflicts
AsuNa-jp Nov 19, 2024
358f21a
Merge branch 'main' into file_originevents
AsuNa-jp Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/file_originevents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: file

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: add file.origin_referrer_url, file.origin_url, and file.zone_identifier

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1430]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
13 changes: 11 additions & 2 deletions docs/attributes-registry/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ Describes file attributes.
| <a id="file-mode" href="#file-mode">`file.mode`</a> | string | Mode of the file in octal representation. | `0640` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-modified" href="#file-modified">`file.modified`</a> | string | Time when the file content was last modified, in ISO 8601 format. | `2021-01-01T12:00:00Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-name" href="#file-name">`file.name`</a> | string | Name of the file including the extension, without the directory. | `example.png` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-origin-referrer-url" href="#file-origin-referrer-url">`file.origin_referrer_url`</a> | string | The URL of the webpage that linked to the file. [7] | `http://example.com/article1.html` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-origin-url" href="#file-origin-url">`file.origin_url`</a> | string | The URL where the file is hosted. [8] | `http://example.com/imgs/article1_img1.jpg` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-owner-id" href="#file-owner-id">`file.owner.id`</a> | string | The user ID (UID) or security identifier (SID) of the file owner. | `1000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-owner-name" href="#file-owner-name">`file.owner.name`</a> | string | Username of the file owner. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-path" href="#file-path">`file.path`</a> | string | Full path to the file, including the file name. It should include the drive letter, when appropriate. | `/home/alice/example.png`; `C:\Program Files\MyApp\myapp.exe` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-size" href="#file-size">`file.size`</a> | int | File size in bytes. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-symbolic-link-target-path" href="#file-symbolic-link-target-path">`file.symbolic_link.target_path`</a> | string | Path to the target of a symbolic link. [7] | `/usr/bin/python3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-symbolic-link-target-path" href="#file-symbolic-link-target-path">`file.symbolic_link.target_path`</a> | string | Path to the target of a symbolic link. [9] | `/usr/bin/python3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="file-zone-identifier" href="#file-zone-identifier">`file.zone_identifier`</a> | int | Windows Zone Identifier for the file. [10] | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** This attribute might not be supported by some file systems — NFS, FAT32, in embedded OS, etc.

Expand All @@ -44,4 +47,10 @@ Describes file attributes.
**[6]:** On Linux, a resource fork is used to store additional data with a filesystem object. A file always has at least one fork for the data portion, and additional forks may exist.
On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default data stream for a file is just called $DATA. Zone.Identifier is commonly used by Windows to track contents downloaded from the Internet. An ADS is typically of the form: C:\path\to\filename.extension:some_fork_name, and some_fork_name is the value that should populate `fork_name`. `filename.extension` should populate `file.name`, and `extension` should populate `file.extension`. The full path, `file.path`, will include the fork name.

**[7]:** This attribute is only applicable to symbolic links.
**[7]:** This information comes from metadata or alternate data streams linked to the file. `file.origin_url` represents the URL from which the file was downloaded, and `file.origin_referrer_url` indicates the URL of the page where that URL was listed. There may be cases where both `file.origin_url` and `file.origin_referrer_url` exist, or only one of them is present. Note that the URL itself may contain sensitive information.

**[8]:** This information comes from metadata or alternate data streams linked to the file. `file.origin_url` represents the URL from which the file was downloaded, and `file.origin_referrer_url` indicates the URL of the page where that URL was listed. There may be cases where both `file.origin_url` and `file.origin_referrer_url` exist, or only one of them is present. Note that the URL itself may contain sensitive information.

**[9]:** This attribute is only applicable to symbolic links.

**[10]:** Zone Identifier (ZoneID) is a numerical identifier that shows where (what "Zone") a file came from, helping to decide if it's safe to open. The commonly used predefined Zones in Windows and their IDs are as follows: Zone 0: Local Machine Zone Zone 1: Local Intranet Zone Zone 2: Trusted Sites Zone Zone 3: Intranet Zone Zone 4: Restricted Site Zone
39 changes: 39 additions & 0 deletions model/file/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ groups:
The user ID (UID) or security identifier (SID) of the file owner.
stability: experimental
examples: ["1000"]
- id: file.origin_referrer_url
type: string
brief: >
The URL of the webpage that linked to the file.
note: >
This information comes from metadata or alternate data streams linked to the file.
`file.origin_url` represents the URL from which the file was downloaded, and `file.origin_referrer_url`
indicates the URL of the page where that URL was listed. There may be cases where both `file.origin_url`
and `file.origin_referrer_url` exist, or only one of them is present. Note that the URL itself may contain
sensitive information.
stability: experimental
examples: ['http://example.com/article1.html']
- id: file.origin_url
type: string
brief: >
The URL where the file is hosted.
note: >
This information comes from metadata or alternate data streams linked to the file.
`file.origin_url` represents the URL from which the file was downloaded, and `file.origin_referrer_url`
indicates the URL of the page where that URL was listed. There may be cases where both `file.origin_url`
and `file.origin_referrer_url` exist, or only one of them is present. Note that the URL itself may contain
sensitive information.
stability: experimental
examples: ['http://example.com/imgs/article1_img1.jpg']
- id: file.owner.name
type: string
brief: >
Expand All @@ -137,3 +161,18 @@ groups:
This attribute is only applicable to symbolic links.
stability: experimental
examples: ['/usr/bin/python3']
- id: file.zone_identifier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be file.windows_zone.id?

Given the generic nature of the word of 'zone' I think this should be clarified. Additionally we should stick to a similar convention across otel for id, and we don't use identifier anywhere else that I'm aware of.

type: int
brief: >
Windows Zone Identifier for the file.
note: >
Zone Identifier (ZoneID) is a numerical identifier that shows where
(what "Zone") a file came from, helping to decide if it's safe to open.
The commonly used predefined Zones in Windows and their IDs are as follows:
Zone 0: Local Machine Zone
Zone 1: Local Intranet Zone
Zone 2: Trusted Sites Zone
Zone 3: Intranet Zone
Zone 4: Restricted Site Zone
AsuNa-jp marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
examples: 3