Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GitHub ActionsとAWSをOIDC認証で連携する
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kazuhiro Seo
April 26, 2025
Technology
240
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GitHub ActionsとAWSをOIDC認証で連携する
GitHub ActionsとAWSをOIDC認証で連携する
Kazuhiro Seo
April 26, 2025
More Decks by Kazuhiro Seo
See All by Kazuhiro Seo
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
560
Gradleとちょっと仲良くなろう
kazuhiro1982
0
130
JavaとWebAssembly
kazuhiro1982
0
170
SpringBoot 3.0 のNative Imageを試してみた
kazuhiro1982
0
460
セッションデータの管理にSpring Sessionを利用する
kazuhiro1982
0
3.7k
AWSのLake Formation Governed Tablesを触ってみた
kazuhiro1982
0
470
VS CodeとRemote Containerで開発環境もコード管理しよう
kazuhiro1982
1
780
SpringBootをコンテナで動かしてみる
kazuhiro1982
0
440
Serverless FrameworkでWebサイトの更新を検知して通知する
kazuhiro1982
0
540
Other Decks in Technology
See All in Technology
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
130
形式手法を使って仕様をコーディングしよう
mikanichinose
0
160
「とりあえず動く」の先へ。 AI時代のチーム開発と内部設計/2026-slsdays
slsops
0
100
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
650
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
290
Lambda MicroVMsは常駐サーバーの代わりに なるか? Kiro Crew を動かして検証してみた / Kiro Crew on Lambda MicroVMs
k_adachi_01
2
350
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
410
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
360
AI Native Platform Engineering 〜PlatformとAgileで“作る速さ”を“価値”へ〜
uya116
0
590
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.5k
顧客の成果創出とプロダクトの成長を 両立するためのFDE
sansantech
PRO
0
610
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
5
2k
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
350
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Invisible Side of Design
smashingmag
301
52k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
560
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
520
Transcript
GitHub Actions とAWS をOIDC 認証で連携する
自己紹介 妹尾一弘 株式会社カオナビ (2025.03~) サーバーサイドエンジニア Go 書いてます 副業 英単語学習アプリ: モチタン
インフラ支援 JavaDo Java 勉強会コミュニティ 運営スタッフ
CI/CD の環境 CI のお仕事はCI 環境のみでは完結しない アプリケーション環境との連携が必須 コンテナイメージをPush したり Lambda をデプロイしたり
アプリケーション環境へのアクセスには認証が必要
CI/CD の認証の課題 人の認証はRole 利用が普及したが、CI 環境 ではまだ静的なシークレットの利用が多い IAM ユーザーのアクセスキーによる管理 漏洩リスクが心配 定期的な更新が必要
管理コストが高い
OIDC 認証とは OAuth 2.0 ベースの認証の仕組み トークンで一時的に認証する メリット: シークレットの管理が不要 一時的な認証情報のみを扱う
実装方法:AWS 側の設定① 1. IAM アイデンティティプロバイダーの作成 プロバイダのタイプ: OpenID Connect プロバイダのURL: https://token.actions.githubusercontent.com
対象者: sts.amazonaws.com
② IAM ロール作成 信頼ポリシーで接続許可 必要な権限を付与 { "Version": "2012-10-17", "Statement": [{
"Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" }, "StringLike": { "token.actions.githubusercontent.com:sub": "repo:your-org/your-repo:*" } } }] }
セキュリティ強化のための条件設定 条件 設定例 効果 特定ブランチのみ repo:org/repo:ref:refs/heads/main main ブランチからのみ許可 特定タグのみ repo:org/repo:ref:refs/tags/v*
v で始まるタグからのみ許可 PR のみ repo:org/repo:pull_request PR からのみ許可 特定環境のみ repo:org/repo:environment:production production 環境からのみ許可 信頼ポリシーで接続元を制限できる "StringLike": { "token.actions.githubusercontent.com:sub": "repo:org/repo:ref:refs/heads/main" }
GitHub Actions 側の設定 id-token: write 権限追加 IAM ロールを指定するだけ アクセスキー不要 ワークフロー設定のポイント
name: Deploy to AWS on: push: branches: [ main ] jobs: deploy: runs-on: ubuntu-latest permissions: id-token: write # OIDC トークン取得に必要 contents: read steps: - uses: actions/checkout@v4 - name: AWS 認証設定 uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ vars.AWS_OIDC_ROLE_ARN }} aws-region: ap-northeast-1 - name: ECR アクセステスト run: aws ecr describe-repositories
まとめ 静的な認証情報が不要になる シンプルな設定で実装可能 柔軟なアクセス制御ができる OIDC 認証を使うことで
ありがとうございました