
Run Pre-Flight Air-Gap Isolation and Integrity Verification
Source:R/container.R
preflight_isolation_check.RdValidates container hardening posture (--network none, --read-only,
--cap-drop ALL, no-new-privileges, pinned image SHA-256 digest, loopback
host binding), confirms that any runtime endpoint is strictly loopback /
local Unix socket / offline mock, optionally verifies local model weight
SHA-256 digests on disk, checks outbound proxy environment variables, and
returns a cryptographically hashed (and optionally HMAC-signed) pre-flight
verification record.
Usage
preflight_isolation_check(
spec = NULL,
endpoint = NULL,
model_path = NULL,
expected_model_digest = NULL,
allow_internal_network = FALSE,
check_proxies = TRUE,
strict_proxy = TRUE,
allow_symlinks = FALSE,
signing_key = NULL,
error_on_fail = FALSE
)Arguments
- spec
Optional
airgap_container_spec()object.- endpoint
Optional character URL or
airgap_runtimeobject.- model_path
Optional local path to model weights to verify on disk.
- expected_model_digest
Optional expected SHA-256 digest for
model_path. Defaults tospec$model_digestwhen available.- allow_internal_network
Logical scalar; if
FALSE(default), requiresspec$network_mode == "none". IfTRUE, also permitsnetwork_mode == "internal"whenhost_bindis strictly loopback.- check_proxies
Logical scalar; inspect outbound proxy environment variables (
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,FTP_PROXY,SOCKS_PROXY, case-insensitive). Defaults toTRUE.- strict_proxy
Logical scalar; if
TRUE(default), active outbound proxy variables without explicit127.0.0.1andlocalhostentries inNO_PROXYcause pre-flight verification to fail closed. Set toFALSEto downgrade proxy exposure to an advisory warning.- allow_symlinks
Logical scalar passed to
verify_model_digest()when verifyingmodel_path. Defaults toFALSE.- signing_key
Optional secret key (character or raw) to attach an HMAC-SHA256 attestation signature to the verification record.
- error_on_fail
Logical scalar; if
TRUE, aborts with anairgap_isolation_errorwhen any required check fails. Defaults toFALSE.
Value
An S3 object of class "airgap_preflight" with passed, status,
checks (tibble), spec_digest, model_digest, endpoint_class,
checked_at, record_hash, and signature.
Examples
spec <- airgap_container_spec(
backend = "ollama",
image_digest = paste0("sha256:", strrep("a", 64)),
model_dir = "/srv/models"
)
pf <- preflight_isolation_check(spec = spec, endpoint = "http://127.0.0.1:11434")
pf$passed
#> [1] TRUE