exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 76 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 76
Topic #: 1
[All Terraform Associate Questions]

Which of these options is the most secure place to store secrets foe connecting to a Terraform remote backend?

  • A. Defined in Environment variables
  • B. Inside the backend block within the Terraform configuration
  • C. Defined in a connection configuration outside of Terraform
  • D. None of above
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
zyxphreez
Highly Voted 2 years, 6 months ago
Selected Answer: A
Definitely is: A https://www.terraform.io/language/settings/backends/configuration#credentials-and-sensitive-data Warning: We recommend using environment variables to supply credentials and other sensitive data. If you use -backend-config or hardcode these values directly in your configuration, Terraform will include these values in both the .terraform subdirectory and in plan files. This can leak sensitive credentials.
upvoted 32 times
Alandt
1 year, 1 month ago
Authentication outside of Terraform is more secure than environment variables. Your environment variables can still refer to a file or the definition of your variables inside terraform. So I would go for C.
upvoted 3 times
...
deepeshukla
1 year, 8 months ago
I will select C. In option A, any debugging will still disclose data.
upvoted 1 times
Gomjaba
1 year, 6 months ago
I presume they are hinting at vault here.
upvoted 1 times
...
...
...
CHRIS12722222
Highly Voted 2 years, 7 months ago
Selected Answer: C
I will go for option C. Whenever possible, it is best to authenticate outside of terraform to keep secrets out of state file
upvoted 18 times
Alandt
1 year, 1 month ago
I agree with this.
upvoted 1 times
...
...
KG8
Most Recent 4 days, 6 hours ago
Selected Answer: A
https://developer.hashicorp.com/terraform/language/backend Warning: We recommend using environment variables to supply credentials and other sensitive data. If you use -backend-config or hardcode these values directly in your configuration, Terraform will include these values in both the .terraform subdirectory and in plan files. This can leak sensitive credentials.
upvoted 1 times
...
Asif_draxi
1 month, 3 weeks ago
Selected Answer: A
The correct answer is **A. Defined in Environment variables**. Environment variables are considered the most secure place to store secrets for connecting to a Terraform remote backend because: - They keep sensitive information out of source control (such as in `.tf` files or other configuration files). - Secrets stored in environment variables can be managed securely by the operating system or deployment environment and can be encrypted or otherwise protected. Storing secrets inside the backend block (option B) or in a connection configuration outside Terraform (option C) can expose them to version control or make them less secure. Therefore, it's best practice to use environment variables for storing sensitive credentials securely.
upvoted 1 times
...
suri_surendra
2 months, 1 week ago
Selected Answer: A
The correct answer is: A. Defined in Environment variables Explanation: When storing secrets for connecting to a Terraform remote backend, environment variables are the most secure option. Here's why: Environment Variables: Secure: Environment variables can be securely managed outside of Terraform configuration files and are not checked into version control. Flexibility: You can use tools like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault to inject secrets as environment variables dynamically. Common Practice: Many services (e.g., AWS, Azure, Google Cloud) support using environment variables for storing sensitive credentials like access keys, secret keys, and tokens.
upvoted 1 times
...
Dimedrol1
4 months, 1 week ago
I've answered D - "None of the above", because the most secure way is e.g. Azure Key Vault, when working with Azure, of course. In this case - we're not revealing any of the secrets values. Terraform can refer them via "data" operators. (and, yes, this approach is not a "connection configuration")
upvoted 1 times
...
Algol
6 months ago
Selected Answer: A
The most secure option for storing secrets when connecting to a Terraform remote backend is A. Defined in environment variables. This approach keeps sensitive information, such as API keys or access tokens, out of your version-controlled configuration files. Defining secrets in environment variables reduces the risk of accidental exposure or leakage through your Terraform configuration. Using external secret management tools (like HashiCorp Vault) to manage environment variables can further enhance security.
upvoted 1 times
...
premnick
7 months, 2 weeks ago
Question is which one is MOST secure. Environment variable is not secure. You type env command from the host and easily view the secret value.
upvoted 2 times
...
SureNot
9 months ago
Selected Answer: C
Let's imagine use AWS S3 bas a backend. Credentials to S3 Bucket are stored in ~/.aws/credentials file - Outside of terraform, most secure way.
upvoted 2 times
...
Molly1994
9 months, 1 week ago
C vault as example
upvoted 1 times
...
deepakpamban
10 months, 1 week ago
Option C
upvoted 2 times
...
Venki_dev
10 months, 3 weeks ago
Selected Answer: C
C. Defined in a connection configuration outside of Terraform (Most Secure) This is the most secure option. Here, you store your secrets in a separate dedicated location outside of your Terraform configuration. There are several ways to achieve this: Secret Management Tools: Utilize tools like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault to store and manage your secrets securely. These tools offer access control and encryption mechanisms. Encrypted Files: Store secrets in an encrypted file outside your Terraform configuration directory. Terraform can access these secrets during execution by referencing the decrypted content of the file.
upvoted 4 times
...
kingfighers
11 months, 1 week ago
choose A: when we use vault, we still need to download it into a file,here is official doc: - **File**: A configuration file may be specified via the `init` command line. To specify a file, use the `-backend-config=PATH` option when running `terraform init`. If the file contains secrets it may be kept in a secure data store, such as [Vault](https://www.vaultproject.io/), in which case it must be downloaded to the local disk before running Terraform. https://developer.hashicorp.com/terraform/language/settings/backends/configuration#credentials-and-sensitive-data
upvoted 2 times
...
aksliveswithaws
11 months, 2 weeks ago
Selected Answer: A
https://developer.hashicorp.com/terraform/language/settings/backends/configuration#credentials-and-sensitive-data:~:text=and%20apply%20steps.-,backend%20types,-The%20block%20label
upvoted 1 times
...
AntonyPeter7
1 year ago
Selected Answer: C
Authentication outside of Terraform is more secure than environment variables. Like using terraform vault or cloud
upvoted 1 times
...
Kaname93
1 year ago
Selected Answer: A
From the documentation : Warning: We recommend using environment variables to supply credentials and other sensitive data. If you use -backend-config or hardcode these values directly in your configuration, Terraform will include these values in both the .terraform subdirectory and in plan files. This can leak sensitive credentials. So it's A
upvoted 1 times
...
Alandt
1 year, 1 month ago
Selected Answer: C
Definitely C. Authentication outside of Terraform is the most secure way.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago