0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

はじめに

HashiCorp Vaultは、機密情報の安全な保存、アクセス制御、秘密管理を行うためのツールです。今回は、Vaultをローカル環境で立ち上げる方法について説明します。

インストール

まず、Vaultをインストールします。以下のコマンドをターミナルに入力します。

brew tap hashicorp/tap
brew install hashicorp/tap/vault

このコマンドにより、HashiCorpのリポジトリがHomebrewに追加され、Vaultがインストールされます。

起動

インストールが完了したら、Vaultを開発モードで起動します。以下のコマンドを実行します。

vault server -dev

開発モードでの起動に成功すると、以下のようなメッセージが表示されます。

You may need to set the following environment variables:

    $ export VAULT_ADDR='http://127.0.0.1:8200'

The unseal key and root token are displayed below in case you want to
seal/unseal the Vault or re-authenticate.

Unseal Key: AjmBF604U9UH/6fFXVvNLQTCDev7ck6CSdfDZxcTT8I=
Root Token: hvs.cUc2WCAxO9JrYScSzJc2wbwo

Development mode should NOT be used in production installations!

このメッセージに記載されている通り、以下の環境変数を設定する必要があります。

export VAULT_ADDR='http://127.0.0.1:8200'

この設定により、Vault CLIがローカルで起動しているVaultサーバーと通信できるようになります。

Vault UIへのアクセス

Vaultの開発モードを使用すると、ウェブUIを使ってVaultにアクセスすることもできます。ブラウザでhttp://127.0.0.1:8200にアクセスすると、以下のようなログイン画面が表示されます。

スクリーンショット 2024-07-09 16.52.08.png

Root Tokenを入力してログインします。Root Tokenは起動時のメッセージに表示されています。

ログインに成功すると、以下のようなVaultのダッシュボードが表示されます。

スクリーンショット 2024-07-09 16.53.09.png

まとめ

今回は、HashiCorp Vaultをローカル環境で立ち上げる方法について説明しました。
開発モードは本番環境には適していませんが、Vaultの基本的な操作を学ぶ環境として有益と考えています。

詳細な手順については、HashiCorp Vaultの公式ドキュメントも参照してください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?