Prisma Cloud IDE 插件中的代理配置

Prisma Cloud IDE 插件中的代理配置

761
Created On 10/31/24 14:27 PM - Last Modified 03/02/26 19:31 PM


Symptom


  • 客户在使用 IntelliJ IDEA 和 VS Code 插件时遇到问题 1.。配置为使用代理后,插件无法连接到端点。看来插件没有使用 IDE 或系统范围代理的代理设置。

  • 使用 IntellijIDEA 插件时,如果配置了代理,则插件无法连接到端点。看来插件没有使用 IDE 中设置的代理或系统范围的代理。
2024-10-08 12:14:40,284 [MainThread ] [WARNI] An unexpected error occurred getting the run configuration from <https://<FQDN>>/bridgecrew/api/v2/checkov/runConfiguration after multiple retries. Please verify your API key and Prisma API URL, and retry. If the problem persists, please enable debug logs and contact support. The error is: HTTPSConnectionPool(host='api.eu.prismacloud.io', port=443): Max retries exceeded with url: /login (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x148affc80>, 'Connection to api.eu.prismacloud.io timed out. (connect timeout=3.1)')) Traceback (most recent call last): File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connection.py", line 203, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: timed out

Proxy settings:

c53cf14f-80ec-4ad1-8fce-9c2442402fa3.jpg

当我使用代理(http)时,Visual Studio Code 出现同样的问题。

  1. export proxy setting via command export HTTPS_PROXY="http://:@:"

  2. start Visual Studio Code via command code

  3. 配置Prisma Cloud 插件并连接测试没OK

  4. 开始全面扫描

“运行完整扫描”的日志:

2024-10-11 09:55:35 [info]: Initiating Prisma Cloud VS Code extension version 1.0.21 2024-10-11 09:55:35 [info]: Plugin path: /Users/amusarra/.vscode/extensions/prismacloud.prisma-cloud-1.0.21 2024-10-11 09:55:35 [info]: customer is not supporting SAST 2024-10-11 09:55:35 [error]: Failed fetching a new JWT token, authorization on prisma failed: Request failed with status code 500 2024-10-11 09:55:35 [error]: CustomersModulesService is not enabled Or token not exists {"isEnabled":true} 2024-10-11 09:55:35 [info]: customer is not supporting SAST 2024-10-11 09:55:35 [info]: Installing Checkov with Docker 2024-10-11 09:55:35 [error]: The Checkov installation with Docker was failed {"error":{"name":"Error","message":"Command failed: docker pull bridgecrew/checkov:latest\nCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n","stack":"Error: Command failed: docker pull bridgecrew/checkov:latest\nCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n\n at genericNodeError (node:internal/errors:984:15)\n at wrappedFn (node:internal/errors:538:14)\n at ChildProcess.exithandler (node:child_process:423:12)\n at ChildProcess.emit (node:events:519:28)\n at ChildProcess.emit (node:domain:488:12)\n at maybeClose (node:internal/child_process:1105:16)\n at Socket.<anonymous> (node:internal/child_process:457:11)\n at Socket.emit (node:events:519:28)\n at Socket.emit (node:domain:488:12)\n at Pipe.<anonymous> (node:net:339:12)"}} 2024-10-11 09:55:35 [info]: Installing Checkov with Pip3 2024-10-11 09:55:35 [info]: Checking the Python version 2024-10-11 09:55:37 [error]: No executor found for undefined, aborting scan operation 2024-10-11 09:55:37 [info]: There are no installationId or jwtToken for sending analytics data 2024-10-11 09:55:49 [info]: Successfully installed Checkov using pip3 {"type":"pip3","entrypoint":"checkov"} 2024-10-11 09:55:54 [info]: proxy settings: "" 2024-10-11 09:55:54 [warn]: There are files opened from outside the workspace that won't be scanned in these directories: "/Users/amusarra/Library/Application Support/Code/logs/20241011T095522/window1/exthost/PrismaCloud.prisma-cloud" 2024-10-11 09:55:54 [info]: checkov --repo-id vscode/extension --quiet --soft-fail --output json --bc-api-key --directory "/Users/amusarra/dev/github/amusarra/tls-mutual-auth" 2024-10-11 09:56:20 [info]: Full error checkov process output: 2024-10-11 09:56:20,092 [MainThread ] [WARNI] An unexpected error occurred getting the run configuration from https://api.eu.prismacloud.io/bridgecrew/api/v2/checkov/runConfiguration after multiple retries. Please verify your API key and Prisma API URL, and retry. If the problem persists, please enable debug logs and contact support. The error is: HTTPSConnectionPool(host='api.eu.prismacloud.io', port=443): Max retries exceeded with url: /login (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1493f79e0>, 'Connection to api.eu.prismacloud.io timed out. (connect timeout=3.1)')) Traceback (most recent call last): File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connection.py", line 203, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: timed out The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 492, in _make_request raise new_e File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 468, in _make_request self._validate_conn(conn) File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 1097, in _validate_conn conn.connect() File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connection.py", line 611, in connect self.sock = sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connection.py", line 212, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x1493f79e0>, 'Connection to api.eu.prismacloud.io timed out. (connect timeout=3.1)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/checkov/common/bridgecrew/platform_integration.py", line 1021, in get_customer_run_config token = self.get_auth_token() ^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/cachetools/init.py", line 752, in wrapper v = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/checkov/common/bridgecrew/platform_integration.py", line 300, in get_auth_token request = self.http.request("POST", f"{self.prisma_api_url}/login", # type:ignore[no-untyped-call] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/_request_methods.py", line 118, in request return self.request_encode_body( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/_request_methods.py", line 217, in request_encode_body return self.urlopen(method, url, **extra_kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/poolmanager.py", line 443, in urlopen response = conn.urlopen(method, u.request_uri, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 875, in urlopen return self.urlopen( ^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 875, in urlopen return self.urlopen( ^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 875, in urlopen return self.urlopen( ^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/connectionpool.py", line 845, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/Users/amusarra/Library/Python/3.12/lib/python/site-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.eu.prismacloud.io', port=443): Max retries exceeded with url: /login (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1493f79e0>, 'Connection to api.eu.prismacloud.io timed out. (connect timeout=3.1)')) An error occurred getting data from the platform, including policy metadata. Because --include-all-checkov-policies was not used, Checkov cannot differentiate Checkov-only policies from platform policies, and no policies will get evaluated. Please resolve the error above or re-run with the --include-all-checkov-policies argument (but note that this will not include any custom platform configurations or policy metadata).

与通过系统环境配置代理不同,直接在 VS Code 中设置代理是可行的。

3d67bc5c-b7fd-460c-8ed0-164d28260ca7.jpg b7f86e9c-c768-41cb-b2a5-f19cf33db729.jpg



Environment


  • 环境:macOS 24.0.0 Darwin 内核版本 24.0.0
  • Python :3.12
  • IDE :IntelliJ IDEA 2024.2.3(终极版)
  • Prisma 插件:1.0.21


Cause


  • 代理设置已删除。


Resolution


  • 以下版本引入了对设置 | 外观和行为 | 系统设置 | HTTP代理下的用户代理配置的支持:

    适用于 JetBrains 产品版本 2024.2.* 及更高版本的版本 1.0.23
    适用于 JetBrains 产品版本 2020.3.* 至 2024.1.* 的版本 1.0.23-203.241
    对于 VS Code,代理支持已经可用,如此github 问题中所述



Additional Information




Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000TpIWCA0&lang=zh_CN&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language