Overview
A Socket resource routes package manager traffic through a Socket Registry Firewall. Formal applies access policies and sends matching registry requests to the firewall, which retrieves packages from the upstream registry.Configure the Socket Registry Firewall
Configure the firewall to use path routing. Formal maps each supported package registry to the corresponding path:
Add a route for each ecosystem you want to proxy:
Create a Socket Resource
Create asocket using the firewall’s hostname
and port:
Configure Resource TLS
Formal must trust the certificate presented by the Socket Registry Firewall. Export the CA certificate that issued the firewall’s server certificate. If the server certificate is self-signed, export that certificate instead. In the Formal Console, add a TLS configuration to the Socket resource, select Verify Full, and add the PEM-encoded certificate to the CA trust store. With Terraform, use aformal_resource_tls_configuration resource:
Route Package Manager Traffic
Create a network rule from the Socket Registry Firewall template. Select the Socket resource, replacesfw.your_company.com with the firewall hostname, and
keep only the ecosystems configured in the firewall:
Route Every Supported Ecosystem
Use the Socket Registry Firewall (All) template whensocket.yml configures
every ecosystem listed above. The is_socket_ecosystem input matches any
hostname recognized as a supported Socket registry.
Replace sfw.your_company.com with your firewall hostname:
Without a Connector
Use this mode when each workstation running the Formal Endpoint can reach the Socket Registry Firewall directly:- Install and enable the Formal Endpoint transparent proxy.
- Make the firewall hostname resolvable and reachable from the workstation.
- Select the Socket resource in the network rule.
- Leave Forward To Connector disabled
(
"forward_to_connector": false).
The Formal Endpoint does not apply Native User credentials in this mode. The
firewall must accept the Endpoint’s requests without Native User
authentication.
With a Connector
Use this mode when the firewall is reachable only from the network where a Formal Connector runs, or when the firewall requires authentication from package manager clients.- Create a listener on the Connector.
- Add a listener rule that points to the Socket resource.
- Enable Forward To Connector in the network rule
(
"forward_to_connector": true).
Policy Evaluation
Socket’s response headers are available to response policies throughinput.socket. For example, the following policy blocks a request when the
firewall reports a fail-open decision:
Socket Policy Input
input.socket can contain the following fields:
ecosystem is available when Formal classifies a supported public registry.
Limitations
- Socket resources use the fixed path prefixes listed above. Custom path prefixes, domain-based routing, and Artifactory auto-discovery mode are not supported.
- Socket response bodies stream through Formal to the package manager and are not available to response-body policies. Response header rewrites and blocks remain supported.