Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: read zscaler certificates from system store #35538

Closed

Conversation

twitharshil
Copy link
Contributor

@twitharshil twitharshil commented Sep 1, 2022

Description of Change
Zscaler is one of the leading vendors for MITM-based proxy environments across the industry. Proxies like ZScaler intercepts the requests sent to a certain endpoint from the user machine and serve a redirect to their own servers ( for eg: https://gateway.zscloud.net/ ) before finally redirecting back to the original endpoint.

In some zscaler-specific user environments, we have observed Zscaler root certificate authorities present on the user system store. These certificates are needed for the request's SSL certificate verification. Chrome reads certificates from the system store hence the certificate verification step passes when a request is sent out of the user machine through chrome as a client.

Electron embedding Chromium and Node.js into its binary. The embedded chromium in the renderer process reads the certificates from the system store hence these client SSL certificate verification passes smoothly. Although it fails for the request going through the main process of the electron. Electron uses node that uses a statically compiled, hardcoded list of certificate authorities, rather than relying on the system's trust store.

This PR targets to read the Zscaler certificates from the user system store and embed that with the existing list of root certificates of the node. In this way application using electron and making a request through the main process doesn't have to get their domains whitelisted behind such an environment to make the request-sending features work for them.

Ref: This PR is based on observations and learnings from the user's environment. I've seen another #30174 in electron dealing with such type of MITM proxies environment which kind of has the same observations as well.

Note:

  1. In my current implementation I've added logic to read the Zscaler certificates from the system store and embed it with the existing list together in a single patch file. I am open to suggestions if we want the certificate detection logic to be written somewhere else.
  2. This PR only targets the windows platform for now. All the users from which we collected feedback were windows users only.

Notes: Added support for reading zscaler root CA's from system store

cc: @jviotti @RaisinTen @dsanders11

@twitharshil twitharshil requested review from a team as code owners September 1, 2022 06:10
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Sep 1, 2022
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been sent upstream to node yet?

@RaisinTen
Copy link
Contributor

No, not yet. @twitharshil could you send this patch to Node.js too? I think we should also modify the patch to read all kinds of certs from the Windows cert store, not just the Zscaler ones.

@nornagon
Copy link
Member

nornagon commented Sep 1, 2022

Consider using the net api in Electron instead of Node’s, to make requests with the Chromium network stack.

I don’t think this is a patch we would take without upstream support.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Sep 8, 2022
@zcbenz zcbenz added the wip ⚒ label Oct 5, 2022
@nornagon nornagon closed this Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants