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
SQL SECURITY特性の扱いと作ったパッチ
Search
tom--bo
August 27, 2024
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SQL SECURITY特性の扱いと作ったパッチ
tom--bo
August 27, 2024
More Decks by tom--bo
See All by tom--bo
DDLが取得するMDLの調査(私的)まとめ
tombo
3
180
安全なDDLの実行を目指して 〜(その1)取得するMDLの把握〜
tombo
0
200
MyRaft論文紹介
tombo
3
1k
2PC between Binlog and InnoDB
tombo
1
380
WIP: 2PC between binlog and InnoDB
tombo
1
280
Dive into InnoDB from redo logs
tombo
3
1.9k
MySQLアンカンファレンス01_mysqlredo
tombo
1
1.2k
MySQLアンカンファレンス 開催概要
tombo
0
340
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
450
エンジニアに許された特別な時間の終わり
watany
108
250k
Between Models and Reality
mayunak
4
460
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Six Lessons from altMBA
skipperchong
29
4.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Mind Mapping
helmedeiros
1
360
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
So, you think you're a good person
axbom
PRO
2
2.2k
It's Worth the Effort
3n
188
29k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Transcript
SQL SECURITY特性の扱い と 作ったパッチ MySQLアンカンファレンス 第6回 @tom__bo
SQL SECURITY句とは • VIEW, STORED FUNCTION/PROCEDUREなどを作成するときに 設定できるセキュリティコンテキスト • ex) CREATE
SQL SECURITY INVOKER VIEW V1 AS SELECT * FROM t1; • 設定できる値 • “DEFINER “ : オブジェクトの定義者のアカウント権限で実行 • “INVOKER “ : オブジェクトの呼び出し元のアカウント権限で実行 • デフォルトは”DEFINER”
ありがちなオペレーションミス • ユーザu1でVIEW作成 • 管理者ユーザでu1の削除 (SUPER or SET_USER_ID権限を持つ)
ありがちなオペレーションミス • VIEWを参照するとエラー • (補足: SET_USER_ID権限がないユーザからは消せない(8.0.22以降))
考えられる対策例 1. SET_USER_ID権限を適切に管理する • ユーザ削除にSUPER or SET_USER_ID権限をもつユーザを使わない 2. ユーザの削除前にDEFINERに指定されていないか確認 3.
DEFINERを絶対削除しない固定ユーザにする 4. 常にSQL SECURITY INVOKER で定義する SQL SECURITYのデフォルトを INVOKERにする設定とか作れない? 見てみますー (変数追加と数行の追加でできた)
作ったパッチ • default_sql_security_invoker = ONにするとデフォルトでSQL SECURITY INVOKERでオブジェクトが作成される
DEFAULTをINVOKERにするパッチ(プロトタイプ) • システム変数の定義(set sessionも可能な定義方法)
DEFAULTをINVOKERにするパッチ(プロトタイプ) • 作成時の条件分岐追加
疑問と感想 • 運用上SQL SECURITY 特性をどう管理されてます? • 1変数を追加するほどのことではない? • ちゃんと権限管理してないのが悪い気が... •
trigger, eventにはsql security特性がない DEFINER相当になるので、同じ方法は取れない
None