Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 1 | # Policy Settings in Chrome |
| 2 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 3 | ## Summary |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 4 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 5 | Chrome exposes a different set of configurations to administrators. These |
| 6 | configurations are called policy and they give administrators more advanced |
| 7 | controls than the normal users. With different device management tools, |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 8 | an administrator can deliver these polices to many users. Here is the |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 9 | [help center article](https://support.google.com/chrome/a/answer/9037717?hl=en) |
| 10 | that talks about Chrome policy and its deployment. |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 11 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 12 | ## Do I need a policy |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 13 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 14 | Usually you need a policy when |
| 15 | |
| 16 | - Launching a new feature. Create a policy so that the admin can disable or |
| 17 | enable the feature for all users. |
| 18 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 19 | - Deprecating an old feature. Create a policy to give enterprise users more |
| 20 | time to migrate away from the feature. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 21 | |
| 22 | ## Adding a new policy |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 23 | |
| 24 | 1. Think carefully about the name and the desired semantics of the new policy: |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 25 | - Choose a name that is consistent with the existing naming scheme. Prefer |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 26 | "XXXEnabled" over "EnableXXX" because the former is more glanceable and |
| 27 | sorts better. |
| 28 | - Consider the foreseeable future and try to avoid conflicts with possible |
| 29 | future extensions or use cases. |
| 30 | - Negative policies (*Disable*, *Disallow*) are verboten because setting |
| 31 | something to "true" to disable it confuses people. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 32 | 2. Declare the policy in the |
| 33 | [policy_templates.json](https://cs.chromium.org/chromium/src/components/policy/resources/policy_templates.json) |
| 34 | - This file contains meta-level descriptions of all policies and is used |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 35 | to generate code, policy templates (ADM/ADMX for Windows and the |
| 36 | application manifest for Mac), as well as documentation. Please make |
| 37 | sure you get the version and feature flags (such as dynamic_refresh and |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 38 | supported_on) right. |
| 39 | - Here are the most used attributes. Please note that, all attributes |
Owen Min | 5d685ceb | 2020-06-22 23:31:43 | [diff] [blame] | 40 | below other than `supported_on`, `future_on' and |
| 41 | `default_for_enterprise_users` do not change the code behavior. |
| 42 | - `supported_on` and `future_on`: They control the platforms that the |
| 43 | policy supports. `supported_on` is used for released platforms with |
| 44 | milestone range while `future_on` is used for unreleased platforms. |
| 45 | See **Launch a policy** below for more information. |
Victor-Gabriel Savu | 42dcd42 | 2020-05-05 12:26:21 | [diff] [blame] | 46 | - `default_for_enterprise_users`: Its value is applied as a mandatory |
| 47 | policy for managed users on Chrome OS unless a different setting is |
| 48 | explicitly set. |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 49 | - `dynamic_refresh`: It tells the admin whether the policy value can |
| 50 | be changed and take effect without re-launching Chrome. |
| 51 | - `per_profile`: It tells the admin whether different policy values |
| 52 | can be assigned to different profiles. |
| 53 | - `can_be_recommended`: It tells the admin whether they can mark the |
| 54 | policy as recommended and allow the user to override it in the UI, |
| 55 | using a command line switch or an extension. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 56 | - The complete list of attributes and their expected values can be found in |
| 57 | the |
| 58 | [policy_templates.json](https://cs.chromium.org/chromium/src/components/policy/resources/policy_templates.json). |
| 59 | - The textual policy description should include the following: |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 60 | - What features of Chrome are affected. |
| 61 | - Which behavior and/or UI/UX changes the policy triggers. |
| 62 | - How the policy behaves if it's left unset or set to invalid/default |
| 63 | values. This may seem obvious to you, and it probably is. However, |
| 64 | this information seems to be provided for Windows Group Policy |
| 65 | traditionally, and we've seen requests from organizations to |
| 66 | explicitly spell out the behavior for all possible values and for |
| 67 | when the policy is unset. |
Johann | 48fbca9 | 2021-07-16 18:29:41 | [diff] [blame] | 68 | - See [description_guidelines.md](description_guidelines.md) |
Chris Sharp | 0f7626d | 2020-07-27 21:48:16 | [diff] [blame] | 69 | for additional guidelines when creating a description, including how |
| 70 | various products should be referenced. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 71 | 3. Create a preference and map the policy value to it. |
| 72 | - All policy values need to be mapped into a prefs value before being used |
| 73 | unless the policy is needed before PrefService initialization. |
| 74 | - To map the policy: |
| 75 | 1. Create a prefs and register the prefs in **Local State** or |
| 76 | **Profile Prefs**. Please note that, this must match the |
| 77 | `per_profile` attribute in the `policy_templates.json`. We also |
| 78 | strongly encourage developers to register the prefs with **Profile |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 79 | Prefs** if possible, because this gives admin more flexibility of |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 80 | policy setup. |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 81 | 2. Most policies can be mapped to prefs with `kSimplePolicyMap` in |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 82 | [configuration_policy_handler_list_factory.cc](https://cs.chromium.org/chromium/src/chrome/browser/policy/configuration_policy_handler_list_factory.cc?type=cs&q=kSimplePolicyMap&g=0&l=150). |
| 83 | If the policy needs additional verification or processing, please |
| 84 | implement a `ConfigurationPolicyHandler` to do so. |
| 85 | 3. Test the mapping by adding policy to |
Alexander Hendrich | 22dd3f23 | 2021-06-22 20:01:10 | [diff] [blame] | 86 | [policy_test_cases.json](https://cs.chromium.org/chromium/src/chrome/test/data/policy/policy_test_cases.json?q=policy_test_case) (see [instructions](https://cs.chromium.org/chromium/src/docs/enterprise/policy_pref_mapping_test.md)). |
Owen Min | 90926fc | 2020-04-23 15:12:04 | [diff] [blame] | 87 | 4. iOS platform has its own |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 88 | [configuration_policy_handler_list_factory.mm](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/policy/configuration_policy_handler_list_factory.mm) |
Owen Min | 90926fc | 2020-04-23 15:12:04 | [diff] [blame] | 89 | and |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 90 | [policy_test_cases.json](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/test/data/policy/policy_test_cases.json) |
Owen Min | 90926fc | 2020-04-23 15:12:04 | [diff] [blame] | 91 | file. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 92 | 4. Disable the user setting UI when the policy is applied. |
| 93 | - If your feature can be controlled by GUI in `chrome://settings`, the |
| 94 | associated option should be disabled when the policy controlling it is |
| 95 | managed. |
| 96 | - `PrefService:Preference::IsManaged` reveals whether a prefs value |
| 97 | comes from policy or not. |
| 98 | - The setting needs an |
| 99 | [indicator](https://cs.chromium.org/chromium/src/ui/webui/resources/images/business.svg) |
| 100 | to tell users that the setting is enforced by the administrator. |
| 101 | 5. Support `dynamic_refresh` if possible. |
| 102 | - We strongly encourage developers to make their policies support this |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 103 | attribute. It means the admin can change the policy value and Chrome |
| 104 | will honor the change at run-time without requiring a restart of the |
| 105 | browser. Chrome OS does not always support non-dynamic profile policies. |
| 106 | Please verify with a Chrome OS policy owner if your profile policy does |
| 107 | not support dynamic refresh on Chrome OS. |
| 108 | - Most of the time, this requires a |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 109 | [PrefChangeRegistrar](https://cs.chromium.org/chromium/src/components/prefs/pref_change_registrar.h) |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 110 | to listen to the preference change notification and update UI or |
| 111 | browser behavior right away. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 112 | 6. Adding a device policy for Chrome OS. |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 113 | - Most policies that are used by the browser can be shared between desktop |
| 114 | and Chrome OS. However, you need a few additional steps for a device |
| 115 | policy on Chrome OS. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 116 | - Add a message for your policy in |
| 117 | `components/policy/proto/chrome_device_policy.proto`. Please note |
| 118 | that all proto fields are optional. |
| 119 | - Update |
Yeunjoo Choi | 42f18f8 | 2021-07-26 02:18:10 | [diff] [blame^] | 120 | `chrome/browser/ash/policy/core/device_policy_decoder.{h,cc}` |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 121 | for the new policy. |
| 122 | 7. Test the policy. |
| 123 | - Add a test to verify the policy. You can add a test in |
| 124 | `chrome/browser/policy/<area>_policy_browsertest.cc` or with the policy |
| 125 | implementation. For example, a network policy test can be put into |
| 126 | `chrome/browser/net`. Ideally, your test would set the policy, fire up |
| 127 | the browser, and interact with the browser just as a user would do to |
| 128 | check whether the policy takes effect. |
| 129 | 8. Manually testing your policy. |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 130 | - Windows: The simplest way to test is to write the registry keys manually |
| 131 | to `Software\Policies\Chromium` (for Chromium builds) or |
| 132 | `Software\Policies\Google\Chrome` (for Google Chrome branded builds). If |
| 133 | you want to test policy refresh, you need to use group policy tools and |
| 134 | gpupdate; see |
| 135 | [Windows Quick Start](https://www.chromium.org/administrators/windows-quick-start). |
| 136 | - Mac: See |
| 137 | [Mac Quick Start](https://www.chromium.org/administrators/mac-quick-start) |
| 138 | (section "Debugging") |
| 139 | - Linux: See |
| 140 | [Linux Quick Start](https://www.chromium.org/administrators/linux-quick-start) |
| 141 | (section "Set Up Policies") |
| 142 | - Chrome OS and Android are more complex to test, as a full end-to-end |
| 143 | test requires network transactions to the policy test server. |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 144 | Instructions on how to set up the policy test server and have the |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 145 | browser talk to it are here: |
| 146 | [Running the cloud policy test server](https://www.chromium.org/developers/how-tos/enterprise/running-the-cloud-policy-test-server). |
| 147 | If you'd just like to do a quick test for Chrome OS, the Linux code is |
| 148 | also functional on CrOS, see |
| 149 | [Linux Quick Start](https://www.chromium.org/administrators/linux-quick-start). |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 150 | 9. If you are adding a new policy that supersedes an older one, verify that the |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 151 | new policy works as expected even if the old policy is set (allowing us to |
| 152 | set both during the transition time when Chrome versions honoring the old |
| 153 | and the new policies coexist). |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 154 | 10. If your policy has interactions with other policies, make sure to document, |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 155 | test and cover these by automated tests. |
| 156 | |
Owen Min | 5d685ceb | 2020-06-22 23:31:43 | [diff] [blame] | 157 | ## Launch a policy |
| 158 | 1. When adding a new policy, put the platforms it will be supported in the |
| 159 | `future_on` list. |
| 160 | - The policy is hidden from any auto-generated template or documentation on |
| 161 | those platforms. |
| 162 | - The policy will also be unavailable on Beta and Stable channel unless it's |
| 163 | enabled specifically by |
| 164 | [EnableExperimentalPolicies](https://cloud.google.com/docs/chrome-enterprise/policies/?policy=EnableExperimentalPolicies) |
| 165 | policy. |
| 166 | 2. Implement the policy, get launch approval if necessary. |
| 167 | 3. If the policy needs to be tested with small set of users first, keep the |
| 168 | platforms in the `future_on` list and running the tester program with the |
| 169 | [EnableExperimentalPolicies](https://cloud.google.com/docs/chrome-enterprise/policies/?policy=EnableExperimentalPolicies) |
| 170 | policy. |
| 171 | 4. Move the launched platforms from `future_on` to `supported_on` and set the |
| 172 | 'since_version' of those platforms to the milestone for which the launch |
| 173 | approval was granted. |
| 174 | 5. If the 'since_version' is set to a earlier milestone, you need to merge |
| 175 | back all necessary commits. |
| 176 | |
| 177 | **Do not use finch to control policy launch process.** |
| 178 | |
| 179 | Policies are inherently switches that admins will turn on if they need. Getting |
| 180 | inconsistent behavior based on factors outside of their control only causes |
| 181 | confusion and is source for support requests. Use the step 3 above if the policy |
| 182 | needs external testers before being officially announced. |
| 183 | |
Chris Sharp | 4a429b0 | 2020-08-04 15:57:22 | [diff] [blame] | 184 | ## Deprecating a policy |
| 185 | |
| 186 | A policy is deprecated when admins should stop using it. This is often because |
| 187 | a new policy was been released that should be used instead. |
| 188 | |
| 189 | When marking a policy as deprecated, it still needs to work the same as before |
| 190 | in Chrome. If you wish to remove the functionality, you'll need to changed the |
| 191 | supported_on field. See "Removing support for a policy" below for more details. |
| 192 | |
| 193 | ### Steps |
| 194 | 1. Update policy_templates.json, marking the policy as deprecated and updating |
| 195 | the description to describe when and why the policy as deprecated and what |
| 196 | admins should be doing instead. |
| 197 | 1. Update the policy handling code. This is generally ensuring that if the old |
| 198 | policy is set, the values are propagated to the new policies if they were |
| 199 | unset. |
| 200 | 1. Notify [email protected] to ensure this deprecation is |
| 201 | mentioned in the enterprise release notes. |
| 202 | |
| 203 | ## Removing support for a policy |
| 204 | |
| 205 | Generally speaking, policies shouldn't be removed from Chrome. Although they can |
| 206 | be deprecated fairly easily, removing support for a policy is a much bigger |
| 207 | issue, because admins might be relying on that functionality. |
| 208 | |
| 209 | The two main reasons for removing support for a policy are: |
| 210 | 1. It was a policy that was always documented as having a limited lifespan, |
| 211 | such as an escape hatch policy. |
| 212 | 1. The feature this policy impacts was removed from Chrome. |
| 213 | |
| 214 | If the policy was never launched, it can also be deleted from |
| 215 | policy_templates.json instead of just being marked as no longer supported. |
| 216 | In this case, please remember to add the deleted id to deleted_policy_ids. |
| 217 | |
Owen Min | f18a1ae | 2021-07-06 20:30:17 | [diff] [blame] | 218 | If you want to remove support for another reason, please reach out to someone in |
| 219 | [ENTERPRISE_POLICY_OWNERS](https://cs.chromium.org/chromium/src/components/policy/resources/ENTERPRISE_POLICY_OWNERS) |
Chris Sharp | 4a429b0 | 2020-08-04 15:57:22 | [diff] [blame] | 220 | to ensure this is okay. The general preference is to leave policies as |
| 221 | deprecated, but still supported. |
| 222 | |
| 223 | When removing support for a policy, update `supported_on` to correctly list the |
| 224 | last milestone the policy is supported on. Please also set 'deprecated' to True |
| 225 | if the policy skipped past the deprecation state. |
| 226 | |
| 227 | ### Steps |
| 228 | 1. Update policy_templates.json, marking the policy as no longer supported. |
| 229 | Also marking as deprecated if not previously done. |
Owen Min | f18a1ae | 2021-07-06 20:30:17 | [diff] [blame] | 230 | 1. Update the related test in the `policy_test_cases.json`. |
| 231 | - If the policy is going to be removed in the current milestone, remove the |
| 232 | the test at the same time. |
| 233 | - If the policy is going to be removed in the future milestone, remove the |
| 234 | test **after** policy support ended. |
Chris Sharp | 4a429b0 | 2020-08-04 15:57:22 | [diff] [blame] | 235 | 1. Remove the policy handling code. |
| 236 | 1. Notify [email protected] to ensure this removal of support is |
| 237 | mentioned in the enterprise release notes. |
| 238 | |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 239 | ## Examples |
| 240 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 241 | Here is an example based on the instructions above. It's a good, simple place to |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 242 | get started: |
| 243 | [https://chromium-review.googlesource.com/c/chromium/src/+/1742209](https://chromium-review.googlesource.com/c/chromium/src/+/1742209) |
| 244 | |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 245 | |
| 246 | ## Modifying existing policies |
| 247 | |
| 248 | If you are planning to modify an existing policy, please send out a one-pager to |
| 249 | client- and server-side stakeholders explaining the planned change. |
| 250 | |
| 251 | There are a few noteworthy pitfalls that you should be aware of when updating |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 252 | the code that handles existing policy settings, in particular: |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 253 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 254 | - Make sure the policy metadata is up-to-date, in particular `supported_on`, and |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 255 | the feature flags. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 256 | - In general, don't change policy semantics in a way that is incompatible |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 257 | (as determined by user/admin-visible behavior) with previous semantics. **In |
| 258 | particular, consider that existing policy deployments may affect both old and |
| 259 | new browser versions, and both should behave according to the admin's |
| 260 | intentions**. |
| 261 | - **An important pitfall is that adding an additional allowed |
| 262 | value to an enum policy may cause compatibility issues.** Specifically, an |
| 263 | administrator may use the new policy value, which makes older Chrome versions |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 264 | that may still be deployed (and don't understand the new value) fall back to |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 265 | the default behavior. Carefully consider if this is OK in your case. Usually, |
| 266 | it is preferred to create a new policy with the additional value and deprecate |
| 267 | the old one. |
| 268 | - Don't rely on the cloud policy server for policy migrations because |
| 269 | this has been proven to be error prone. To the extent possible, all |
| 270 | compatibility and migration code should be contained in the client. |
| 271 | - It is OK to expand semantics of policy values as long as the previous policy |
| 272 | description is compatible with the new behavior (see the "extending enum" |
| 273 | pitfall above however). |
| 274 | - It is OK to update feature implementations and the policy |
| 275 | description when Chrome changes as long as the intended effect of the policy |
| 276 | remains intact. |
| 277 | - The process for removing policies is to deprecate them first, |
| 278 | wait a few releases (if possible) and then drop support for them. Make sure you |
| 279 | put the deprecated flag if you deprecate a policy. |
| 280 | |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 281 | ### Presubmit Checks when Modifying Existing Policies |
| 282 | |
| 283 | To enforce the above rules concerning policy modification and ensure no |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 284 | backwards incompatible changes are introduced, presubmit checks |
| 285 | will be performed on every change to |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 286 | [policy_templates.json](https://cs.chromium.org/chromium/src/components/policy/resources/policy_templates.json). |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 287 | |
| 288 | The presubmit checks perform the following verifications: |
| 289 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 290 | 1. It verifies whether a policy is considered **unreleased** before allowing a |
| 291 | change. A policy is considered unreleased if **any** of the following |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 292 | conditions are true: |
| 293 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 294 | 1. It is an unchanged policy marked as `future: true`. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 295 | 2. All the `supported_versions` of the policy satisfy **any** of the |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 296 | following conditions |
| 297 | 1. The unchanged supported major version is >= the current major |
| 298 | version stored in the VERSION file at tip of tree. This covers the |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 299 | case of a policy that has just recently been added, but has not yet |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 300 | been released to a stable branch. |
| 301 | 2. The changed supported version == unchanged supported version + 1 and |
| 302 | the changed supported version is equal to the version stored in the |
| 303 | VERSION file at tip of tree. This check covers the case of |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 304 | "unreleasing" a policy after a new stable branch has been cut, but |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 305 | before a new stable release has rolled out. Normally such a change |
| 306 | should eventually be merged into the stable branch before the |
| 307 | release. |
Owen Min | 5d685ceb | 2020-06-22 23:31:43 | [diff] [blame] | 308 | 3. `supported_on` list is empty. |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 309 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 310 | 2. If the policy is considered **unreleased**, all changes to it are allowed. |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 311 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 312 | 3. However if the policy is released then the following verifications |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 313 | are performed on the delta between the original policy and the changed |
| 314 | policy. |
| 315 | |
| 316 | 1. Released policies cannot be removed. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 317 | 2. Released policies cannot have their type changed (e.g. from bool to |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 318 | Enum). |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 319 | 3. Released policies cannot have the `future: true` flag added to it. This |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 320 | flag can only be set on a new policy. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 321 | 4. Released policies can only add additional `supported_on` versions. They |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 322 | cannot remove or modify existing values for this field except for the |
| 323 | special case above for determining if a policy is released. Policy |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 324 | support end version (adding "-xx" ) can however be added to the |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 325 | supported_on version to specify that a policy will no longer be |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 326 | supported going forward (as long as the initial `supported_on` version |
| 327 | is not changed). |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 328 | 5. Released policies cannot be renamed (this is the equivalent of a |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 329 | delete + add). |
| 330 | 6. Released policies cannot change their `device_only` flag. This flag can |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 331 | only be set on a new policy. |
| 332 | 7. Released policies with non dict types cannot have their schema changed. |
| 333 | 1. For enum types this means values cannot be renamed or removed (these |
| 334 | should be marked as deprecated instead). |
| 335 | 2. For int types, we will allow making the minimum and maximum values |
| 336 | less restrictive than the existing values. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 337 | 3. For string types, we will allow the removal of the "pattern" |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 338 | property to allow the validation to be less restrictive. |
| 339 | 4. We will allow addition to any list type values only at the end of |
| 340 | the list of values and not in the middle or at the beginning (this |
| 341 | restriction will cover the list of valid enum values as well). |
| 342 | 5. These same restrictions will apply recursively to all property |
| 343 | schema definitions listed in a dictionary type policy. |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 344 | 8. Released dict policies cannot remove or modify any existing keys in |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 345 | their schema. They can only add new keys to the schema. |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 346 | 1. Dictionary policies can have some of their "required" fields removed |
Tien Mai | ad5a9ab | 2019-11-28 16:02:35 | [diff] [blame] | 347 | in order to be less restrictive. |
| 348 | |
Owen Min | 5d685ceb | 2020-06-22 23:31:43 | [diff] [blame] | 349 | 4. A policy is **partially released** if both `supported_on` and |
| 350 | `future_on` list are not empty. |
| 351 | |
| 352 | 5. The **partially released** policy is considered as a **released** policy |
| 353 | and only the `future_on` list can be modified freely. However, any |
| 354 | platform in the `supported_on` list cannot be moved back to the `future_on` |
| 355 | list. |
| 356 | |
| 357 | |
Owen Min | e6533d7 | 2019-12-19 03:55:21 | [diff] [blame] | 358 | ## Cloud Policy |
| 359 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 360 | **For Googlers only**: The Cloud Policy will be maintained by the Admin console |
| 361 | team. |
| 362 | [See instructions here](https://docs.google.com/document/d/1QgDTWISgOE8DVwQSSz8x5oKrI3O_qAvOmPryE5DQPcw/edit?usp=sharing) |
| 363 | on how to update the Cloud Policy. |
Owen Min | e6533d7 | 2019-12-19 03:55:21 | [diff] [blame] | 364 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 365 | ## Post policy update |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 366 | |
Jana Grill | 5fb6956 | 2020-03-09 15:01:11 | [diff] [blame] | 367 | Once the policy is added or modified, nothing else needs to be taken |
| 368 | care of by the Chromium developers. However, there are a few things that will be |
| 369 | updated based on the json file. Please note that there is no ETA for |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 370 | everything listed below. |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 371 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 372 | * [Policy templates](https://dl.google.com/dl/edgedl/chrome/policy/policy_templates.zip) |
| 373 | will be updated automatically. |
| 374 | * [Policy documentation](https://cloud.google.com/docs/chrome-enterprise/policies/) |
| 375 | will be updated automatically. |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 376 | |
Victor-Gabriel Savu | 42dcd42 | 2020-05-05 12:26:21 | [diff] [blame] | 377 | ## Targeting features at commercial users |
| 378 | |
| 379 | The recommended method to target commercial users is to create a policy to |
| 380 | control the behavior of a feature. You can for example create a feature only |
| 381 | for consumer users by setting `default_for_enterprise_users` to false; however, |
| 382 | it should only be used when the default enterprise behavior should be different |
| 383 | than regular consumer behavior. |
| 384 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 385 | ------ |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 386 | |
Owen Min | f2127ad0 | 2019-12-17 19:59:49 | [diff] [blame] | 387 | ### Additional Notes |
Owen Min | 326f43e | 2019-11-13 16:08:30 | [diff] [blame] | 388 | |
Owen Min | 5d685ceb | 2020-06-22 23:31:43 | [diff] [blame] | 389 | 1. policy_templates.json is actually a Python dictionary even though the file |
| 390 | name contains *json*. |
| 391 | 2. The `future_on` flag can disable policy on Beta of Stable channel only if the |
| 392 | policy value is copied to `PrefService` in Step 3 of **Adding a new policy**. |