Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
86
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
98
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
770
Introduction to C Extensions
sylph01
3
240
"Actual" Security in Microcontroller Ruby!?
sylph01
0
180
Updates on PicoRuby Networking, HPKE (and maybe more)
sylph01
1
340
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
KATA
mclloyd
PRO
32
15k
[SF Ruby Conf 2025] Rails X
palkan
0
520
For a Future-Friendly Web
brad_frost
180
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
How STYLIGHT went responsive
nonsquared
100
6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
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