API keys are sensitive information and should be stored securely to prevent unauthorized access. The best practice is to store them in a secure environment variable, separate from the application code.
A. Store API keys in environment variables (Best Practice)
• Environment variables are not stored in the codebase, reducing the risk of accidental exposure in version control (e.g., Git).
• They are specific to the system/user session, making them more secure.
• Can be accessed in code using:
• Python:
import os
api_key = os.getenv("API_KEY")
• Node.js:
const apiKey = process.env.API_KEY;
Concerning B: The problem here is that you need a key to decrypt the file and unless you enter that interactively you have to store it somewhere so that its accessible at run time and at that point, if someone has access to the script they likely have access to the key so you are not much better off. So only remains A.
A
Storing the Meraki API Key as an environment variable
Once the API key is obtained, you'll need to store the Meraki dashboard API key as an environment variable:
export MERAKI_KEY = <YOUR MERAKI API KEY>
key words: "safely store".
As an environment variable, it's neither safe or stored: not safe because it's not encrypted in any way nor stored as it is in volatile memory.
Answer is B.
You can do A and B but the questions what method is a "safe" way to do so. Storing it in an environment variable is NOT secure but putting it in an ENCRYPTED config file separated from code is much safer.
I am convinced with B as per the below statement.
"You use this API key. And you'll notice here that, first of all, the API key is this big, long string of confusing data. You would never remember that API key and use it to type it in as a user. You would store it inside of your program, or inside of a configuration file somewhere so your program could reference it and use it."
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
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.
Leonhrz
Highly Voted 4 years, 5 months ago[Removed]
Highly Voted 3 years, 10 months agodaniii89
Most Recent 4 months, 3 weeks agokymoni
8 months, 2 weeks agomacxsz
2 years, 6 months agomrimmune
2 years, 8 months agoanagy11
2 years, 9 months ago[Removed]
2 years, 9 months agosds85
2 years, 9 months agoFmagnago
2 years, 11 months agoIamrandom
3 years agolupindepin
3 years, 1 month agounderstandingson
3 years, 4 months agokoptos
3 years, 7 months agoaprettyparrot
3 years, 7 months agonebtashi
3 years, 8 months agoexamtaker_2021
3 years, 10 months agoexamtaker_2021
3 years, 10 months agoSAGA
3 years, 10 months agoJohnconnor2021
3 years, 10 months ago