Proxies

BETA

Field-level reference for the proxy endpoint a company web proxy chains registry traffic to, the requests it accepts, and the Connections capture.

A proxy is the endpoint your company's web proxy hands registry traffic to. This page covers what that endpoint accepts, answers, and records. Setup: Connect a web proxy. How it works: Web proxy chaining.

Creating and managing proxies, the proxy object, and a proxy's routing table: API. What each operation requires: Permissions.

Requests the endpoint accepts

The endpoint accepts, on one port:

  • CONNECT <host>:443, followed by TLS for that host inside the tunnel
  • TLS directly, for a registry host, as if the endpoint were the registry
  • CONNECT over TLS to the endpoint's own hostname, when the deployment has one (an HTTPS proxy)
  • An absolute-form request for a plain http:// URL, such as GET http://registry.npmjs.org/lodash. HTTPS always arrives through CONNECT or direct TLS, above

Credential

CarrierWhereAccepted
X-Bytesafe-Proxy-Token: <credential>The CONNECT, or each requestIn every mode
Proxy-Authorization: Basic <base64(user:credential)>The CONNECT, or each requestThe password is the credential; with an empty password, the user name is
Proxy-Authorization: Bearer <credential>The CONNECT, or each request

When both are present, the header wins. A credential on the CONNECT applies to every request in the tunnel; a request may repeat it, but a different proxy's credential is refused. X-Bytesafe-Proxy-Token is removed before the request reaches the firewall.

Responses from the endpoint

These come from the endpoint itself, before a firewall sees the request. Once a request is routed, the firewall answers it as it would any client.

CodeWhen
407A CONNECT with a credential that matches no proxy, a CONNECT without one when no proxy can answer the TLS inside, or a plain-HTTP request without a credential. The response carries Proxy-Authenticate: Basic
403The host is not routed by the proxy, the request carries no credential or one that matches no proxy, the credential belongs to a different proxy than the connection, or a proxy using its own CA sent a request on a connection the shared root answered
400A request that is neither CONNECT nor absolute-form, on a connection that expects one

A refused TLS handshake has no status code; it appears on the Connections tab as TLS refused.

User identity header

For a proxy whose userHeader is plain or base64, the header named by userHeaderName is read on each request and recorded as proxyUser on log entries and firewall webhook events. The value is ignored when it is empty, Unknown (any case), not valid base64 for base64, contains non-printable characters, or is longer than 256 bytes. The header is removed before the request reaches the firewall, whether or not it was read.

X-Forwarded-For, when present, is recorded as the entry's remoteAddress.

Connection events

The Connections capture holds the latest 200 events for each proxy, newest first, from every Bytesafe server. A proxy's capture is dropped after seven days without new events, and when the proxy is deleted. An event that cannot be attributed to a proxy, such as a CONNECT with an unknown credential, is not recorded unless the endpoint has a default proxy.

FieldTypeDescription
timestringWhen the event happened
modestringconnect (a tunnel opened or was refused; recorded when the tunnel opens), tunnelled (a request inside a tunnel), origin (a request on a direct TLS connection), forward (a plain-HTTP request), handshake (a TLS handshake was refused or failed)
remoteAddressstringThe web proxy's address and port
listenerTlsbooleanThe web proxy spoke TLS to the endpoint's own hostname
serverNamestringThe TLS server name the web proxy asked for
authoritystringThe CONNECT target, or the host a request was for
method, pathstringThe request's method and path. No path for connect
credentialCarrierstringtoken-header, proxy-authorization-basic, proxy-authorization-bearer, tunnel (inherited from the CONNECT), or none
credentialValidbooleanA credential was found and matched a proxy
headerNamesstring[]The request's header names, sorted. Values are not recorded
authenticatedUserstringThe raw value of the user identity header, whether or not the proxy trusts it
userHeaderNamestringThe header authenticatedUser was read from
forwardedForstringThe raw X-Forwarded-For value
statusnumberThe response status. 0 for a refused handshake
detailstringWhy a handshake failed
instancestringThe Bytesafe server that saw the event

Audit actions

proxy.create, proxy.update, proxy.delete, and proxy.secret.rotate are recorded in the audit log, successes and failures alike.