Which of the following commands can result in a security risk if sensitive data is hardcoded?

Prepare for the WGU ITSW3170 D411 Scripting and Automation Exam. Utilize flashcards and multiple choice questions, each with hints and explanations, to enhance your study. Get exam-ready today!

When considering the potential security risks associated with hardcoding sensitive data, connecting to a database stands out as a significant concern. This is because hardcoding credentials, such as usernames and passwords, directly into the scripts can lead to unauthorized access if the scripts are exposed. If a script with hardcoded credentials is shared, stored in a public repository, or accessed by unintended users, it could allow them to gain access to the database without proper authorization.

In contrast, commands like New-Item, Write-Output, and Set-ExecutionPolicy do not inherently involve the direct management of sensitive information. While these commands serve specific functions within scripting—such as creating new items, outputting data, or establishing execution policies—they do not typically entail the risk of exposing sensitive data unless they are misused in conjunction with insecure coding practices. Therefore, connecting to a database is the command that clearly represents a potential security risk when sensitive information is hardcoded into scripts. This understanding underscores the importance of using secure practices, such as configuration files or environment variables, to manage sensitive credentials and prevent security vulnerabilities.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy