0
0
Terraformcloud~5 mins

State file sensitivity and security in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Terraform state file?
A Terraform state file is a file that keeps track of the resources Terraform manages. It stores information about the infrastructure's current state so Terraform knows what to create, update, or delete.
Click to reveal answer
beginner
Why is the Terraform state file sensitive?
The state file contains detailed information about your infrastructure, including resource IDs, IP addresses, and sometimes secrets or passwords. If exposed, it can lead to security risks.
Click to reveal answer
intermediate
Name one best practice to secure Terraform state files.
Store the state file remotely in a secure backend like AWS S3 with encryption and access controls, instead of keeping it locally on your computer.
Click to reveal answer
intermediate
What is Terraform remote state locking and why is it important?
Remote state locking prevents multiple people from changing the state file at the same time. This avoids conflicts and corruption of the state file.
Click to reveal answer
advanced
How can you avoid storing sensitive data in the Terraform state file?
Use Terraform's sensitive variables feature and avoid outputting secrets. Also, use external secret managers to keep secrets outside the state file.
Click to reveal answer
What does the Terraform state file primarily store?
ACurrent infrastructure resource information
BTerraform source code
CUser login credentials
DCloud provider billing details
Why should Terraform state files be stored securely?
AThey are very large files
BThey contain Terraform version info
CThey contain sensitive infrastructure details
DThey are only used for logging
Which backend is recommended for storing Terraform state securely?
ALocal disk without encryption
BRemote backend with encryption and access control
CPublic GitHub repository
DTemporary cloud storage without access control
What problem does remote state locking solve?
APrevents multiple users from editing state simultaneously
BEncrypts the state file
CBacks up the state file automatically
DImproves Terraform execution speed
How can you keep secrets out of the Terraform state file?
AIgnore the state file in version control
BStore secrets in plain text variables
COutput secrets in Terraform outputs
DUse sensitive variables and external secret managers
Explain why Terraform state files are sensitive and how you can protect them.
Think about what info the state file holds and how to keep it safe.
You got /5 concepts.
    Describe best practices to avoid exposing sensitive data in Terraform state files.
    Focus on how to handle secrets and state storage.
    You got /5 concepts.