Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OU外でもIAM Identity Centerを使いたい!
Search
kokamoto01
July 08, 2024
680
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OU外でもIAM Identity Centerを使いたい!
kokamoto01
July 08, 2024
More Decks by kokamoto01
See All by kokamoto01
20251211_第2木曜LT会
kokamoto01_metaps
1
120
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
620
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
960
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Practical Orchestrator
shlominoach
191
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Designing Experiences People Love
moore
143
24k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
170
Prompt Engineering for Job Search
mfonobong
0
370
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
440
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Transcript
©2024 Metaps Holdings, Inc. OU外でもIAM Identity Centerを 使いたい! 株式会社メタップスホールディングス SRE
こかも (岡本 健太郎)
©2024 Metaps Holdings, Inc. ⾃⼰紹介 略歴 SIerでクラウドインフラ3年 -> 現職でSRE 趣味
DJ, ⾳楽ゲーム, ポーカー, ダーツ, サウナ 岡本 健太郎 株式会社メタップスホールディングス SRE Okamoto Kentaro @kokamoto01 フォローしてね
©2024 Metaps Holdings, Inc. 社名 株式会社メタップスホールディングス (Metaps Holdings, Inc.)
設立 2023年1月26日 資本金 100百万円(資本準備金を含む) ※2023年12月末時点 所在地 東京都渋谷区渋谷二丁目24番12号 渋谷スクランブルスクエア 従業員数 72名 ※2023年12月末時点 経営陣 代表取締役 山﨑 祐一郎 取締役 原 大輔 取締役 青沼 克典 社外取締役 大谷 仁人 監査役 萩野矢 宏樹 事業内容 クラウドとAIを中心にしたインキュベーション テクノロジー企業への投資 MISSION テクノロジーでお金と経済のあり方を変える 世界を解き放つ VISION 会社概要
©2024 Metaps Holdings, Inc. 4 srestはAWSファンデーショナルテクニカルレビュー (FTR)認証を取得しています 無料トライアル実施中 >
©2024 Metaps Holdings, Inc. ©2024 Metaps Holdings, Inc. 5 インフラ基盤
アプリケーションが 動いてる環境 アプリケーションのエラーを トラッキングするツール オンコール担当 (SRE) に障害を エスカレーションするサービス インフラ基盤の監視 エラートラッキング オンコール通知 srestは各種インフラサービスのインテグレーション先となり、 各サービスのイベントログを集積‧可視化する基盤に イベントログの集積‧可視化 システムメトリクス 監視ツール 5 5 無料トライアル実施中 >
©2024 Metaps Holdings, Inc. IAM Identity Center
©2024 Metaps Holdings, Inc. https://speakerdeck.com/opelab/20240621-aws-summit-iam ⽇本⼀わかりやすいIAM Identity Centerの概要はこちら
©2024 Metaps Holdings, Inc. IAMポリシーのみでAWSアカウントにログインできるSSOサービス 「許可セット」を使うことで IAMポリシー名を指定するだけで ログイン先の設定が完了する 😆 アクセスキー&シークレットアクセス
キーを抹消できる MFAを各アカウントで 設定する必要がなくなる CLIでもaws sso loginコマンドで⼀発 -> 依存関係がなくシンプル つまりIAMユーザー不要!?
©2024 Metaps Holdings, Inc. 許可セットには落とし⽳がある OU(Organization Unit) 内に 存在するアカウントのみに設定可能 ビジネスパートナーに
SSO適⽤できない!?
©2024 Metaps Holdings, Inc. じゃあどうすればいいの?
©2024 Metaps Holdings, Inc. 「IAM Identity Centerアプリケーション」を使いましょう SAML認証経由で AWSアカウントにアクセス (AssumeRole)
IAMポリシーではなく IAMロールを参照する 信頼ポリシーの変更不要!
©2024 Metaps Holdings, Inc. 作り⽅ • アプリケーション -> 「カタログからアプリケーションを選択」 ->
「External AWS Account」 • 「IAM Identity Center メタデータファイル」をダウンロード (GitHub等ソースコード管理下におくことを推奨)
©2024 Metaps Holdings, Inc. 作り⽅ • ログイン先アカウントで IAM -> IDプロバイダを追加
Terraformでリソースを作成することができるので、メタデータの管理が活きる
©2024 Metaps Holdings, Inc. 作り⽅ • 親アカウントに戻って、IICアプリケーションを選択 ->「属性マッピング」 • IICグループにユーザーをアタッチ
• IICグループをアプリケーションに割り当てる アプリケーションのユー ザー属性 ユーザー属性マッピング 形式 https://aws.amazon.com/SAML /Attributes/Role https://aws.amazon.com/SAML/Attributes/Role arn:aws:iam::{AWSアカウントID}:saml-provider/{IDプロバイ ダー},arn:aws:iam::{AWSアカウントID}:role/{IAMロール} unspecified 属性マッピングの設定例
©2024 Metaps Holdings, Inc. できた!
©2024 Metaps Holdings, Inc. マネジメントコンソールのアクセスはできた。 でもCLIでのアクセスはどうすれば?
©2024 Metaps Holdings, Inc. 現状公式から提供されている⽅法は現実的ではない https://repost.aws/ja/knowledge-center/aws-cli-call-store-saml-credentials 1. ブラウザでデベロッパーツールを開きPOSTメソッドからSAMLResponseを探す 2. 1のログを保存して
aws sts assume-role-with-saml コマンドを⼊⼒ 3. 2の出⼒結果から”AccessKeyId”, ”SecretAccessKey”, ”SessionToken” を ~/.aws/credentials に保存 これ毎回やるの!?
©2024 Metaps Holdings, Inc. 「saml2aws」を使いましょう https://github.com/Versent/saml2aws
©2024 Metaps Holdings, Inc. 現状公式から提供されている⽅法は現実的ではない https://repost.aws/ja/knowledge-center/aws-cli-call-store-saml-credentials 1. ブラウザでデベロッパーツールを開きPOSTメソッドからSAMLResponseを探す 2. 1のログを保存して
aws sts assume-role-with-saml コマンドを⼊⼒ 3. 2の出⼒結果から”AccessKeyId”, ”SecretAccessKey”, ”SessionToken” を ~/.aws/credentials に保存 これ毎回やるの!? この作業を⾃動化してくれます
©2024 Metaps Holdings, Inc. どんな仕組み? [example] name = {saml2awsプロファイル名} app_id
= url = {IICアプリケーション URL} username = provider = Browser mfa = Auto mfa_ip_address = skip_verify = false timeout = 0 aws_urn = urn:amazon:webservices aws_session_duration = 28800 aws_profile = {AWS CLIプロファイル名} resource_id = subdomain = role_arn = region = http_attempts_count = http_retry_delay = credentials_file = saml_cache = false saml_cache_file = target_url = disable_remember_device = false disable_sessions = false download_browser_driver = false headless = false prompter = ~/.saml2aws (フォーマットバグってますが許してください) ~ % saml2aws login -a {saml2awsプロファイル名} [--download-browser-driver] 1. ~/.saml2awsに設定を記載 2. ターミナルで 下記のコマンドを⼊⼒する aws sso loginコマンドと 同じ感覚で使える! -> STSの⾃動発⾏ + AWS CLIのプロファイル⾃動追加
©2024 Metaps Holdings, Inc. IIC アプリケーションURL ~/.saml2aws
©2024 Metaps Holdings, Inc. 苦労したこと
©2024 Metaps Holdings, Inc. Terraform AWSプロバイダーが(⼀部)対応してない https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/data -sources/sso_application ⭕ AWS
SSO Admin (IIC) ❌ IICアプリケーション awsccプロバイダーでは対応できるが...? -> Terraformプロバイダー利⽤ポリシーが 社内で決まっており今回は断念
©2024 Metaps Holdings, Inc. Google Workspaceとの相性が悪かった 弊社で運⽤しているGoogle Workspaceの組織は2アカウントで契約中 ‧正社員 ‧業務委託
IICのIDソースは1対1での紐付け - Google WorkspaceのIDをソースとしてしまうと 業務を担当している⼈全員にSSOが⾏き渡らない IICが発⾏している IDソースを使うことで解決