NS0-402 practice question 1 of 15

You are writing an Ansible playbook and using the official NetApp modules. You must provide credentials for a NetApp ONTAP cluster in a secure manner. Which two actions should be used to accomplish this task? (Choose two.)

Full set: 58 questions
Answer options
A: Pass the value as an argument on the command line.
B: Pass the value using Ansible vault. Correct answer
C: Pass the value within the playbook itself.
D: Pass the value as an interactive input from the command line. Correct answer
Correct Answer:
B. Pass the value using Ansible vault.; D. Pass the value as an interactive input from the command line.
Explanation

To securely manage credentials for a NetApp ONTAP cluster in an Ansible playbook, the recommended methods are using Ansible Vault or interactive prompts. Ansible Vault allows for the encryption of sensitive data, such as passwords, within variable files. These credentials are encrypted at rest and are only decrypted in memory during playbook execution. Alternatively, using an interactive prompt (varsprompt) allows the user to enter the password at runtime. This method is also secure because the password is not stored on disk in any form (e.g., in the playbook, variable files, or shell history). Both methods prevent the exposure of credentials in plain text.

Why Incorrect

A. Pass the value as an argument on the command line. This is insecure because command-line arguments can be exposed in the process list and are often saved in the shell's history file.
C. Pass the value within the playbook itself. This is highly insecure as it involves storing credentials in plain text, making them visible to anyone with access to the playbook file or its version control history.

References

1. NetApp, "TR-4733: Ansible and ONTAP Best Practices," December 2021.

Section 3.2, "Managing credentials," Page 10: "Do not store credentials in plain text in your playbooks or roles. Instead, use Ansible Vault to encrypt sensitive data. You can also use environment variables or interactive prompts to provide credentials at runtime." This directly supports using Ansible Vault (B) and interactive prompts (D) while advising against storing credentials in plain text (C).

2. Ansible Documentation, "Keeping secrets safe in Ansible."

Section: "Encrypting content with Ansible Vault": "To protect sensitive data, you should use Ansible Vault. Ansible Vault can encrypt any structured data file used by Ansible." This validates Ansible Vault (B) as the primary secure method.

Section: "Prompting for passwords": "If you need to ask for a password, you can do it interactively with varsprompt." This validates interactive input (D) as a secure alternative.

Section: "Avoiding secret exposure": The documentation warns that passing secrets via --extra-vars (A) can be logged and is therefore insecure.

Scroll to Top