| SR-F-01 (Two Users) |
The container has two users. vscode runs the editor, the assistant and every extension, with no administrator rights. deployer runs the engine with the secret values and has no interactive login. The build fails if vscode still has sudo after hardening. |
harden-user.sh |
BR-1.2, BR-1.5 |
| SR-F-02 (Private Engine Data) |
deployer keeps its engine data, plugin cache, working copy and saved plans under its own home folder, readable by no other user. vscode cannot read deployer processes or files. |
harden-user.sh, tofu-guard.sh |
BR-1.5 |
| SR-F-03 (Release on the Mac) |
Values are released on the Mac with op run and Touch ID, then the engine is started in the container as deployer through docker exec -u deployer. Each variable is passed by name only. |
tofu-in-container.sh |
BR-1.4 (BRD-INFRA-002) |
| SR-F-04 (Allowed Commands) |
Only init, plan, validate, import and apply run. apply is refused unless the person passes --allow-local-apply, because pipelines apply workload layers. |
tofu-in-container.sh, tofu-guard.sh |
BR-1.3 |
| SR-F-05 (Root-Owned Policy) |
The guard, the provider allowlist, the engine configuration, the assistant’s managed settings and the env-guard hook are installed at root-owned paths. A change in the repository reaches them only after review, merge to main and a container rebuild. |
install-tofu-guard.sh, install-claude-policy.sh |
BR-1.2, BR-1.5 |
| SR-F-06 (Check a Private Copy) |
Before every run the guard copies the project into a folder only deployer can write, checks that copy, and runs the engine from it. An edit made in the workspace after the check never reaches that run. |
tofu-guard.sh |
BR-1.5 |
| SR-F-07 (Code Refused) |
The run is refused when the copy contains a provisioner, terraform_remote_state, a cloud block, a backend other than s3 or local, a key provider other than pbkdf2, an encryption method other than aes_gcm, base_url, a backend setting or source that is not a plain literal, JSON configuration, a .tfvars file in the module, or a symbolic link. The refusal prints the reason, the file and the line. |
tofu-guard.sh |
BR-1.5 |
| SR-F-08 (Environment Refused) |
The run is refused when TF_LOG*, TF_CLI_ARGS*, TF_CLI_CONFIG_FILE, TF_ENCRYPTION or CLOUDFLARE_BASE_URL is set, when -plugin-dir is passed, or when the data folder is outside deployer’s home. |
tofu-guard.sh |
BR-1.5 |
| SR-F-09 (Provider Allowlist) |
A provider in the module’s lock file that is not in the allowlist refuses the run. init always runs with -lockfile=readonly, and the engine may install only the allowlisted providers, never from a local folder. Providers are upgraded as vscode with init -backend=false -upgrade, which needs no secret, and the lock file is committed. |
tofu-guard.sh, install-tofu-guard.sh, tofu-allowed-providers |
BR-1.5 |
| SR-F-10 (Assistant Policy Locked) |
The assistant’s deny rules (environment files, key material, keychain and op retrieval commands, docker exec, docker inspect, /proc) and the env-guard hook are installed as managed settings, which outrank every other settings source. |
install-claude-policy.sh, .claude/settings.json |
BR-1.2 |
| SR-F-11 (No Container Applies Production) |
There is no production dev container. Every container is built the same way and runs the assistant under the managed policy. No container can apply production: tofu-guard refuses INFRA_ENVIRONMENT=prod, and any module folder ending in /prod. tofu-in-container.sh refuses a /prod folder before any value is released. Production is changed only by GitHub Actions (SR-INFRA-004 SR-F-06). |
tofu-guard.sh, tofu-in-container.sh |
BR-1.2 |
| SR-F-12 (Only Its Own Code) |
Each container clones only the repositories named in its start command, so a container never holds another environment’s code. A repository with uncommitted changes is not pulled. |
sync-projects.sh |
BR-1.1 |
| SR-F-13 (State History) |
After each apply a person makes, the host script makes the history copy described in SR-INFRA-008 SR-F-13. |
state-history-copy.sh |
BR-1.3 |