U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp HCVA0-003 Exam - Topic 2 Question 22 Discussion

Using the Vault CLI, there are several ways to create a new policy. Select the valid commands (Select three)
A) vault policy write my-policy - << EOF path 'secret/data/*' { capabilities = ['create', 'update'] } EOF and C) vault policy write my-policy /tmp/policy.hcl and D) $ cat user.hcl | vault policy write my-policy -
B) vault policy create my-policy /tmp/policy.hcl

HashiCorp HCVA0-003 Exam - Topic 2 Question 22 Discussion

Actual exam question for HashiCorp's HCVA0-003 exam
Question #: 22
Topic #: 2
[All HCVA0-003 Questions]

Using the Vault CLI, there are several ways to create a new policy. Select the valid commands (Select three)

Show Suggested Answer Hide Answer
Suggested Answer: A, C, D

Comprehensive and Detailed in Depth

Vault provides multiple valid ways to create a policy via the CLI using the vault policy write command. The HashiCorp Vault documentation states: 'To write a policy, use the vault policy write command.' The valid methods are:

A: 'vault policy write my-policy - << EOF ... EOF uses heredoc syntax to inline policy content, which Vault accepts directly.'

C: 'vault policy write my-policy /tmp/policy.hcl writes a policy from a file, a standard method per the docs: 'The policy can be read from a file or piped from stdin.''

D: 'cat user.hcl | vault policy write my-policy - pipes policy content from a file via stdin, another documented approach: 'You can pipe the policy content to the command using -.''

Option B, vault policy create, is invalid as no such command exists---only vault policy write is used. Thus, A, C, and D are correct.


HashiCorp Vault Documentation - Policies: Write a Policy

Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel