forked from mirrors/gecko-dev
Bug 1485180 - Instrument invalid download protection hashes. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D3941 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
300dbd787f
commit
cd457cfc82
2 changed files with 28 additions and 0 deletions
|
|
@ -1466,6 +1466,24 @@ PendingLookup::SendRemoteQueryInternal()
|
||||||
"[this = %p]", this));
|
"[this = %p]", this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Look for truncated hashes (see bug 1190020)
|
||||||
|
const auto originalHashLength = sha256Hash.Length();
|
||||||
|
if (originalHashLength == 0) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::OriginalHashEmpty);
|
||||||
|
} else if (originalHashLength < 32) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::OriginalHashTooShort);
|
||||||
|
} else if (originalHashLength > 32) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::OriginalHashTooLong);
|
||||||
|
} else if (!mRequest.has_digests()) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::MissingDigest);
|
||||||
|
} else if (!mRequest.digests().has_sha256()) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::MissingSha256);
|
||||||
|
} else if (mRequest.digests().sha256().size() != originalHashLength) {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::InvalidSha256);
|
||||||
|
} else {
|
||||||
|
AccumulateCategorical(mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_HASH_LENGTH::ValidHash);
|
||||||
|
}
|
||||||
|
|
||||||
// Serialize the protocol buffer to a string. This can only fail if we are
|
// Serialize the protocol buffer to a string. This can only fail if we are
|
||||||
// out of memory, or if the protocol buffer req is missing required fields
|
// out of memory, or if the protocol buffer req is missing required fields
|
||||||
// (only the URL for now).
|
// (only the URL for now).
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,16 @@
|
||||||
"labels": ["OtherBinaryFile", "DmgFile", "RarFile", "ZipFile"],
|
"labels": ["OtherBinaryFile", "DmgFile", "RarFile", "ZipFile"],
|
||||||
"description": "Whether a binary file examined by download protection is one of the common archive formats."
|
"description": "Whether a binary file examined by download protection is one of the common archive formats."
|
||||||
},
|
},
|
||||||
|
"APPLICATION_REPUTATION_HASH_LENGTH": {
|
||||||
|
"record_in_processes": ["main", "content"],
|
||||||
|
"alert_emails": ["francois@mozilla.com", "safebrowsing-telemetry@mozilla.org"],
|
||||||
|
"bug_numbers": [1485180],
|
||||||
|
"expires_in_version": "69",
|
||||||
|
"releaseChannelCollection": "opt-out",
|
||||||
|
"kind": "categorical",
|
||||||
|
"labels": ["ValidHash", "OriginalHashEmpty", "OriginalHashTooShort", "OriginalHashTooLong", "MissingDigest", "MissingSha256", "InvalidSha256"],
|
||||||
|
"description": "Whether the hash included in application reputation lookups is valid or broken in some way."
|
||||||
|
},
|
||||||
"APPLICATION_REPUTATION_SHOULD_BLOCK": {
|
"APPLICATION_REPUTATION_SHOULD_BLOCK": {
|
||||||
"record_in_processes": ["main", "content"],
|
"record_in_processes": ["main", "content"],
|
||||||
"alert_emails": ["francois@mozilla.com", "safebrowsing-telemetry@mozilla.org"],
|
"alert_emails": ["francois@mozilla.com", "safebrowsing-telemetry@mozilla.org"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue