Security and Trust Model
This page explains the security boundaries, supply-chain checks, and fail-closed defaults built into Netherframe so security engineers and platform teams can evaluate how it handles code, provider binaries, plans, credentials, and state.
1. Execution boundary: Trusted Python
A Netherframe app is standard Python code imported and executed by nf (or nf.sdk)
during plan, apply, destroy, lint, and synth.
- Only run trusted app repositories and lint packs. Importing a module or calling an
app factory executes Python in your environment;
nf lintandnf planare not sandboxes for untrusted third-party code. - Providers run as isolated child processes. Each Terraform provider executes in its
own subprocess communicating over local gRPC (
unixsocket or loopbacktcp), never exposing a network listener.
2. Provider binary supply-chain verification
When Netherframe downloads a provider binary (during nf generate providers, nf plan, or
nf apply), it implements Terraform's provider installation authentication protocol
natively in nf.core.providers.installation:
- Registry downloads verify three independent checks before extracting or executing a binary:
- The downloaded archive's SHA-256 matches the registry's
SHA256SUMSmanifest (ArchiveChecksum+ChecksumListed). - The
SHA256SUMSdocument's OpenPGP signature verifies against HashiCorp's bundled public keys or the partner/self-signed GPG key advertised by the registry (ChecksumsSigned), reporting the exact trust level. - Network and filesystem mirrors (Artifactory, Nexus, or air-gapped local directories
configured via
--provider-mirror/provider_mirrors) verify package digests againsth1:andzh:hashes. - Enterprise TLS & credentials: Extra root CAs are configured explicitly via
--provider-ca-bundleand registry/mirror tokens via--provider-credentials-file(credentials.tfrc.jsonformat), never via ad-hocNF_*env vars.
See Install Providers from Registries and Mirrors.
3. Tamper-evident saved plans
A plan saved with nf plan --out FILE is a bound execution contract:
| Protection | What it prevents |
|---|---|
SHA-256 content_digest |
Detects accidental corruption or manual edits to the plan JSON body. |
Optional HMAC-SHA256 signature (nf-plan-sig-v1) |
Authenticates plan artifacts crossing untrusted CI artifact storage (sign_plan / verify_plan_signature). |
State serial, lineage, and state_fingerprint |
Refuses applying a stale plan after another run modified state. |
| Provider version & config fingerprints | Refuses applying a plan under a different provider release or configuration. |
| Recorded inputs & salted secret digests | Refuses applying a plan with mismatched inputs; verifies Secret[T] inputs without storing plaintext. |
| Declared app-check names | Refuses applying a plan if the app removed an app.check that was present when the plan was made. |
4. Configuration integrity: Why NF_* env vars do not exist
Environment variables exported earlier in a shell or inherited from a shared CI runner are
a frequent source of silent misconfiguration (retargeting prod, disabling checks, or
pointing at the wrong state).
Netherframe enforces three strict configuration rules:
- Zero
NF_*environment variables are read for settings or app inputs. - Scoped user config (
~/.config/nf/config.toml): May only contain machine-local preferences (TUI theme/keymap, logging,non-interactive, provider mirrors/caches). Any engine or backend setting (recovery-strategy,backend-type,max-concurrent-resources) is rejected so runs never depend on who executes them. CI jobs should pass--no-user-config. - Fail-fast conflicts: Conflicting values between
[tool.nf.config]and Python code raiseConfigurationErrorimmediately instead of silently picking a winner.
5. Fail-closed runtime defaults
Netherframe defaults to stopping and asking rather than guessing whenever an assumption breaks:
- Unattended
--auto-approveblocks high-risk surprises: Plans containingimportactions (without--approve-imports), externally deleted objects (defaultdeleted_objects="review"), undeclared stack deletions (unless applying a reviewed--plan-file), or refresh unknowns are refused automatically. - Deferred rounds default to
each_roundapproval and stop incomplete (exit4) under unattended runs unless--apply-deferredis explicitly opted in. - Final-plan consistency fails closed: If re-planning unknown values at apply time
alters a previously known value or escalates an update to a replacement, apply fails
even on legacy Plugin SDK providers (unless
allow_legacy_plan_drift=Trueis set). - Verified teardown switches (
Teardown[T]): Netherframe rebuilds the app withTeardownparameters at their defaults and compares deployment shapes, rejecting any attempt to smuggle resource changes through a teardown flag. - Safe serialization:
nf tui --recorduses an allowlisted JSONL format (nf-tui-recording/2) with state values masked—never Pythonpickle.
6. Crash-resilient auditability and state fencing
- Document state: Conditional writes (ETag / generation / serial CAS) prevent a run whose lock lapsed from overwriting a newer run's state.
- PostgreSQL graph state: Every mutating provider RPC is a fenced operation tied to a
renewable lease (
kill_providers_on_lease_loss=Trueterminates provider subprocesses on lease loss, and uncertain operations quarantine their address untilnf state recover). - Finalizers (
phase="finalize"): Run records written beside state before the first change ensure akill -9or dead CI runner leaves an explicitrunningrecord untilnf state verifyre-runs verification under the lock.
Vulnerability reporting
To report a security issue privately, follow Support and Security Reporting.