CompTIA Cloud+ (CV0-003) — Question 64
A systems administrator is writing a script for provisioning nodes in the environment. Which of the following would be BEST for the administrator to use to provision the authentication credentials to the script?
Answer options
- A. password='curl https://10.2.3.4/api/sytemops?op=provision'
- B. password=$env_password
- C. password=$(cat /opt/app/credentials)
- D. password="MyS3cretP4sswordIsVeryL0ng"
Correct answer: B
Explanation
Using 'password=$env_password' is the best option because it retrieves the password from an environment variable, which enhances security by not hardcoding sensitive information. The other options either hardcode credentials, which poses a security risk, or improperly attempt to call an API instead of directly accessing credentials.