$30 off During Our Annual Pro Sale. View Details »
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
85
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
Updates on MLS on Ruby (and maybe more)
sylph01
1
210
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too (RubyConf Taiwan 2025 ver.)
sylph01
1
110
PicoRuby's Networking is Incomplete
sylph01
1
96
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
6
1.9k
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too
sylph01
1
150
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too (JP subtitles)
sylph01
2
750
Introduction to C Extensions
sylph01
3
230
"Actual" Security in Microcontroller Ruby!?
sylph01
0
180
Updates on PicoRuby Networking, HPKE (and maybe more)
sylph01
1
340
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Automating Front-end Workflow
addyosmani
1371
200k
Context Engineering - Making Every Token Count
addyosmani
9
470
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Rails Girls Zürich Keynote
gr2m
95
14k
Writing Fast Ruby
sferik
630
62k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Agile that works and the tools we love
rasmusluckow
331
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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