.. title:: Chrome Managed Policies
Chrome Managed Policies
----------------------------------
Kasm administrators may wish to have certain configurations be automatically set when launching new instances of Google Chrome
in a Kasm Workspace.
This document will go over the details for adding Chrome configuration to an existing Kasm image and makes use of settings from `Chrome Policies `__.
As an example we will be editing the `Kasm Chrome Dockerfile `__, but any Desktop Dockerfile that installs Chrome can be used.
For instructions on how to build a Kasm image please see the :doc:`Building Image Documentation. `
Managed Bookmarks
=================
To build bookmarks into the image's bookmarks bar we will make use of the "ManagedBookmarks" Chrome Policy.
1. Create a file called 'bookmarks.json' with the following contents:
.. sourcecode:: json
{
"BookmarkBarEnabled": true,
"ManagedBookmarks":[
{
"toplevel_name":"Managed Bookmarks"
},
{
"name":"Google",
"url":"google.com"
},
{
"name":"Youtube",
"url":"youtube.com"
},
{
"name":"Chrome links",
"children":[
{
"name":"Chromium",
"url":"chromium.org"
},
{
"name":"Chromium Developers",
"url":"dev.chromium.org"
}
]
}
]
}
2. Edit the following line just before the "End Customizations" line in the 'dockerfile-kasm-chrome' file.
.. code-block::
COPY ./bookmarks.json /etc/opt/chrome/policies/managed/bookmarks.json
3. Build the image using the instructions from the :doc:`Building Images Documentation. `
Managed Extensions
==================
To build extensions into the image we make use of the "ExtensionSettings" Chrome Policy.
1. Find a chrome extension you want to add to an image, in this case we will use "UBlock Origin" from the Chrome Web Store, making a note of the URL.
.. sourcecode::
https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en
2. Create a file called 'extensions.json' with the following contents, note the Extension ID is copied from the Chrome Web Store URL.
.. sourcecode:: json
{
"ExtensionSettings": {
"*": {
"installation_mode": "blocked"
},
"cjpalhdlnbpafiamejdnhcphjbkeiagm": {
"installation_mode": "force_installed",
"update_url": "https://clients2.google.com/service/update2/crx",
"toolbar_pin" : "force_pinned"
}
}
}
2. Edit the following line just before the "End Customizations" line in the 'dockerfile-kasm-chrome' file.
.. code-block::
COPY ./extensions.json /etc/opt/chrome/policies/managed/extensions.json
3. Build the image using the instructions from the :doc:`Building Images Documentation. `