Skip to content

Guardrails

terraform ​

6 guardrails, all at version v1.

GuardrailDefault severityWhat it checks
terraform/modules-pinnederrorEvery module a Terraform root pulls from a registry or a git URL names a version, so the same commit always resolves to the same module code.
terraform/no-plaintext-secretserrorEvery Terraform variable named like a credential declares sensitive = true.
terraform/providers-pinnederrorEvery provider a live Terraform root requires is pinned to one exact version, and the lock file that resolves them is committed.
terraform/remote-stateerrorEvery live Terraform root stores its state in a remote backend, and no state file is left in the checkout.
terraform/state-encryptederrorEvery live Terraform root declares an encrypted backend, so its state isn't stored in the clear in its bucket.
terraform/state-lockingerrorEvery live Terraform root declares state locking, so two applies cannot write the same state at once.

Shared collectors ​

Every terraform guardrail receives the facts these collectors gather. Individual guardrails can ask for more collectors of their own.

CollectorGathers
terraformThe Terraform configuration in the checkout: every root directory holding .tf files, the backend it stores state in, the providers and modules it takes on and how tightly they are pinned, the resources it declares, the variables it takes, the lock file that resolves it, and any state file left in the tree. Everything is read from the files themselves, so it works on a runner with no Terraform installed. When the terraform CLI is there, the versions an initialised root has already resolved are added.

You configure every guardrail in this category the same way, in the guardrails.checks array of buildnote.json. Configuring guardrails lists every option, and Guardrails lets you search the whole library.

Buildnote Limited
Registered in England and Wales, Reg: 16140412