Extension Source Code
Setting up the Browser Protector Extension For Distribution
Before deploying the Protegrity Browser Protector extension in your organization, you must set up the extension source code for secure distribution. This involves signing the extension and packaging it into a .crx file, which can then be distributed to users or deployed via MDM tools like Microsoft Intune.
Signing the extension ensures its integrity and authenticity, allowing browsers to verify that the extension has not been tampered with and originates from a trusted source. Packaging the extension into a .crx file makes it suitable for enterprise distribution and deployment.
Signing the Extension Binaries
Follow the steps below to create signed crx browser extension file.
Prepare the Extension Source Code
Protegrity will provide the following artifact.
- WAP_ALL-ALL-64_x86-64_Browser.Chrome-<version>.zip
The deployment package you receive from Protegrity must be extracted to reveal the Protegrity Browser Extension source files.
Extract the deployment package you receive from Protegrity to a folder. That folder will have Protegrity Browser Extension source files.
Place the extension source files folder in a directory on your system.
Generate a Private Key
- A private key is required to sign the extension. If you do not already have a private key, you can generate one using a key management tool or browser-specific utilities.
You can use the Chrome Developer Tools to generate a private key during the signing process.
- Store the private key securely, as it is critical for signing the extension and maintaining its authenticity, for instance when pushing new versions of the extension.
Security Guidelines
- Do not share the private key with unauthorized personnel.
- Store the private key in a secure location, such as a password-protected key management system or hardware security module (HSM).
- Ensure backups of the private key are kept in a secure environment.
Sign the Extension Using Chrome Developer Tools or the Chrome Command Prompt
Sign the Extension Using Chrome Browser Developer Tool
Open the Google Chrome browser.
Navigate to the extensions management page by entering the following URL in the address bar:
chrome://extensionsEnable Developer Mode.
At the top right corner of the extensions page, toggle the Developer Mode switch to enable it.
In Developer Mode, a new toolbar will appear at the top of the extensions page.
Click the Pack Extension button to open the packaging tool.
In the popup window:
- Extension root directory: Click the Browse button and select the folder containing Protegrity Browser Extension source files.
- Private key file (optional): If you already have a private key file (
.pem), provide its path by clicking Browse and selecting the file. This ensures the same key is used to sign the extension. - If you do not provide a private key, Chrome will generate one for you during the packaging process.
Click Pack Extension to generate the files.
Sign the Extension Using Chrome Command Prompt
Open a terminal or command prompt on your system.
Use Chrome’s
chrome.exetool or a third-party utility to sign the extension. For Chrome, the command is as follows:chrome.exe --pack-extension=path_to_extension_directory --pack-extension-key=path_to_private_key
Locate the Generated Files
Once the packaging process is complete, Chrome will create the following files:
- A
.crxfile: This is the signed extension package, which can be distributed and installed. - Optional: A
.pemfile: If no private key was provided, Chrome will generate a new.pemfile. This file contains the private key and must be securely stored. - The
.crxfile will be required in the Read Extension ID section.
Do not share the
.pemfile with unauthorized individuals, as it is used to sign future versions of the extension.
Read Extension ID
- Locate the
.crxfile from the Locate the Generated Files section. - Open Chrome and navigate to the Extensions page:
- Type
chrome://extensionsin the address bar and hit Enter.
- Type
- In the top-right corner of the Extensions page, toggle Developer mode ON.
- Drag the
.crxfile and drop it onto the Extensions page in Chrome. - When prompted, click Add Extension to complete the installation.
- The 32 character long extension ID will be displayed on the extension tile, for instance:
ID: abcdhleonbdlhddgbcfhffafcnjjabcd - Note the pty_extension_id.
The extension ID stays the same when as long as the same private key (.pem file) is used to sign it, even when updating the extension.
Security Guidelines
- Keep the
.pemfile secure. If it is lost, you will not be able to sign future versions of the extension, and you will need to distribute a new.crxsigned with a new key. - Never share the
.pemfile publicly or store it in insecure locations. - Use a secure key management system to protect your private key.
By following these steps, you can create a signed .crx file that is ready for secure distribution and installation in Chrome.
Feedback
Was this page helpful?