New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 663870 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Policy test server is not performing key rotations as documented

Project Member Reported by emaxx@chromium.org, Nov 9 2016

Issue description

The policy test server (policy_testserver.py, [1]) has a feature to perform the signing keys rotation. As per command line help:
> If the server has multiple keys, it will rotate through
> them in at each request in a round-robin fashion.

It seems that the actual behavior of the policy test server differs from the expected. In the default configuration, with the two pre-baked signing keys, it only performs one actual key rotation: from key #0 to key #1.

It's not clear from the code what was the intended behavior, but it definitely doesn't conform to the documentation.

So either the documentation should be corrected (though not sure how to describe it correctly, as I don't understand what will happen in case of three keys), or the policy test server should be fixed.


Quick testing revealed at least one test which is actually depending on the current behavior of the policy test server: CloudPolicyTest.FetchPolicyWithRotatedKey ([2]).

On the other hand, infinite round-robin key rotation may be useful for writing tests with some scenarios.


[1] https://cs.chromium.org/chromium/src/chrome/browser/policy/test/policy_testserver.py
[2] https://cs.chromium.org/chromium/src/chrome/browser/policy/cloud/cloud_policy_browsertest.cc?l=401
 

Comment 1 by emaxx@chromium.org, Nov 9 2016

Cc: scunning...@chromium.org
Scott, are you aware of any usages of this key rotation functionality in the policy test server, outside the automated tests in the Chromium repository?

Comment 2 by emaxx@chromium.org, Nov 9 2016

Correction after closer looking at the code: in the default configuration, the policy test server is _not_ performing the key rotation. It's emulated in the CloudPolicyTest.FetchPolicyWithRotatedKey test by changing the test server config on the fly.

Comment 3 by emaxx@chromium.org, Nov 10 2016

Summary: Policy test server is not performing key rotations as documented (was: Policy test server is performing key rotation only once)
Labels: Enterprise-Triaged
Cc: krishna...@chromium.org
Cc: -scunning...@chromium.org
Owner: emaxx@chromium.org
Status: Assigned (was: Untriaged)
Please update the status if you feel it's incorrect.

Comment 8 by emaxx@chromium.org, Nov 24 2016

Status: Started (was: Assigned)
So looks like there are no known usages of policy test server outside Chrome autotests.

I'll work on fixing the doc to reflect the current behavior, and also add a command line flag that would actually enable the key rotation (the latter could be used to write new tests that work with the key rotation).
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/26aa638c5ccdd27549493df2d2aff78db8fa8382

commit 26aa638c5ccdd27549493df2d2aff78db8fa8382
Author: emaxx <emaxx@chromium.org>
Date: Fri Nov 25 16:21:32 2016

This introduces a special command line flag for the
local policy test server that enables the automatic
rotation of the signing keys with each received policy
fetch request.

The LocalPolicyTestServer class is extended to provide
ability to trigger this feature.

Also the existing documentation for the local policy test
server is corrected to correctly describe the default
behavior in which there are no cyclic key rotations.

BUG= 663870 
TEST=existing tests

Review-Url: https://codereview.chromium.org/2530023002
Cr-Commit-Position: refs/heads/master@{#434519}

[modify] https://crrev.com/26aa638c5ccdd27549493df2d2aff78db8fa8382/chrome/browser/policy/test/local_policy_test_server.cc
[modify] https://crrev.com/26aa638c5ccdd27549493df2d2aff78db8fa8382/chrome/browser/policy/test/local_policy_test_server.h
[modify] https://crrev.com/26aa638c5ccdd27549493df2d2aff78db8fa8382/chrome/browser/policy/test/policy_testserver.py

Comment 10 by emaxx@chromium.org, Nov 25 2016

Status: Fixed (was: Started)

Comment 11 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 12 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 13 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Status: Verified (was: Fixed)

Sign in to add a comment