LoginSignup
6
6

More than 5 years have passed since last update.

aws-google-auth (CLIによるSAML認証ツール)を用いたAWSコンソールへのログインができるまで

Last updated at Posted at 2018-10-22

環境

・OS:MacOS
・Python:3.6

はじめに

G Suiteアカウントをフェデレーション(シングルサインオンまたはSSO)プロバイダとして使用してAWS一時認証情報を取得、ログインが可能になりユーザのキー管理は以前よりは手間が減りました。さらに今回はこの作業をCLIでSSOログインできるようにしたいと思います。

準備

  • python3.6が動く環境
  • Homebrewのインストール(xcodeがインストールされていることが前提)
  • pipのインストール(pythonのバージョンに注意)
  • pipコマンドでawscliをインストール
# pip install awscli

実行

  • ~/.aws/configに以下を追記(durationで一時認証から再認証までの間隔を設定)
[profile sts]
region = xx-xxxxxx-x
google_config.ask_role = False
google_config.keyring = False
google_config.duration = 43200
google_config.google_idp_id = xxxxx(google idp)
google_config.role_arn = xxxxx
google_config.google_sp_id = xxxxx(google sp)
google_config.u2f_disabled = False
google_config.google_username = xxxxx
  • pipコマンドでaws-google-authをインストール
# pip install aws-google-auth
$ aws-google-auth

このコマンドのあとパスワードを求められるので、入力してログイン完了です。

6
6
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
6
6