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
63
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.5k
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too
sylph01
1
100
End-to-End Encryption Saves Lives. You Can Start Saving Lives With Ruby, Too (JP subtitles)
sylph01
2
470
Introduction to C Extensions
sylph01
3
200
"Actual" Security in Microcontroller Ruby!?
sylph01
0
140
Updates on PicoRuby Networking, HPKE (and maybe more)
sylph01
1
300
Adding Security to Microcontroller Ruby
sylph01
3
3.6k
Secure Messaging at IETF 118
sylph01
0
110
Adventures in the Dungeons of OpenSSL
sylph01
0
620
Featured
See All Featured
How to Ace a Technical Interview
jacobian
278
23k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Six Lessons from altMBA
skipperchong
28
3.9k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Bash Introduction
62gerente
613
210k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
690
Automating Front-end Workflow
addyosmani
1370
200k
RailsConf 2023
tenderlove
30
1.1k
The Invisible Side of Design
smashingmag
301
51k
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