liveBook · Manning

Sensitive information

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A sensitive value is configuration or state data whose disclosure could compromise security and is therefore specially protected in displayed or stored form.

Sensitive information includes passwords, tokens, API keys, and other configuration or state whose disclosure could compromise an application or deployment. Keep it out of source code and treat displayed output as a security boundary. section 12.5.2 section 2.6.6

Terraform marks sensitive outputs explicitly and replaces them with <sensitive> in normal terminal output. This protects deployment logs, but the value can still exist in plain text in terraform.tfstate. section 7.9.4

Use a deliberate storage and delivery path:

  • Pass runtime secrets through environment variables rather than embedding them in application code. section 2.6.6
  • Store deployment credentials in GitHub Secrets or an equivalent continuous-deployment provider. section 12.5.2
  • Use Kubernetes Secrets or an independent secrets product such as Vault when provider-managed storage is unsuitable. section 12.5.2
  • Avoid production outputs for sensitive values; outputs may help debugging but are unnecessary for ordinary resource creation. section 7.9.5

Retrieving a Terraform registry password

A declared sensitive Terraform output appears as <sensitive> in routine output. Running terraform output -raw registry_pw reveals the actual password, which can then be used to authenticate Docker to the container registry. This deliberate retrieval also exposes the credential in the terminal, so it should be reserved for controlled learning or operational need. section 7.9.4 section 7.9.5

terraform output -raw registry_pw

Run the supplied Terraform command to retrieve a named sensitive output; handle the resulting terminal value as exposed secret material. section 7.9.4

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains redaction, explicit Terraform acknowledgement, alternative storage, and the limitation that state files may remain plaintext.
Examples
Uses a container-registry password, database password, Kubernetes authentication, tokens, API keys, and the terraform output command.
What you can do after
Operate Terraform outputs and application configuration while choosing safer secret storage and avoiding unnecessary production disclosure.
How it connects
Connects environment variables, Terraform, GitHub Secrets, Kubernetes Secrets, Vault, Docker authentication, and continuous deployment.

Also explained in

Compare how 8 books explain sensitive information →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.