Chrome exposes a different set of configurations to administrators. These configurations are called policy and they give administrators more advanced controls than the normal users. With different device management tools, an administrator can deliver these policies to many users. Here is the help center article that talks about Chrome policy and its deployment.
Usually you need a policy when
Launching a new feature. Create a policy so that the admin can disable or enable the feature for all users.
Deprecating an old feature. Create a policy to give enterprise users more time to migrate away from the feature.
To read more about best practices for shipping enterprise friendly features, please read this article.
This article covers lots of technical details. More information about policy design can be found at policy_design.md.
.group.details.yaml file with the caption and description of the group. This group is used for documentation and policy template generation, so it is recommended to group policies in meaningful groups.PolicyName.yaml under the appropriate policy group. You may use policy.yaml to start off your policy.supported_on, future_on do not change the code behavior.supported_on and future_on: They control the platforms that the policy supports. supported_on is used for released platforms with milestone range while future_on is used for unreleased platforms. See Launch a policy below for more information.default_for_enterprise_users: Its value is applied as a mandatory (unless default_policy_level is set) policy for managed users on ChromeOS unless a different setting is explicitly set.default_policy_level: If set to “recommended” the default_for_enterprise_users is applied as a recommended policy.dynamic_refresh: It tells the admin whether the policy value can be changed and take effect without re-launching Chrome.per_profile: It tells the admin whether different policy values can be assigned to different profiles.can_be_recommended: It tells the admin whether they can mark the policy as recommended and allow the user to override it in the UI, using a command line switch or an extension.If you are adding multiple policies that are closely related and interact with each other, you should put them in policy atomic group. An atomic policy group is used in the Chromium code and affects how policies are applied. When enabled by the admin, this ensures that policies from an atomic group get their values from the same source and are not a mix of policies from multiple sources. This feature is controlled by the policy PolicyAtomicGroupsEnabled.
Create a policy_atomic_groups.yaml file in the group where you added the policies if it does not already exist. You may use policy.yaml as reference.
per_profile attribute in the YourPolicyName.yaml. We also strongly encourage developers to register the prefs with Profile Prefs if possible, because this gives admin more flexibility of policy setup.kSimplePolicyMap in configuration_policy_handler_list_factory.cc. If the policy needs additional verification or processing, please implement a ConfigurationPolicyHandler to do so.chrome://settings, the associated option should be disabled when the policy controlling it is managed.dynamic_refresh if possible.components/policy/proto/chrome_device_policy.proto. Please note that all proto fields are optional.chrome/browser/ash/policy/core/device_policy_decoder.{h,cc} for the new policy.chrome/browser/policy/<area>_policy_browsertest.cc or with the policy implementation. For example, a network policy test can be put into chrome/browser/net. Ideally, your test would set the policy, fire up the browser, and interact with the browser just as a user would do to check whether the policy takes effect.Software\Policies\Chromium (for Chromium builds) or Software\Policies\Google\Chrome (for Google Chrome branded builds). If you want to test policy refresh, you need to use group policy tools and gpupdate; see Windows Quick Start. - Mac: See Mac Quick Start (section “Debugging”) - Linux: See Linux Quick Start (section “Set Up Policies”) - ChromeOS and Android are more complex to test, as a full end-to-end test requires network transactions to the policy test server. Instructions on how to set up the policy test server and have the browser talk to it are here: Running the cloud policy test server. If you'd just like to do a quick test for ChromeOS, the Linux code is also functional on CrOS, see Linux Quick Start.future_on list.future_on list and running the tester program with the EnableExperimentalPolicies policy.future_on to supported_on and set the ‘since_version’ of those platforms to the milestone for which the launch approval was granted.New browser features guarded by policy should also be behind a Finch based kill switch. This is a Finch configuration that allows to quickly disable a feature. Do not use normal Finch experimentation and rollout process to control the policy launch process.
If you need to launch an emergency kill switch config due to a bug, please contact your TPM and the release owner (see https://chromiumdash.appspot.com/schedule).
For more information see go/chrome-flag-guarding (internal doc, Googlers only).
Kill switches are not required for ChromeOS-specific features.
A policy is deprecated when admins should stop using it. This is often because a new policy was been released that should be used instead.
When marking a policy as deprecated, it still needs to work the same as before in Chrome. If you wish to remove the functionality, you'll need to changed the supported_on field. See “Removing support for a policy” below for more details.
YourPolicyName.yaml, marking the policy as deprecated and updating the description to describe when and why the policy as deprecated and what admins should be doing instead.Generally speaking, policies shouldn't be removed from Chrome. Although they can be deprecated fairly easily, removing support for a policy is a much bigger issue, because admins might be relying on that functionality.
The two main reasons for removing support for a policy are:
If the policy was never launched, YourPolicyName.yaml can be deleted and you may replace the policy name in policies.yaml by an empty string.
If you want to remove support for another reason, please reach out to someone in ENTERPRISE_POLICY_OWNERS to ensure this is okay. The general preference is to leave policies as deprecated, but still supported.
When removing support for a policy:
YourPolicyName.yaml to mark the poilcy as no longer supported.supported_on to correctly list the last milestone the policy is supported on.policy_test_cases.json by clearing the the test for that policy.If you are planning to modify an existing policy, please send out a one-pager to client- and server-side stakeholders explaining the planned change.
There are a few noteworthy pitfalls that you should be aware of when updating the code that handles existing policy settings, in particular:
supported_on, and the feature flags.default, default_for_enterprise_users and default_policy_level must (likely) never change after the launch. Contact cros-policy-muc-eng@google.com for guidance if you need to make such changes.To enforce the above rules concerning policy modification and ensure no backwards incompatible changes are introduced, presubmit checks will be performed on every change to templates.
The presubmit checks perform the following verifications:
It verifies whether a policy is considered unreleased before allowing a change. A policy is considered unreleased if any of the following conditions are true:
future: true.supported_versions of the policy satisfy any of the following conditionssupported_on list is empty.If the policy is considered unreleased, all changes to it are allowed.
However if the policy is released then the following verifications are performed on the delta between the original policy and the changed policy.
future: true flag added to it. This flag can only be set on a new policy.supported_on versions. They cannot remove or modify existing values for this field except for the special case above for determining if a policy is released. Policy support end version (adding “-xx” ) can however be added to the supported_on version to specify that a policy will no longer be supported going forward (as long as the initial supported_on version is not changed).device_only flag. This flag can only be set on a new policy.A policy is partially released if both supported_on and future_on list are not empty.
The partially released policy is considered as a released policy and only the future_on list can be modified freely. However, any platform in the supported_on list cannot be moved back to the future_on list.
For Googlers only: The Cloud Policy will be maintained by the Admin console team. See instructions here on how to update the Cloud Policy.
Once the policy is added or modified, nothing else needs to be taken care of by the Chromium developers. However, there are a few things that will be updated based on the json file. Please note that there is no ETA for everything listed below.
The recommended method to target commercial users is to create a policy to control the behavior of a feature. You can for example create a feature only for consumer users by setting default_for_enterprise_users to false; however, it should only be used when the default enterprise behavior should be different than regular consumer behavior.
future_on flag can disable policy on Beta of Stable channel only if the policy value is copied to PrefService in Step 3 of Adding a new policy.