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
Everyone Now Understands AuthZ/AuthN and Encryp...
Search
sylph01
November 26, 2024
1
54
Everyone Now Understands AuthZ/AuthN and Encryption Perfectly and I'm Gonna Lose My Job
11/26/2024 @ Kyoto.rb Meetup
https://kyotorb.connpass.com/event/337169/
sylph01
November 26, 2024
Tweet
Share
More Decks by sylph01
See All by sylph01
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
6
1.1k
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too
sylph01
1
86
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too (JP subtitles)
sylph01
2
400
Introduction to C Extensions
sylph01
3
190
"Actual" Security in Microcontroller Ruby!?
sylph01
0
130
Updates on PicoRuby Networking, HPKE (and maybe more)
sylph01
1
290
Adding Security to Microcontroller Ruby
sylph01
3
3.5k
Secure Messaging at IETF 118
sylph01
0
100
Adventures in the Dungeons of OpenSSL
sylph01
0
600
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Speed Design
sergeychernyshev
30
960
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Being A Developer After 40
akosma
91
590k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.8k
KATA
mclloyd
29
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Navigating Team Friction
lara
185
15k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Transcript
Everyone Now Understands AuthZ/AuthN and Encryption Perfectly and I'm Gonna
Lose My Job sylph01 @ Kyoto.rb Meetup Kaigi on Rails 2024 Recap, 2024/11/26 1
だれ やせいのプログラマ。認証認可とか暗号と かできます けどKaigi on Rails を経てもうみんなで きるよって話をします RubyKaigi 2025
のローカルオーガナイザー をしています 愛媛県松山市に住んでいます 画像はWeb サイトより 2
3
背景 Kaigi on Rails 2021 で "Build and Learn Rails
Authentication" というトークをしました ログイン・ログアウト、クッキーから の自動再ログイン、パスワードリセッ ト、ロックアウト etc. の自作を通して 認証の動作原理を学ぶ、という内容で す 4
Rails API モードのためのシンプルで効 果的なCSRF 対策 (@corocn) 「なんかとりあえずしーえすあーるえふとーくんとかいうのを発行 しておけばいいんでしょ」っていう状態を脱することができる内容 CSRF って何?→「ぼくはまちちゃん!」で検索だ!
( 一般的には) 悪意のあるサイトが被攻撃者の認証済みセッショ ンを利用してリクエストを実行できてしまうこと セッションCookie が自動的に送られてしまうことを利用 5
Rails API モードのためのシンプルで効 果的なCSRF 対策 (@corocn) API モードにおいてCSRF トークンを受け渡しするのは極めてしんど い
なので Web 標準を使って 対策しよう ("Standardization is King") Origin 検証をしよう SameSite 属性を適切に設定しよう 6
OmniAuth から学ぶOAuth 2.0 (@ykpythemind) 要するに3 年前に話さなかった部分の話。 7
Page 9 - https:/ /speakerdeck.com/ykpythemind/omniauthkaraxue-buoauth2-dot-0-kaigi-on-rails-2024?slide=9 8
Page 17 - https:/ /speakerdeck.com/sylph01/build-and-learn-rails-authentication?slide=17 9
なげえよ Page 17 - https:/ /speakerdeck.com/sylph01/build-and-learn-rails-authentication?slide=17 10
Page 56 - https:/ /speakerdeck.com/ykpythemind/omniauthkaraxue-buoauth2-dot-0-kaigi-on-rails-2024?slide=56 11
このネタ入れてきたの最高 Kaigi on Rails 2020 のときにDNS の話で「浸透」の話入れてきた のと同じ香りがしてよい Page 56
- https:/ /speakerdeck.com/ykpythemind/omniauthkaraxue-buoauth2-dot-0-kaigi-on-rails-2024?slide=56 12
大事なデータを守りたい!ActiveRecord Encryption と、より安全かつ検索可能な暗号化手法の実装例の 紹介 (@free_world21) 「あくてぃぶれこーどえんくりぷしょんってのがあるから暗号化は 楽勝!w」という状態を脱することができる内容 「レコードごとに異なる暗号鍵を使う」っていうのがActiveRecord Encryption ではできない、のでattr_encrypted
gem でそれを実現する カラムごとに違う鍵を使う、っていうのはできるように見える 13
大事なデータを守りたい!ActiveRecord Encryption と、より安全かつ検索可能な暗号化手法の実装例の 紹介 (@free_world21) 決定論的暗号化を使うと検索が可能になる 同じ平文に対して必ず同じ暗号文が得られる 当たり前では? → 初期化ベクタがランダマイズされてるとそ
の限りではない なので決定論的暗号化は多少insecure 「検索可能暗号」っていう技術はあるけど一般での実用化はま だ遠そう 14
https:/ /words.filippo.io/the-ecb-penguin/ "The ECB Penguin" 15
大事なデータを守りたい!ActiveRecord Encryption と、より安全かつ検索可能な暗号化手法の実装例の 紹介 (@free_world21) あと暗号化全般に関して、 「鍵管理は人類には早すぎるよね」っていう 結論になりがち。とてもわかる 16
Identifying User Identity (@moro) これは後でluccafort さんが話すので私からは「えがった… (語彙力) 」で とどめておきます 17
まとめ 全人類が認証認可と暗号化を完全理解してしまった 2024 の発表と2021 のスライドを合わせて読むとカバーしてないと ころもカバーできてさらに完全な理解が得られてしまう(宣伝) s01 氏、失職不可避 18