Chromium can pull down enterprise policy configuration from a cloud service. We have a simplistic python implementation of the management service, so we are able to test features without relying on a full cloud policy server implementation. This page explains how to run it:
Running the test server
Setting up a policy fileThe test server reads policy to supply to clients from a text file in JSON format. The file needs to be placed in the directory specified with the --data-dir switch and must be named device_management. The file is re-consulted on each policy request, so you can change policy definitions on the file without restarting the server (which would invalidate existing DMTokens, so restarting the server is usually not advised). Below is an example file. Note that I like to keep all different kinds of policies in the file, and I disable them by prefixing the name with a dash. That works because the server just ignores keys it doesn't understand:{ "google/chrome/user" : { "mandatory" : { "HomepageLocation" : "http://www.chromium.org", "-HomepageIsNewTabPage" : false, "RestoreOnStartup" : 4, "RestoreOnStartupURLs" : [ "chrome://policy", "chrome://settings" ], "ShowHomeButton": true, "-SyncDisabled": true }, "recommended" : { "-ProxyMode" : "pac_script", "-ProxyPacUrl": "http://proxyconfig/wpad.dat", "-ProxyBypassList": "127.0.0.1,localhost" } }, "google/chromeos/user" : { "mandatory" : { "HomepageLocation" : "http://www.example.com", "-HomepageIsNewTabPage" : false, "RestoreOnStartup" : 4, "RestoreOnStartupURLs" : [ "chrome://policy", "chrome://settings" ], "ShowHomeButton": true, "-ApplicationLocaleValue" : "de", "-SyncDisabled": true, "-PasswordManagerEnabled": false, "-PasswordManagerAllowShowPasswords": false, "-AutoFillEnabled": false, "-AlternateErrorPagesEnabled": false, "-SearchSuggestEnabled": false, "-DnsPrefetchingEnabled": false, "-SafeBrowsingEnabled": true, "-MetricsReportingEnabled": false, "-DisableSpdy": true, "-JavascriptEnabled": false, "-ProxyServerMode" : 2, "-ProxyMode" : "pac_script", "-ProxyPacUrl": "http://wpad/wpad.dat", "-ProxyBypassList": "127.0.0.1,localhost", "-PrintingEnabled" : false, "-DisabledPlugins": [ "*Shockwave Flash*" ], "-DisabledSchemes" : [ "mailto", "ftp" ], "-SavingBrowserHistoryDisabled" : true, "-DeveloperToolsDisabled": true, "-Disable3DAPIs": true, "-DefaultSearchProviderEnabled": true, "-DefaultSearchProviderName": "TIMES", "-DefaultSearchProviderKeyword": "nytimes.com", "-DefaultSearchProviderSearchURL": "http://query.nytimes.com/gst/sitesearch_selector.html?query={searchTerms}&type=nyt&x=0&y=0", "-DefaultSearchProviderEncodings": [ "UTF-8" ], "-ExtensionInstallForcelist": [ "lcncmkcnkcdbbanbjakcencbaoegdjlp;https://clients2.google.com/service/update2/crx" ], "-ExtensionInstallBlacklist" : [ "*" ], "-ExtensionInstallWhitelist" : [ "mgijmajocgfcbeboacabfgobmjgjcoja" ], "-DefaultPopupsSetting": 1, "-PopupsBlockedForUrls" : [ "www.javascript-coder.com" ], "-PopupsAllowedForUrls" : [ ], "-DefaultCookiesSetting" : 2, "-CookiesAllowedForUrls" : [ "www.heise.de" ], "-CookiesBlockedForUrls" : [ "www.google.com" ], "-CookiesSessionOnlyForUrls" : [ "www.google.com" ], "-DefaultNotificationsSetting": 1, "-BlockThirdPartyCookies" : true, "-PolicyRefreshRate" : 30000, "ChromeOsLockOnIdleSuspend" : true }, "recommended" : { "-ProxyMode" : "pac_script", "-ProxyPacUrl": "http://proxyconfig/wpad.dat", "-ProxyBypassList": "127.0.0.1,localhost" } }, "google/chromeos/device" : { "device_policy_refresh_rate" : 120000, "user_whitelist" : [ "*@managedchrome.com" ], "guest_mode_enabled" : true, "show_user_names" : true, "data_roaming_enabled" : false, "allow_new_users" : true, "metrics_enabled" : true, "release_channel" : "dev-channel", "open_network_configuration" : "{ \"NetworkConfigurations\": [ { \"Type\": \"WiFi\", \"GUID\": \"1234-5678-device\", \"Name\": \"Device Network\", \"WiFi\": { \"SSID\": \"Device Test\", \"Passphrase\": \"password.\", \"AutoConnect\": true, \"HiddenSSID\": false, \"Security\": \"WPA-PSK\" } } ] }", "report_version_info" : true, "report_activity_times" : true, "report_boot_mode" : true, "ephemeral_users_enabled" : true }, "managed_users" : [ "*" ], "policy_user" : "madmax@managedchrome.com"}Some notes on the file contents:
Configuring Chromium OS to talk to the test serverIn order to do something useful with the test server, you can configure Chromium built for Chromium OS to talk to the test server for device- and user-level policy. Here is what you need to do:
Configuring Chromium to talk to the test serverPass the following command line flag to chrome:
User policyTo test some user policy setting, configure the policy file as desired and then just log in. The browser should automatically pull policy. You can verify that the policy is correctly pulled down from the server by inspecting chrome://policy. To test policy changes, you can also just update the policy in the file, and use the "Reload policies" button on chrome://policy to refresh policy at runtime. Device policyFor devices to receive device policy, they need to be enrolled for enterprise management at device setup time. There are some requirements for that to succeed:
To perform the actual enrollment, hit Ctrl+Alt+E on the sign in screen. Provide credentials (note that in case of the test server, you must match the "policy_user" field from your "device_management" JSON file) and speak a short prayer. If you get lucky, the device will enroll. Log in and check chrome://policy for whether it says device policy is present. |
