Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - 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
Galen
2 days ago
Wait, can you really use cat like that? Sounds odd.
upvoted 0 times
...
Idella
7 days ago
No way, B is not a valid command!
upvoted 0 times
...
Desmond
12 days ago
I think B is also valid, right?
upvoted 0 times
...
Meaghan
17 days ago
A, C, and D are valid commands.
upvoted 0 times
...
Lashunda
23 days ago
Option D sounds familiar too, but I can't recall if using "cat" like that is standard for Vault CLI commands.
upvoted 0 times
...
Hildegarde
28 days ago
I remember practicing with option C, and it seems correct because it specifies the policy file directly.
upvoted 0 times
...
Ronald
1 month ago
I'm not too sure about option B; I feel like "create" isn't the right command for writing a policy.
upvoted 0 times
...
Latricia
1 month ago
I think option A is definitely valid since it uses the correct syntax for writing a policy directly in the CLI.
upvoted 0 times
...

Save Cancel