312-97 practice question 17 of 35

(Steven Gerrard has been working as a DevSecOps engineer at an IT company that develops software products and applications related to the healthcare…

Full set: 100 questions
(Steven Gerrard has been working as a DevSecOps engineer at an IT company that develops software products and applications related to the healthcare industry. His organization has been using Azure DevOps services to securely and quickly develop software products. To ensure that the deployed infrastructure is in accordance with the architecture and industrial standards and the security policies are appropriately implemented, she would like to integrate InSpec with Azure. Therefore, after installation and configuration of InSpec, she created InSpec profile file and upgraded it with personal metadata and Azure resource pack information; then she wrote the InSpec tests. Which of the following commands should Steven use to run InSpec tests to check the compliance of Azure infrastructure?)
Answer options
A: inspec exe inspec-tests/integration/ -t azure://.
B: inspec exec inspec-tests/integration/ -it azure://.
C: inspec exec inspec-tests/integration/ -t azure://. Correct answer
D: inspec exe inspec-tests/integration/ -it azure://.
Correct Answer:
C. inspec exec inspec-tests/integration/ -t azure://.
Explanation

The InSpec command-line tool uses the exec action to execute a compliance profile against a target. The profile's location is provided as an argument (e.g., inspec-tests/integration/). To specify the target infrastructure, the -t (or --target) flag is used. For scanning Azure resources, InSpec uses the target URI azure://. Therefore, the command inspec exec inspec-tests/integration/ -t azure:// correctly combines the action, profile path, and target flag to initiate a compliance scan against the configured Azure environment.

Why Incorrect

A. The command to execute a profile is exec, not exe. This option uses the incorrect command action.
B. The -it flag is not a valid InSpec option for specifying a target. This syntax is commonly associated with Docker, not InSpec.
D. This option contains two errors: the incorrect command action exe and the invalid flag -it for specifying the target.

References

Chef InSpec Documentation, "inspec exec". The documentation specifies inspec exec as the command for running profiles. It also details the use of the --target (or -t) flag to specify a remote host.

Chef InSpec on Azure Documentation, "Authenticate to Azure". The official documentation provides examples for running InSpec against Azure, consistently using the format inspec exec -t azure://.... (Section: Run InSpec).

Scroll to Top