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
Data-Centric Security
Search
Boris Staal
October 13, 2013
Programming
160
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Data-Centric Security
http://13.rupy.eu
Boris Staal
October 13, 2013
Other Decks in Programming
See All in Programming
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
160
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
400
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
sbt 2.0: takeoff
eed3si9n
0
160
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.4k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
How to Ace a Technical Interview
jacobian
280
24k
Documentation Writing (for coders)
carmenintech
77
5.6k
ラッコキーワード サービス紹介資料
rakko
1
5.4M
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Why Our Code Smells
bkeepers
PRO
340
58k
GraphQLとの向き合い方2022年版
quramy
50
15k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
Technical Leadership for Architectural Decision Making
baasie
3
600
Music & Morning Musume
bryan
48
7.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Transcript
SECURITY Data-Centric
Security?
Sanitization CSRF XSS DOS ACL Roles Rules Fields
ACL {1. Authentication 2. Role matching 3. Endpoint access 4.
Action access 5. Field access
How do we typically do that? attr_accessible strong parameters
CanCan
10s of roles 100s of models of controllers of contexts
Logical Rules Physical Rules
Controllers Nesting Context
Account Product Widget Sidekiq Card Model ...
Data-Centric Model + Concern
Concern Presenter CanCan strong parameters {
Fields Management
Dependencies Modules Duplication
Protector github.com/inossidabile/protector
Card Model Title Number Cardholder Admin Other read write read
write read write read write read write read write
Card.restrict!(current_user) User’s Cards
Card.restrict!(current_user) all cards of the user Card.first.restrict!(current_user) first card of
the user Card.restrict!(current_user).first
ORM SAFE { :can :cannot :scope
class Card < ActiveRecord::Base protect do |user| if user.admin? can
:view cannot :view, :number can :create can :update, %w(title number) can :destroy end end end
class Card < ActiveRecord::Base protect do |user, card| if card.try(:user_id)
== user.id can :view cannot :view, :number can :create can :update, %w(title number) can :destroy end end end
:can :cannot Validations !
{ title: 'My Account', number: '1234567890', cards_attributes: [ { title:
'My Card', number: '4242424242424242', transactions_attributes: [ { date: '2013-01-01 20:40:00', sum: 100.4 } ] } ] }
:can :cannot Associations !
class Alice < Sequel::Model protect do |realm| if realm.wonderland? can
:drink can :eat, :cake end end end
:can :cannot Custom Rules !
class Card < ActiveRecord::Base protect do |user| if user.admin? scope
{ all } else scope { where(hidden: false) } end end end
Eager Loading ! :scope
class CardsController def index @cards = Card.restrict!(current_user) .page(params[:page]) end def
update Card.restrict!(current_user) .find(params[:id]) .update_attributes(params[:card]) end end ORM SAFE
ActiveRecord Sequel Mongoid
Protector:: CanCan InheritedResources SimpleForm StrongParameters
Protector Meta =
serving point serialization template CRUD logic Jbuilder Routes Protector
Protector The future
ActiveRecord Sequel Mongoid Data Mapper (ROM)
Data Throttling Sanitization ACL
PAAS Platform Jbuilder Protector Slash Admin
Questions! http://stackoverflow.com #protector irc.freenode.net #protector.rb