You have generated a HAR file and now you are planning to share the file with customer support for review and investigation. The following precautions should be taken to prepare the file before sharing.
The initial generation of the HAR file is covered in the article below.
The HAR file tracks all the logging of a web browser’s interaction with a site. It is a useful resource for troubleshooting issues with the web application.
The HAR file has a .har file extension. It is a text document and it can be opened with a text editor. The content is in JSON format. It is best to use a text editor that can convert JSON to a friendly readable format. e.g. Notepad++, or Visual Studio Code.
Google also offer a useful HAR Analyzer that can open the HAR file and present it.
It should be noted that a HAR file may contain sensitive PII data that is present in the browser at the time of generation. For security reasons, this sensitive information should be masked within the HAR file.
Examples of sensitive information may include the Legal Entity name, server name, or authorization tokens.
These sensitive details may be masked within the file.
When masking the sensitive data in the HAR file it is important to maintain the integrity of the JSON formatting. Altering this JSON structure in some way may invalidate the file and prevent applications from opening it correctly.
Follow these steps to mask the data within the HAR file:
Make a copy of the original HAR file for editing
Search for the text string to be replaced within the document
Do a find and replace for the sensitive data with words such as [masked]
It is recommended that the server names be replaced but an indication maintained of PROD, UAT, DEV
Care should be taken not to disrupt the special characters within the document i.e. commas, brackets, quotation marks.
When the modifications have been made to the HAR file, the file should be validated. The easiest way to do this is by attempting to open it using the Google HAR Analyzer (as mentioned above). If there are formatting issues the file will not open correctly in this tool.