Skip to content

Commit ec73f3d

Browse files
committed
Address PR #152 review comments
- Move pings.yaml from browser/components/downloads to browser/components/enterprisepolicies (it's a shared enterprise ping used by multiple components) - Update metrics_index.py to reflect new pings.yaml location - Align download metric field naming (extension, size_bytes) across both metrics - Add data_sensitivity: highly_sensitive to enterprise metrics for consistency All other review comments were already addressed in earlier rebased commits.
1 parent d0cda41 commit ec73f3d

File tree

8 files changed

+60
-53
lines changed

8 files changed

+60
-53
lines changed

browser/components/downloads/metrics.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ downloads:
3131
#ifdef MOZ_ENTERPRISE
3232
file_downloaded:
3333
type: event
34+
data_sensitivity:
35+
- highly_sensitive
3436
description: >
3537
Recorded when a file download completes successfully in enterprise builds.
3638
Contains security-relevant metadata for monitoring and analysis.
@@ -69,43 +71,45 @@ downloads:
6971
type: string
7072
security_download_completed:
7173
type: event
74+
data_sensitivity:
75+
- highly_sensitive
7276
description: >
73-
Recorded when a file download completes successfully. Contains security-relevant
74-
metadata for enterprise monitoring and analysis. Only collected when
75-
MOZ_ENTERPRISE is defined.
77+
Recorded when a file download completes successfully in enterprise builds.
78+
Contains security-relevant metadata for monitoring and analysis.
79+
Only collected when MOZ_ENTERPRISE is defined and enabled.
7680
bugs:
7781
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
7882
data_reviews:
7983
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
8084
notification_emails:
81-
85+
86+
8287
expires: never
8388
send_in_pings:
8489
- enterprise
8590
extra_keys:
8691
filename:
8792
description: >
88-
The filename (leaf name only) of the downloaded file.
93+
The filename (basename only) of the downloaded file.
8994
type: string
90-
file_extension:
95+
extension:
9196
description: >
9297
The file extension of the downloaded file (e.g., "pdf", "exe").
9398
type: string
9499
mime_type:
95100
description: >
96101
The MIME type of the downloaded file as reported by the server.
97102
type: string
98-
file_size:
103+
size_bytes:
99104
description: >
100-
The size of the downloaded file in bytes. Capped at 2^53-1.
101-
type: string
105+
The size of the downloaded file in bytes.
106+
type: quantity
102107
source_url_domain:
103108
description: >
104-
The domain portion of the original download URL (e.g., "example.com").
105-
Query parameters and paths are excluded for privacy.
109+
The domain from which the file was downloaded.
106110
type: string
107111
is_private:
108112
description: >
109-
Whether the download originated from a private browsing session.
113+
Whether the download occurred in a private browsing session.
110114
type: boolean
111115
#endif

browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export let WebsiteFilter = {
178178
}
179179
return true;
180180
},
181+
/* eslint-disable */
181182
#ifdef MOZ_ENTERPRISE
182183
_recordBlocklistDomainBrowsed(url) {
183184
const isEnabled = Services.prefs.getBoolPref(
@@ -241,4 +242,5 @@ export let WebsiteFilter = {
241242
}
242243
},
243244
#endif
245+
/* eslint-enable */
244246
};

browser/components/enterprisepolicies/helpers/sample_enterprise_storage_encryption.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
"EnterpriseStorageEncryption": true
44
}
55
}
6-
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
# This Source Code Form is subject to the terms of the Mozilla Public
2-
# License, v. 2.0. If a copy of the MPL was not distributed with this
3-
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4-
5-
# Adding a new metric? We have docs for that!
6-
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
7-
8-
---
9-
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
10-
$tags:
11-
- 'Firefox :: Enterprise Policies'
12-
13-
#ifdef MOZ_ENTERPRISE
14-
content_policy:
15-
blocklist_domain_browsed:
16-
type: event
17-
data_sensitivity:
18-
- highly_sensitive
19-
description: >
20-
Recorded when a domain blocked by policy is browsed.
21-
Only collected when MOZ_ENTERPRISE is defined and enabled.
22-
bugs:
23-
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
24-
data_reviews:
25-
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
26-
notification_emails:
27-
28-
29-
expires: never
30-
send_in_pings:
31-
- enterprise
32-
extra_keys:
33-
url:
34-
description: >
35-
The blocked url that was browsed.
36-
type: string
37-
#endif
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
# Adding a new metric? We have docs for that!
6+
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
7+
8+
---
9+
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
10+
$tags:
11+
- 'Firefox :: Enterprise Policies'
12+
13+
#ifdef MOZ_ENTERPRISE
14+
content_policy:
15+
blocklist_domain_browsed:
16+
type: event
17+
data_sensitivity:
18+
- highly_sensitive
19+
description: >
20+
Recorded when a domain blocked by policy is browsed.
21+
Only collected when MOZ_ENTERPRISE is defined and enabled.
22+
bugs:
23+
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
24+
data_reviews:
25+
- https://bugzilla.mozilla.org/show_bug.cgi?id=TBD
26+
notification_emails:
27+
28+
29+
expires: never
30+
send_in_pings:
31+
- enterprise
32+
extra_keys:
33+
url:
34+
description: >
35+
The blocked url that was browsed.
36+
type: string
37+
#endif

toolkit/components/downloads/DownloadCore.sys.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,9 @@ Download.prototype = {
734734
// Record the telemetry event
735735
Glean.downloads.securityDownloadCompleted.record({
736736
filename,
737-
file_extension: fileExtension,
737+
extension: fileExtension,
738738
mime_type: this.contentType || "",
739-
file_size: String(this.target.size || 0),
739+
size_bytes: this.target.size || 0,
740740
source_url_domain: sourceDomain,
741741
is_private: this.source.isPrivate || false,
742742
});

toolkit/components/glean/metrics_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
firefox_desktop_pings = [
222222
"browser/components/asrouter/pings.yaml",
223223
"browser/components/backup/pings.yaml",
224-
"browser/components/downloads/pings.yaml",
224+
"browser/components/enterprisepolicies/pings.yaml",
225225
"browser/components/newtab/pings.yaml",
226226
"browser/components/profiles/pings.yaml",
227227
"browser/components/search/pings.yaml",

toolkit/components/printing/metrics.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ printing:
9090
#ifdef MOZ_ENTERPRISE
9191
page_printed:
9292
type: event
93+
data_sensitivity:
94+
- highly_sensitive
9395
description: >
9496
Recorded when a page is printed in enterprise builds.
9597
Contains security-relevant metadata for monitoring and analysis.

0 commit comments

Comments
 (0)