Connectors Proxy is a core capability of the Connectors system that provides secure, secretless access to integrated tools. It typically operates as an HTTP service that can function as either a forward proxy or a reverse proxy for client applications.
When clients access tool resources through Connectors Proxy, the proxy automatically injects the necessary authentication credentials into requests, enabling seamless access without requiring clients to handle credentials directly. This approach delivers a significant security benefit:
To accommodate diverse tool authentication requirements, the platform supports both built-in and custom proxy implementations. Each ConnectorClass can provide its own proxy service, offering flexibility to meet specific tool authentication needs.
The built-in ConnectorsProxy implementation provides comprehensive HTTP/HTTPS protocol support with Basic Auth and Bearer Token authentication methods. It offers both forward proxy and reverse proxy capabilities.
Operates as a standard HTTP proxy using http_proxy and https_proxy environment variables. When the proxy receives client requests, it:
Connectors Proxy does not support the CONNECT method for HTTP tunneling. Clients must send HTTP requests directly to the proxy server.
Clients access tools by connecting directly to the Connector Proxy Address instead of the original tool URL. The proxy:
For tools requiring specialized authentication mechanisms, custom proxy implementations can be developed. These proxies can be implemented as either forward or reverse proxies based on specific requirements.
Example: The OCI Connector uses a custom OCI Plugin Proxy that supports OCI protocol with Bearer Token authorization for registries like Harbor and Docker Registry.
User can develop a custom proxy server and specified in the connectorclass.
Each Connector has a unique proxy address for accessing tool resources. The proxy address is stored in the status.proxy.httpAddress field:
Clients use this proxy address to access resources within the tool specified by the Connector.
For more fields about connectorclass, please refer to ConnectorClass
Connectors Proxy works seamlessly with the Connectors CSI Driver to provide a complete secretless access solution:
Connectors Proxy handles authentication injection and request routing to target tool.This integration is particularly useful in scenarios like:
For complete secretless access scenarios using Connectors Proxy and Connectors CSI Driver, see How to use the Git Connector to complete Git clone without storing credentials on the client
You can specify the proxy server to use in the ConnectorClass:
Connectors created from this ConnectorClass will use connectors-proxy-service as their real proxy server.
Built-in Proxy Configuration:
Custom Proxy Configuration:
Custom proxies can point to any address capable of handling proxy requests.
When using Connectors Proxy, clients must provide proper authentication credentials to access the proxy. The authentication process requires two key elements:
The proxy server validates the provided ServiceAccount token to ensure it has the necessary permissions for the specified Connector before processing requests and injects the authentication credentials into the request when valid.
For detailed information about ServiceAccount tokens and RBAC configuration, see the Kubernetes Authentication documentation.
For forward proxy mode, authentication information is passed through the Proxy-Authorization header using HTTP Proxy Basic Authentication.
<connector-namespace>/<connector-name>Proxy-Authorization Header:
HTTP Proxy Environment Example:
You can configure proxy authentication using standard HTTP proxy environment variables:
Note: The
%2Fis the URL-encoded form of/in the connector namespace/name format.
For reverse proxy mode, clients connect directly to the connector's proxy address. The authentication token can be provided using either Basic Auth or Bearer Token methods, while connector identification is handled through the connector proxy address.
Example:
Bearer <service-account-token>Example:
When using the built-in HTTP reverse proxy with tools that use non-standard authentication methods, clients may be unable to provide tokens using standard Basic Auth or Bearer Token methods. Instead, they must use the tool's original credential format.
To support these custom authentication formats, you can use Rego rules to customize token extraction from client requests. This allows the built-in HTTP reverse proxy to extract and validate tokens regardless of how they are provided by the client.
For example:
This configuration extracts the token from the Private-Token header in client requests, which the proxy then uses to validate client authentication.
This approach provides significant flexibility for non-standard HTTP authentication mechanisms. Client CLIs can provide Kubernetes tokens using the tool's original credential format, and the proxy extracts the token through Rego rules to complete authentication validation.
For more detailed configuration on using Rego rules to extract tokens, see ConnectorClass.
For more about injecting authentication credentials into backend request, see Injecting Authentication Credentials into Backend Request when using built-in Reverse Proxy.
The connector can be identified through different proxy address formats:
http://c-<connector-name>.<namespace>.svc.cluster.localhttp://<proxy-address>/namespaces/<connector-namespace>/connectors/<connector-name>The connector proxy address is automatically generated by the system and is unique for each connector. You must retrieve the connector proxy address from the status.proxy.httpAddress field of the connector resource before using it.
Example:
For a github connector in the default namespace:
The proxy will validate the authentication token and automatically inject the default/github connector's authentication credentials when forwarding requests to GitHub services.
After the built-in reverse proxy validates the client request, it injects authentication credentials into the backend request based on the credential type configured in the Connector. The following injection methods are supported:
When a Connector is configured with the secret type kubernetes.io/basic-auth, the proxy injects the credentials into the backend request headers using Basic Authentication.
When a Connector is configured with the secret type connectors.cpaas.io/bearer-token, the proxy injects the credentials into the backend request headers using Bearer Token authentication.
In addition to the standard Basic Auth and Bearer Token methods, you can use Rego rules to define custom authentication injection logic. For example:
This configuration injects the token value from the connector's secret data into the Private-Token header of backend requests.
For more detailed configuration, see ConnectorClass.
When using custom Rego authentication, you typically need to configure spec.proxy.authExtractor to extract tokens from client requests, enabling the built-in HTTP reverse proxy to validate client authentication.
Simultaneously, use spec.auth.types[].generator.rego to inject authentication credentials into backend requests.
This combination enables support for custom authentication mechanisms when using the built-in HTTP reverse proxy.