Skip to content
Go to platform

Network policy reference

Configure these fields in the network input of cracicorp/setup@v1. For examples and available presets, see Control network access from jobs.

Validation errors identify unknown fields, missing required fields, and entries that contain more than one software source or connection type.

SettingRequiredDefaultDescription
defaultNodenyControls unmatched traffic when network is configured. allow permits unmatched outbound connections.
presetsNoAll presetsSelects built-in software sources. An empty list disables all presets.
sourcesNoNoneAdds private or custom software sources. Each item contains exactly one source type.
connectionsNoNoneAdds TLS, TCP, UDP, or ICMP destinations. Each item contains one connection type.

All source URLs must use HTTP or HTTPS, without embedded credentials, query strings, or fragments.

SourceSettingRequiredDefaultDescription
npmurlsYesNo defaultOne or more npm registry URLs.
rubygemsurlsYesNo defaultOne or more RubyGems registry URLs.
rustupurlsYesNo defaultRust toolchain download endpoints.
apturlsYesNo defaultOne or more Debian-style repository URLs.
aptpurlNamespaceNoNonePackage URL namespace recorded for packages from this source.
apkurlsYesNo defaultOne or more Alpine repository URLs.
golangurlsYesNo defaultOne or more Go module proxy URLs.
cargoindexUrlYesNo defaultCargo index URL.
cargodownloadUrlYesNo defaultCrate download URL.
sources:
- oci:
urls: [https://registry.example.com]
# default: ["**"] - Allows all repositories
repositoryPatterns: ["platform/**", "third-party/*"]
operations: [pull]
SettingRequiredDefaultDescription
urlsYesNo defaultRegistry endpoints. Provide at least one URL.
repositoryPatternsNo["**"]Limits access to matching repositories.
operationsYesNo defaultAllowed operations: pull, push, or delete. Provide at least one.
sources:
- git:
# default: ["**"] - Allows all repositories
repositoryPatterns: ["https://git.example.com/platform/**"]
https:
- baseUrl: https://git.example.com
ssh:
- host: git.example.com
port: 22
user: git
upstreamKnownHosts:
- "git.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA..."

At least one HTTPS or SSH transport is required.

SettingRequiredDefaultDescription
repositoryPatternsNo["**"]Limits access to matching repositories.
https[].baseUrlFor HTTPSNo defaultHTTP(S) base URL of a configured Git server.
ssh[].hostFor SSHNo defaultHostname of an allowed SSH server.
ssh[].portFor SSHNo defaultSSH server port.
ssh[].userNoAny userAccepted but not enforced; do not rely on this field to restrict usernames.
ssh[].upstreamKnownHostsFor SSH connectivityNo trusted host keysTrusted SSH host keys. The configuration is valid without this field, but the connection fails unless a host key matches.
connections:
- tls:
# Either cidrs or serverNamePatterns needs to be set.
serverNamePatterns: [api.example.com]
cidrs: [10.50.0.0/16]
ports: [443]
# default: no ALPN filtering
alpn: [h2]
SettingRequiredDefaultDescription
serverNamePatternsOne selector requiredNoneMatches the TLS server name.
cidrsOne selector requiredNoneMatches the destination IP address.
portsYesNo defaultAllowed destination ports. Provide at least one.
alpnNoNo ALPN filteringWhen set, at least one protocol offered by the client must match.

Set serverNamePatterns, cidrs, or both. When both are set, both selectors and the destination port must match, along with any ALPN filter. Without CIDRs, the TLS server name must also have a CRACI-observed DNS binding to the destination IP.

SettingRequiredDefaultDescription
hostPatternsOne selector requiredNoneMatches recorded DNS names for the destination IP.
cidrsOne selector requiredNoneMatches the destination IP address.
portsNoAll portsLimits the allowed destination ports.

Set hostPatterns, cidrs, or both. When both are set, either selector may match. When ports is set, the destination port must also match. For hostname-only TCP rules, explicitly list ports: omitted ports currently do not enable hostname matching on non-443 connections. Use explicit IPv4 prefixes such as 192.0.2.1/32 for TCP, UDP, and ICMP CIDRs.

On port 443, TLS rules are matched before TCP fallback. On other intercepted TCP ports, TCP classification precedes TLS inspection. Required platform sources can take precedence over passthrough rules. Overlapping passthrough rules can bypass package detection and source-level repository or operation restrictions.

SettingRequiredDefaultDescription
cidrsYesNo defaultMatches IPv4 destination addresses.
portsNoAll portsLimits the allowed destination ports.
SettingRequiredDefaultDescription
cidrsYesNo defaultMatches IPv4 destination addresses.

Host patterns may be exact hostnames or begin with one *. wildcard. For example, *.example.com matches one or more subdomain levels, but not example.com itself. Hostname matching is case-insensitive; repository matching is case-sensitive.

OCI repository patterns match the repository name without the registry hostname. They use * within one path segment and ** across path segments. For example, platform/* matches one segment below platform, while platform/** matches repositories at any depth below it.

Git repository patterns match the full repository identity. Include the server in the pattern, such as https://git.example.com/platform/**. SSH requests are also checked against repositoryPatterns, using HTTPS-form and SSH-origin identities. SSH transport restrictions include host and port; the optional user field is not enforced. Restrict users through the upstream server’s authentication and permissions instead.