Closed Bug 1009720 Opened 11 years ago Closed 11 years ago

implement test_mode telemetry

Categories

(Core :: Security: PSM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mmc, Assigned: mmc)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Everything is in one big bucket. Also fix previous histogram to use the appropriate type. Note: this only is useful if absolutely nothing goes wrong, ever.
Assignee: nobody → mmc
Status: NEW → ASSIGNED
Comment on attachment 8421912 [details] [diff] [review] Telemetry for CERT_PINNING_TEST_RESULTS ( Review of attachment 8421912 [details] [diff] [review]: ----------------------------------------------------------------- This also prefs the default back on, which we could have done yesterday after test mode landed.
Attachment #8421912 - Flags: review?(dkeeler)
Attachment #8421912 - Flags: review?(cviecco)
Comment on attachment 8421912 [details] [diff] [review] Telemetry for CERT_PINNING_TEST_RESULTS ( Review of attachment 8421912 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me with comments addressed. ::: security/manager/boot/src/PublicKeyPinningService.cpp @@ +201,3 @@ > PR_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, > + ("pkpin: Skipping %s test mode pinning check for host: '%s'\n", > + evalHost, result ? "passing": "failing")); I think these arguments are backwards - the host is last, right? @@ +204,5 @@ > + retval = true; > + } else { > + PR_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, > + ("pkpin: Enforcing %s pinning check for host: '%s'\n", > + evalHost, result ? "passing": "failing")); evalHost last, I think @@ +205,5 @@ > + } else { > + PR_LOG(gPublicKeyPinningLog, PR_LOG_DEBUG, > + ("pkpin: Enforcing %s pinning check for host: '%s'\n", > + evalHost, result ? "passing": "failing")); > + Telemetry::Accumulate(Telemetry::CERT_PINNING_RESULTS, result ? 1 : 0); I'm wondering how this would look if we only had one call to Telemetry::Accumulate (and, similarly, one call to PR_LOG). (i.e. set up a number of parameters that default to the non-test-mode behavior and then change them in the "if (foundEntry->mTestMode)" case). I don't feel strongly either way, but it might make this a bit more clear. ::: security/manager/ssl/tests/unit/test_pinning.js @@ +92,5 @@ > }; > > function check_pinning_telemetry() { > + let service = Cc["@mozilla.org/base/telemetry;1"] > + .getService(Ci.nsITelemetry); nit: indent one less space @@ +96,5 @@ > + .getService(Ci.nsITelemetry); > + let prod_histogram = service.getHistogramById("CERT_PINNING_RESULTS") > + .snapshot(); > + let test_histogram = service.getHistogramById("CERT_PINNING_TEST_RESULTS") > + .snapshot(); nit: I would indent .snapshot(); two more spaces each here
Attachment #8421912 - Flags: review?(dkeeler) → review+
Attachment #8421912 - Attachment is obsolete: true
Attachment #8421912 - Flags: review?(cviecco)
Attachment #8421974 - Attachment is obsolete: true
Fixed, logs look like: Pin check passed for host 'pinning.example.com' (mode=production) Pin check failed for host 'pinning.example.com' (mode=test)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: