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
knockrd / kichijojipm23
Search
FUJIWARA Shunichiro
July 21, 2020
Technology
370
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
knockrd / kichijojipm23
FUJIWARA Shunichiro
July 21, 2020
Transcript
16 slides
knockrd @fujiwara 2020.07.21 ٢ࣉ.pm23
ࣗݾհ @fujiwara github.com/fujiwara
ʮࠓͷલͷ׆ಈΛৼΓฦΔʯ
ςϨϫʔΫ VPN ͕ ͳ͍ͱͩΊʁ
VPN ૿ڧରԠ
ͳͥ VPN ͕ඞཁ͔ 1. ࣾωοτϫʔΫͷαʔόʹΞΫηε͢ΔͨΊ • ํͳ͍ • Ͱฐࣾʹ͏΄΅ଘࡏ͠ͳ͍ (AWS,
G Suite...) 2. ֎෦ͷαʔό͕ଓݩIPΞυϨεΛ੍ݶ͍ͯ͠Δ • Θ͔Δ • Ͱਏ͍ɻͰ͖ΕΊ͍ͨ
IP ΞυϨε੍ݶͷͳʹ͕ਏ͍͔ ڌ͕͍ͬͺ͍͋Δ (ΦϑΟε͝ͱʹIPΞυϨε) ૿͑ͨΓݮͬͨΓ͢Δ (ͦͷͨͼʹՃআ໘) ݹ͍ΞυϨεΛফ͠ΕΔ (ଘࡏࣗମΕ͍ͯΔ) IPΞυϨεͰ੍ݶͯ͠Δ͔ΒͬͯϢϧϢϧʹ͕ͪ͠ (ଞͷೝূΛαϘΔ)
ϦϞʔτϫʔΫͰ VPN ͕ඞཁ !!!
IP ΞυϨε੍ݶҎ֎ͷೝূΛֻ͚Ε… • github.com/oauth2-proxy/oauth2-proxy • github.com/sorah/nginx_omniauth_adapter • github.com/shogo82148/go-nginx-oauth2-adapter • AWS
ALB طଘΞϓϦέʔγϣϯʹखΛೖΕͣʹ OAuth(OIDC)ೝূΛՃͰ͖Δɻ࠷ߴศར
ΉΛಘͣIPΞυϨε੍ݶΛ͍ͨ͠໘ ϒϥβҎ֎͔ΒΞΫηε͍ͨ͠Ϣʔεέʔε͕͋Δ CLI, ϒϥβͰͳ͍ήʔϜͷΫϥΠΞϯτͳͲ ϒϥβͰͳ͍ͨΊOAuth(OIDC)ೝূͰ͖ͳ͍ ฐࣾͰͷྫ • ։ൃதήʔϜͷσόοάAPI • αʔόϝϯςφϯεதʹಈ࡞֬ೝ
ͭ͘Γ·ͨ͠ knockrd github.com/fujiwara/knockrd
github.com/fujiwara/knockrd ϒϥβͰΞΫηεͨ͠IPΞυϨε͔ΒͷଓΛ ҰఆظؒڐՄ͢ΔͨΊͷιϑτΣΞ (໊લ port knocking ͔ΒΠϯεύΠΞ) 1. /allow ΛͳΜΒ͔ͷํ๏(OAuthͱ͔)Ͱอޢ
2. POST /allow → IPΞυϨεΛ DynamoDB ʹه ͜ͷઌ͍͔ͭ͘ͷํ๏Ͱ…
nginx auth_request ͱΈ߹ΘͤΔ 1. /allow ΛͳΜΒ͔ͷํ๏(OAuthͱ͔)Ͱอޢ 2. POST /allow →
IPΞυϨεΛ DynamoDB ʹه 3. ଞͷ URL ͷΞΫηεͰ nginx auth_request ͕ GET /auth 4. DynamoDB ʹ͋ΔIPΞυϨεͳΒ 200 OK 5. ͳ͔ͬͨΓ Expire ͢Δͱ 401 Unauthorized
None
AWS WAFv2 / SecurityGroupͱΈ߹ΘͤΔ 1. /allow ΛͳΜΒ͔ͷํ๏(OAuthͱ͔)Ͱอޢ 2. POST /allow
→ IPΞυϨεΛ DynamoDB ʹه 3. DynamoDB Stream ͔Β Lambda ͕ىಈ 4. WAF IP Set / Security Group ʹ IPΞυϨεΛొ 5. Disallow / Expire ͢Δͱ Lambda ͕ىಈ 6. WAF IP Set / Security Group ͔Β IPΞυϨεΛআ
None
༻๏ɾ༻ྔΛक͓͍͍ͬͯͩ͘͞ ಛఆͷIPΞυϨεΛҰఆ࣌ؒ(ઃఆՄೳ)͚ͩڐՄͰ͖Δ ࣌ݶͰࣗಈআɻ์ஔͯ͠ةݥ͕ӬଓԽͮ͠Β͍ ϓϩόΠμͰNAT͞Ε͍ͯΔͱͦͷIPΞυϨεΛ͍ͬͯΔͷ ͚ࣗͩ͡Όͳ͍Մೳੑ͕͋ΔͷͰҙ (͋Δఔͷ͕ࣝ͋ΔΤϯδχΞ͚) ϒϥβ͚ͩͰΞΫηε͢Δͷૉʹ oauth2-proxy ͱ͔Ͱ github.com/fujiwara/knockrd
More Decks by FUJIWARA Shunichiro
See All by FUJIWARA Shunichiro
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
620
クラウドを使う側から、作る側へ / 大吉祥寺.pm 2026前夜祭
fujiwara3
8
2.3k
作るべきものと向き合う - ecspresso 8年間の開発史から学ぶ技術選定 / 技術選定con findy 2026
fujiwara3
9
6.6k
さくらのクラウドでのシークレット管理を考える/tamachi.sre#2
fujiwara3
2
440
Amazon ECS デプロイツール ecspresso の開発を支える「正しい抽象化」の探求 / YAPC::Fukuoka 2025
fujiwara3
13
14k
パフォーマンスチューニングのために普段からできること/Performance Tuning: Daily Practices
fujiwara3
9
7.1k
alecthomas/kong はいいぞ
fujiwara3
7
2.7k
ecspressoの設計思想に至る道 / sekkeinight2025
fujiwara3
12
3.9k
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
4
5.9k
Other Decks in Technology
See All in Technology
Taking back control of your AI development
inesmontani
PRO
0
320
人の努力に頼らないセキュリティをエンジニアリングする在り方 / An approach to engineering security that does not rely on human effort
carta_engineering
0
240
落とし穴にハマってわかった 開発生産性を測るときに気をつけたいこと
munakata
3
500
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
510
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
「個社」ではなく「業界」の課題を解く AI 対話開発 ー 価値を広げる設計と、価値を守るエンジニアリング ー
ivry_presentationmaterials
4
890
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
280
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
310
正しくWeb サイトを守るためのコンテンツセキュリティーポリシー
hinalin
0
160
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
260
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
3
1.4k
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
250
Featured
See All Featured
Designing for Performance
lara
612
70k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Bash Introduction
62gerente
615
220k
The Language of Interfaces
destraynor
163
27k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
310
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
390
The Spectacular Lies of Maps
axbom
PRO
1
1.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Balancing Empowerment & Direction
lara
6
1.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
970
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k