Create a working Vault server configuration Flashcards

1
Q

How do you enable command line auto-completion?

A

vault -autocomplete-install

https://www.vaultproject.io/docs/commands#autocompletion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where should the Vault process be allowed to write?

A

The unprivileged Vault service account should not have access to overwrite its executable binary or any Vault configuration files.

Only directories and files for local Vault storage (eg, for the integrated storage backend) or audit logs should be writable by the Vault user.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Connections to Vault must be encrypted

Where should there be TLS in a Vault infrastructure?

A

Vault should always be used with TLS in production.

If intermediate load balancers or reverse proxies are used to front Vault, TLS should be used for all network connections between every component of the system (including Storage Backends) to ensure all traffic is encrypted in transit to and from Vault.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you force Vault to use HTTP Strict Transport Security (HSTS)?

A

HTTP Strict Transport Security (HSTS) header should be set using Vault’s custom response headers feature in the tcp listener.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you prevent Vault from swapping sensitive memory to disk?

A

Risk of exposure should be minimized by disabling swap to prevent the operating system from paging sensitive data to disk.

This is especially important when using the integrated storage backend.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you prevent a user or administrator that can force a core dump and has access to the resulting file to potentially access Vault encryption keys?

A

Preventing core dumps is a platform-specific process; on Linux setting the resource limit RLIMIT_CORE to 0 disables core dumps. In the systemd service unit file, setting LimitCORE=0 will enforce this setting for the Vault service.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name the various ways to run the Vault process, from most to least secure.

A

Running on bare metal should be preferred to a VM, and running in a VM should be preferred to running in a container.

In any case, single tenancy is prefered.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How should incoming and outgoing TCP/UDP traffic to/from Vault be handled?

A

Use a local firewall or network security features of your cloud provider to restrict incoming and outgoing traffic to Vault and essential system services like NTP. This includes restricting incoming traffic to permitted subnets and outgoing traffic to services Vault needs to connect to, such as databases.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What should you do with the initial root token?

A

The initial root token should be used to setup the system initially, particularly setting up auth methods so that users may authenticate.

Once setup, the root token should be revoked to eliminate the risk of exposure. Root tokens can be generated when needed, and should be revoked as soon as possible.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What can you find in Vault’s audit log?

A

Enabling audit logging provides a history of all operations performed by Vault and a forensics trail in the case of misuse or compromise.

Audit logs securely hash sensitive data, but access should still be restricted to prevent any unintended disclosures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you prevent finding parameters of past vault commands (espescially when using a shared account)?

A

You may want the vault command itself to not appear in history at all with
export HISTIGNORE=”&:vault*”

https://learn.hashicorp.com/tutorials/vault/static-secrets#option-3-disable-all-vault-command-history

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does Vault uses the current time?

A

Vault uses the clock for things like enforcing TTLs and setting dates in PKI certificates, and if the nodes have significant clock skew, a failover may wreak havoc.

Use NTP or whatever mechanism is appropriate for your environment to ensure that all the Vault nodes agree about what time it is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Vault storage is always encrypted, yet it requires special consideration. Which ones and why?

A

An attacker with arbitrary control can cause data corruption or loss by modifying or deleting keys. Access to the storage backend should be restricted to only Vault to avoid unauthorized access or operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What credentials can you find in Vault’s configuration?

A

The seal stanza of the Vault configuration file configures the seal type to use for additional data protection such as using HSM or Cloud KMS solutions to encrypt and decrypt the master key.

Many cloud-based storage engines also require authentication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where should you put Vault’s own credentials, in order from the most secure to the least?

A

Depending on the seal type and storage strategy, you should use the platform’s built-in authentication, environment variables or store them in the configuration file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which protocol should Vault’s listener use, in production?

A

Vault’s TLS listener supports a variety of legacy algorithms for backwards compatibility.

The use of TLS 1.3 ensures that modern encryption algorithms are used to encrypt data in transit and forward secrecy.

https://learn.hashicorp.com/tutorials/vault/production-hardening#baseline-recommendations

17
Q

Vault binary packages are signed. How can an attacker introduce malicious code in a Vault ecosystem?

A

You should be mindful of misconfigured or external malicious Vault plugins.

These may harm the security posture of your Vault deployment.

18
Q

What happens if you specify the –config options multiple times on the command line and how could it introduce a security issue?

A

Configuration files are merged if -config is specified multiple times.

Vault’s configuration file merging is non-deterministic, and inconsistencies in settings between files could lead to inconsistencies in Vault settings.

19
Q

What is the most secure way to control access to Vault, even if you use the root token?

A

Users should never access the machine directly. Instead, they should access Vault through its API over the network.

Use a centralized logging and telemetry solution for debugging. Be sure to restrict access to logs as need to know.

20
Q

What is generally the prefered way to upgrade Vault?

A

When upgrading to new versions, new servers with the upgraded version of Vault are brought online. They are attached to the same shared storage backend and unsealed. Then the old servers are destroyed. This reduces the need for remote access and upgrade orchestration which may introduce security gaps.

21
Q

Name three (3) Linux security features that can be used to secure Vault

A

systemd security features,
ulimits tweaks
SELinux/AppArmor

22
Q

What is required to leverage the memory lock feature inside a Vault container?

A

To leverage the “memory lock” feature inside the Vault container you will likely need to use the overlayfs2 or another supporting driver.

23
Q

What is the command line to start a rekey operation, so that 5 key out of 7 are needed to reach quorum?

A

vault operator rekey -init -key-shares=7 -key-threshold=7

24
Q

How do you provide a Shamir shard/key to progress towards quorum?

A

You type vault operator rekey and wait for the prompt to provide your key/shard.

25
Q

How do you decrypt the new keys/shard after a rekey operation?

A

If you specified public keys, each private key holder will be able to decrypt their key on their own. If public keys were not provided, the new keys/shards are displayed in plain text when the last shard is entered.