This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local TLS usage updates and IMDSv2 (#6)
* Make Vault usable by any local user Previously in order to use `vault status` or `vault operator` commmands as a non-root user, you had to work around two issues. One, the /opt/vault/tls directory is set to mode 0700 by the Vault package postinst script. This made the vault-ca.pem file unreachable by any user other than `vault` or `root`. Two, the /etc/profile.d/vault.sh file sets the VAULT_CLIENT_CERT and VAULT_CLIENT_KEY env vars, and the key file is (correctly) set to allow only the `vault` user to read it. However, since client TLS is not required to run operator commands, these values do not need to be set. This commit fixes these issues by: * Setting /opt/vault/tls mode to 0755 * Removing unused env vars from /etc/profile.d/vault.sh * Fix indentation in vault.hcl * Use IMDSv2 metadata service Since 2019[1], EC2 has provided a more secure protocol for interacting with the local metadata service. This protocol requires fetching a token via a PUT request, and then using that token in an HTTP header for subsequent GET requests to the metadata API. This adds significant protection from a variety of SSRF attacks which could expose instance profile credentials or other internal metadata. This commit enables requiring the HTTP token via the EC2 Launch Template resouce, and updates the install_vault.sh script to fetch and use the IMDSv2 token for its metadata requests. [1] https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/ * Update CHANGELOG and README * edit CHANGELOG Co-authored-by: Omar Khawaja <[email protected]>
- Loading branch information