Bug 1208847 - Add telemetry to measure how often secure cookies are set from non-secure origins r=mcmanus

This commit is contained in:
Richard Barnes 2015-09-28 15:15:16 -04:00
Родитель 4b903c54fe
Коммит 77dbfa7a24
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -2851,6 +2851,21 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI,
// so we can handle them separately.
bool newCookie = ParseAttributes(aCookieHeader, cookieAttributes);
// Collect telemetry on how often secure cookies are set from non-secure
// origins, and vice-versa.
//
// 0 = nonsecure and "http:"
// 1 = nonsecure and "https:"
// 2 = secure and "http:"
// 3 = secure and "https:"
bool isHTTPS;
nsresult rv = aHostURI->SchemeIs("https", &isHTTPS);
if (NS_SUCCEEDED(rv)) {
Telemetry::Accumulate(Telemetry::COOKIE_SCHEME_SECURITY,
((cookieAttributes.isSecure)? 0x02 : 0x00) |
((isHTTPS)? 0x01 : 0x00));
}
int64_t currentTimeInUsec = PR_Now();
// calculate expiry time of cookie.

Просмотреть файл

@ -7562,6 +7562,14 @@
"n_values": 10,
"description": "How often would blocked mixed content be allowed if HSTS upgrades were allowed? 0=display/no-HSTS, 1=display/HSTS, 2=active/no-HSTS, 3=active/HSTS"
},
"COOKIE_SCHEME_SECURITY": {
"alert_emails": ["seceng@mozilla.org"],
"expires_in_version": "50",
"kind": "enumerated",
"n_values": 10,
"releaseChannelCollection": "opt-out",
"description": "How often are secure cookies set from non-secure origins, and vice-versa? 0=nonsecure/http, 1=nonsecure/https, 2=secure/http, 3=secure/https"
},
"NTLM_MODULE_USED_2": {
"expires_in_version": "never",
"kind": "enumerated",