Skip to content

How do I create HAR files and console logs from my browser for an AWS Support case?

4 minute read
4

AWS Support asked that I create an HTTP Archive (HAR) file and console logs from my web browser to troubleshoot my support case.

Resolution

Important: HAR files and console logs can capture sensitive information, such as usernames, passwords, and keys. Before you send a HAR file and your console logs to AWS Support, make sure that you remove any sensitive information.

Create a HAR file in your browser

Take the following actions based on the browser that you use.

Google Chrome

Complete the following steps:

  1. In the Google Chrome browser, choose the Customize and control Google Chrome icon.
  2. Under More tools, choose Developer tools.
  3. Choose Network.
  4. Choose Preserve log.
  5. Choose the Clear network log icon to clear all current network requests, and then choose Record network log.
  6. Open the AWS Management Console.
  7. Reproduce your issue.
    Note: If AWS Support requires you to troubleshoot specific steps, then complete those steps now.
  8. In the DevTools panel, choose the Export HAR (sanitized)... icon to download the sanitized HAR file. Then, save the HAR file as prompted.
  9. In the DevTools panel, choose Console.
  10. Open the context (right-click) menu on any network request, choose Save as..., and then save the console file.

For information, see Chrome DevTools and HAR import and export buttons on the Chrome for Developers website.

Microsoft Edge (Chromium)

Complete the following steps:

  1. In the Microsoft Edge browser, choose the Settings and more icon.
  2. Under More tools, choose Developer tools.
  3. Choose Network.
  4. Select Preserve log.
  5. Choose Clear to clear all current network requests, and then choose Record network log.
  6. Open the AWS Management Console.
  7. Reproduce your issue.
    Note: If AWS Support requires you to troubleshoot specific steps, then complete those steps now.
  8. In the DevTools panel, choose the Export HAR (sanitized)... icon to download the sanitized HAR file. Then, save the HAR file as prompted.
  9. In the DevTools panel, choose Console.
  10. Open the context (right-click) menu on any network request, choose Save as..., and then save the console file.

For information, see Save all network requests to a HAR file on the Network Analysis Reference page of the Microsoft Documentation website.

Mozilla Firefox

Complete the following steps:

  1. In the Mozilla Firefox browser, choose the Open Application Menu icon.
  2. Choose More tools, and then choose Web Developer tools.
  3. In the Web Developer menu, choose Network.
    Note: In some versions of Firefox, the Web Developer menu is in the Tools menu.
  4. Choose the gear icon, and then select Persist Logs.
  5. Choose the trash can icon to clear all current network requests, and then choose Analyze to start performance analysis.
  6. Open the AWS Management Console.
  7. Reproduce your issue.
    Note: If AWS Support requires you to troubleshoot specific steps, then complete those steps now.
  8. In the Network Monitor, open the context (right-click) menu on any network request in the request list.
  9. Choose Save All As HAR, and then save the HAR file.
  10. In the DevTools panel, choose Console.
  11. Open the context (right-click) menu on any console request, choose Save all Messages to File, and then save the console file.

For information, see Network Monitor and Network request list on the Firefox Source Docs website.

Edit the HAR file and your console logs

Complete the following steps:

  1. Open the HAR file in a text editor application.
  2. Use the text editor's Find and Replace tools to identify and replace all sensitive information in the HAR file. Also, make sure that you remove or mask cookies and authentication headers.
    Note: You can remove sensitive information, and then enter with a generic string such as REDACTED_DUE_TO_SECURITY.
  3. Save the edited HAR file, and then repeat these instructions for the console file.

Submit the HAR file and your console logs

Complete the following steps:

  1. Open the AWS Support Center.
  2. Under Open support cases, select your support case.
  3. Select your preferred contact option.
  4. In the Description or Communication section, look for the Attachments section.
  5. Choose Add files to select files from your computer.
  6. Choose Submit.

Related information

What browsers does the AWS Management Console support?

11 Comments

Could you please add description about Console log into this article? It exists in "Console" panel on Developer Tools and it is as important as HAR file when we investigate a console issue.

AWS

replied 3 years ago

Updated article, thank you for the feedback.

replied 3 years ago

I really wish this article had some help for redacting sensitive info... I have no idea which AWS parameters are sensitive or not. Also doing this manually is a huge PITA. I'm having to use silly regexes with sed to fix up the HAR JSON, in order to save myself from a ton of error-prone manual work.

replied 3 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
EXPERT

replied 3 years ago

Until the review is complete... giving a blanket recommendation on what to redact is a bit of a challenge as there is no standard set of sensitive information. And how that sensitive information is included in the HAR file isn't consistent.

For example, if you capture an authentication attempt to Identity Center using Identity Provider X, the resulting HAR file will very likely show the HTTP call where your sent over your password to Identity Provider X. So you want to remove that password. If you authenticate using Identity Provider Y, the same thing happens.

But where the password is displayed (is it a HTTP query parameter? Is it sent in the body of the HTTP request?) depends on the Identity Provider itself and how the Identity Provider implemented their login flow. Also, if you're already logged into your Identity Provider, it may just forward you along without asking for your password again. So your password may not always be in the HAR file -- it depends on a lot of factors.

At the very least, I would suggest opening the HAR file in a text editor and doing a Find command using the plaintext value of your password. Wherever you find your password, remove it.

Regarding sensitive information about your Amazon environment itself, I wouldn't suggest redacting that. Because different support issues require different types of information. And there's no real way to list all types of support cases and what information is needed to troubleshoot.

AWS

replied 3 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
EXPERT

replied 3 years ago

You mention to "mask cookies and authentication headers", I wish you could provide more information about what specifically to mask. The HAR file I got is 12,000 lines long and contains more than 100 requests. Is the cookie aws-creds sensitive? What about the s_eVar60 header? aws-userInfo-signed? noflush_awsccs_sid? This is a lot to ask of people.

replied 2 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR

replied 2 years ago

I was linked to this article by AWS support as I was requested to provide a HAR file for an AWS CLI command we were having an issue with. The article does not provide information for this case. For CLI debugging below is the solution I found. I used this on Mac OS , but it should work on linux too.

For below steps Python installation is required as well as a functioning "pip" package manager for Python.

Terminal 1:

pip install mitmproxy
mitmproxy --set hardump=dump.har -w output.dump

On Terminal 1 you will see any requests made via a proxy which mitmproxy starts on port 8080.

Terminal 2:

HTTP_PROXY=http://localhost:8080 HTTPS_PROXY=http://localhost:8080 AWS_CA_BUNDLE=/Users/yourusername/.mitmproxy/mitmproxy-ca-cert.pem aws sts get-caller-identity

Replace the path to the CA cert, it should be located under .mitmproxy/mitmproxy-ca-cert.pem in your user's directory.

Replace the "sts get-caller-identity" command with whichever command you are debugging.

You will see the requests being logged in Terminal 1.

Once you quit mitmproxy using "q" key, the generated "dump.har" file is the HAR file. You should edit this file and remove sensitive information like security tokens and then provide the file to AWS.

replied 2 years ago

Chrome has changed its UI and now you must click the download button in the toolbar to download the logs. They are sanitized by default.

AWS
SUPPORT ENGINEER

replied 2 years ago

Please update Google Chrome Browser. The HAR stuff is in context menu > Copy > Copy all as HAR.

replied 2 years ago