SlideShare une entreprise Scribd logo
1  sur  14
Securing data
         instances
         with ERBAC
          Kalle Korhonen




tynamo.org - Apache Tapestry - Apache Shiro
Me and open source
• Founder of Tynamo.org
   • a full web stack suite for
     Tapestry 5
   • successor to Trails Framework,
     one of the original Ruby on
     Rails wannabes for Java
• Committer to Apache Tapestry,
  Apache Shiro




        tynamo.org - Apache Tapestry - Apache Shiro
Tynamo.org
• Some stats :
   • 5 active committers, 13 all time
   • similar in size with Apache Shiro
   • 22 individual modules + sub
     modules
• tapestry-model the bread and
  butter: the most customizable
  CRUD framework for Java
• recently more JPA modules



       tynamo.org - Apache Tapestry - Apache Shiro
Security related modules
• tapestry-security, Apache Shiro
  integration for Tapestry 5
• tynamo-federatedaccounts, account
  federation with remote authentication
  providers (Facebook, Twitter, Google,
  LDAP, etc.)
• tapestry-editablecontent, poor man's
  CMS, currently JPA only
• - tynamo-federatedaccounts-
  rollingtokens, rememberme
  authentication based on rolling tokens
          tynamo.org - Apache Tapestry - Apache Shiro
tapestry-editablecontent




     tynamo.org - Apache Tapestry - Apache Shiro
tynamo-federatedaccounts
•   Oauth: Facebook, Twitter, ...
•   OpenID
•   Not protocol specific
public static void bind(ServiceBinder binder) {
  binder.bind(FederatedAccountService.class,
DefaultHibernateFederatedAccountServiceImpl.class);
}

public static void contributeFederatedAccountService(MappedConfiguration<String,
Object> configuration) {
  configuration.add("*", User.class);
  configuration.add("facebook.id", "facebookId");
}

public static void contributeApplicationDefaults(MappedConfiguration<String,
String> configuration) {
  configuration.add(FacebookRealm.FACEBOOK_CLIENTID, "<client id>");
  configuration.add(FacebookRealm.FACEBOOK_CLIENTSECRET, "<client secret>");
}


                     tynamo.org - Apache Tapestry - Apache Shiro
tapestry-security
• started out as a thin layer
• replaced (Ini)ShiroFilter
• replaced ini configuration with
  Tapestry's all-in-java contributions
• replaced shiro's built-in filters with
  our own base classes
• proving ground for new stuff (e.g.
  logical operator first existed in
  tapestry-security)



        tynamo.org - Apache Tapestry - Apache Shiro
Security check points

• secure views (url-based,
  annotations)
• secure method invocations (role-
  type)
• secure data - how?
• how do I declare that user can only
  edit his profile?




       tynamo.org - Apache Tapestry - Apache Shiro
Current approach..
@Override
protected AuthorizationInfo
doGetAuthorizationInfo(PrincipalCollection principals) {
  SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
  info.addStringPermission("account:update:1");
}


// page template...
<t:security.haspermission permission="editEntityPermission">
...
</t:security>


// page class (controller)
public String getEditEntityPermission() {
  return "account:edit:" + entityId;
}




               tynamo.org - Apache Tapestry - Apache Shiro
What if you could just do..
@Entity
@RequiresAssociation(value = "owner", operations =
Operation.UPDATE)
public class Account {
  @OneToOne
  private User owner;
}




            tynamo.org - Apache Tapestry - Apache Shiro
ERBAC
• Entity-Relationship Based Access
  Control
• Initial concept 5 years ago with
  Hibernate !
• find out how the data is associated
  with the currently executing subject
• secure entities with annotations
• role-based security is easy
• allow limiting scope to a specific
  CRUD operation (CREATE, READ,
  UPDATE, DELETE)
        tynamo.org - Apache Tapestry - Apache Shiro
EntityManager operations
• SecureEntityManager used
  automatically when Subject is bound
• find -> READ (separate service for
  lists)
• merge (INSERT if doesn't exist)
• persist (update -> remove + insert)
• remove
• create*query() operations are
  unprotected
• takes care of 80% of instance
  security needs
       tynamo.org - Apache Tapestry - Apache Shiro
What next?
• same model would work for
  Hibernate, JDO..
• push to Shiro?
• at least annotations
  ... anything more is difficult because
  Shiro is persistence agnostic




        tynamo.org - Apache Tapestry - Apache Shiro
Thank you!

For more information, visit :
http://tynamo.org/tapestry-
security-jpa+guide

What do You think?




      tynamo.org - Apache Tapestry - Apache Shiro

Contenu connexe

Similaire à Securing Data Instances with ERBAC

Building Deep Learning Applications with TensorFlow and Amazon SageMaker
Building Deep Learning Applications with TensorFlow and Amazon SageMakerBuilding Deep Learning Applications with TensorFlow and Amazon SageMaker
Building Deep Learning Applications with TensorFlow and Amazon SageMakerAmazon Web Services
 
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlow
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlowAWS Machine Learning Week SF: Amazon SageMaker & TensorFlow
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlowAmazon Web Services
 
Build Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerBuild Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerAmazon Web Services
 
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...Amazon Web Services
 
Build Deep Learning Applications with TensorFlow and Amazon SageMaker
Build Deep Learning Applications with TensorFlow and Amazon SageMakerBuild Deep Learning Applications with TensorFlow and Amazon SageMaker
Build Deep Learning Applications with TensorFlow and Amazon SageMakerAmazon Web Services
 
Workshop: Build Deep Learning Applications with TensorFlow and SageMaker
Workshop: Build Deep Learning Applications with TensorFlow and SageMakerWorkshop: Build Deep Learning Applications with TensorFlow and SageMaker
Workshop: Build Deep Learning Applications with TensorFlow and SageMakerAmazon Web Services
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Tim Plummer
 
Django Overview
Django OverviewDjango Overview
Django OverviewBrian Tol
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaSAppsembler
 
Tajo Seoul Meetup-201501
Tajo Seoul Meetup-201501Tajo Seoul Meetup-201501
Tajo Seoul Meetup-201501Jinho Kim
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...Databricks
 
End-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and AtlasEnd-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and AtlasDataWorks Summit
 
Apache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San JoseApache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San JoseHao Chen
 
Workshop: Big Data Visualization for Security
Workshop: Big Data Visualization for SecurityWorkshop: Big Data Visualization for Security
Workshop: Big Data Visualization for SecurityRaffael Marty
 
Robert Meyer- pypet
Robert Meyer- pypetRobert Meyer- pypet
Robert Meyer- pypetPyData
 
Introduction to Apache NiFi 1.11.4
Introduction to Apache NiFi 1.11.4Introduction to Apache NiFi 1.11.4
Introduction to Apache NiFi 1.11.4Timothy Spann
 
DSpace 4.2 Transmission: Import/Export
DSpace 4.2 Transmission: Import/ExportDSpace 4.2 Transmission: Import/Export
DSpace 4.2 Transmission: Import/ExportDuraSpace
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNEDChris Gates
 

Similaire à Securing Data Instances with ERBAC (20)

Building Deep Learning Applications with TensorFlow and Amazon SageMaker
Building Deep Learning Applications with TensorFlow and Amazon SageMakerBuilding Deep Learning Applications with TensorFlow and Amazon SageMaker
Building Deep Learning Applications with TensorFlow and Amazon SageMaker
 
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlow
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlowAWS Machine Learning Week SF: Amazon SageMaker & TensorFlow
AWS Machine Learning Week SF: Amazon SageMaker & TensorFlow
 
Build Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerBuild Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMaker
 
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...
Build Deep Learning Applications with TensorFlow & SageMaker: Machine Learnin...
 
Build Deep Learning Applications with TensorFlow and Amazon SageMaker
Build Deep Learning Applications with TensorFlow and Amazon SageMakerBuild Deep Learning Applications with TensorFlow and Amazon SageMaker
Build Deep Learning Applications with TensorFlow and Amazon SageMaker
 
Workshop: Build Deep Learning Applications with TensorFlow and SageMaker
Workshop: Build Deep Learning Applications with TensorFlow and SageMakerWorkshop: Build Deep Learning Applications with TensorFlow and SageMaker
Workshop: Build Deep Learning Applications with TensorFlow and SageMaker
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
 
Django Overview
Django OverviewDjango Overview
Django Overview
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
 
Tajo Seoul Meetup-201501
Tajo Seoul Meetup-201501Tajo Seoul Meetup-201501
Tajo Seoul Meetup-201501
 
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
HIPAA Compliant Deployment of Apache Spark on AWS for Healthcare Nitin Panjwa...
 
End-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and AtlasEnd-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and Atlas
 
Apache Eagle: Secure Hadoop in Real Time
Apache Eagle: Secure Hadoop in Real TimeApache Eagle: Secure Hadoop in Real Time
Apache Eagle: Secure Hadoop in Real Time
 
Apache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San JoseApache Eagle at Hadoop Summit 2016 San Jose
Apache Eagle at Hadoop Summit 2016 San Jose
 
Workshop: Big Data Visualization for Security
Workshop: Big Data Visualization for SecurityWorkshop: Big Data Visualization for Security
Workshop: Big Data Visualization for Security
 
Robert Meyer- pypet
Robert Meyer- pypetRobert Meyer- pypet
Robert Meyer- pypet
 
PyFilesystem
PyFilesystemPyFilesystem
PyFilesystem
 
Introduction to Apache NiFi 1.11.4
Introduction to Apache NiFi 1.11.4Introduction to Apache NiFi 1.11.4
Introduction to Apache NiFi 1.11.4
 
DSpace 4.2 Transmission: Import/Export
DSpace 4.2 Transmission: Import/ExportDSpace 4.2 Transmission: Import/Export
DSpace 4.2 Transmission: Import/Export
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNED
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Securing Data Instances with ERBAC

  • 1. Securing data instances with ERBAC Kalle Korhonen tynamo.org - Apache Tapestry - Apache Shiro
  • 2. Me and open source • Founder of Tynamo.org • a full web stack suite for Tapestry 5 • successor to Trails Framework, one of the original Ruby on Rails wannabes for Java • Committer to Apache Tapestry, Apache Shiro tynamo.org - Apache Tapestry - Apache Shiro
  • 3. Tynamo.org • Some stats : • 5 active committers, 13 all time • similar in size with Apache Shiro • 22 individual modules + sub modules • tapestry-model the bread and butter: the most customizable CRUD framework for Java • recently more JPA modules tynamo.org - Apache Tapestry - Apache Shiro
  • 4. Security related modules • tapestry-security, Apache Shiro integration for Tapestry 5 • tynamo-federatedaccounts, account federation with remote authentication providers (Facebook, Twitter, Google, LDAP, etc.) • tapestry-editablecontent, poor man's CMS, currently JPA only • - tynamo-federatedaccounts- rollingtokens, rememberme authentication based on rolling tokens tynamo.org - Apache Tapestry - Apache Shiro
  • 5. tapestry-editablecontent tynamo.org - Apache Tapestry - Apache Shiro
  • 6. tynamo-federatedaccounts • Oauth: Facebook, Twitter, ... • OpenID • Not protocol specific public static void bind(ServiceBinder binder) { binder.bind(FederatedAccountService.class, DefaultHibernateFederatedAccountServiceImpl.class); } public static void contributeFederatedAccountService(MappedConfiguration<String, Object> configuration) { configuration.add("*", User.class); configuration.add("facebook.id", "facebookId"); } public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration) { configuration.add(FacebookRealm.FACEBOOK_CLIENTID, "<client id>"); configuration.add(FacebookRealm.FACEBOOK_CLIENTSECRET, "<client secret>"); } tynamo.org - Apache Tapestry - Apache Shiro
  • 7. tapestry-security • started out as a thin layer • replaced (Ini)ShiroFilter • replaced ini configuration with Tapestry's all-in-java contributions • replaced shiro's built-in filters with our own base classes • proving ground for new stuff (e.g. logical operator first existed in tapestry-security) tynamo.org - Apache Tapestry - Apache Shiro
  • 8. Security check points • secure views (url-based, annotations) • secure method invocations (role- type) • secure data - how? • how do I declare that user can only edit his profile? tynamo.org - Apache Tapestry - Apache Shiro
  • 9. Current approach.. @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); info.addStringPermission("account:update:1"); } // page template... <t:security.haspermission permission="editEntityPermission"> ... </t:security> // page class (controller) public String getEditEntityPermission() { return "account:edit:" + entityId; } tynamo.org - Apache Tapestry - Apache Shiro
  • 10. What if you could just do.. @Entity @RequiresAssociation(value = "owner", operations = Operation.UPDATE) public class Account { @OneToOne private User owner; } tynamo.org - Apache Tapestry - Apache Shiro
  • 11. ERBAC • Entity-Relationship Based Access Control • Initial concept 5 years ago with Hibernate ! • find out how the data is associated with the currently executing subject • secure entities with annotations • role-based security is easy • allow limiting scope to a specific CRUD operation (CREATE, READ, UPDATE, DELETE) tynamo.org - Apache Tapestry - Apache Shiro
  • 12. EntityManager operations • SecureEntityManager used automatically when Subject is bound • find -> READ (separate service for lists) • merge (INSERT if doesn't exist) • persist (update -> remove + insert) • remove • create*query() operations are unprotected • takes care of 80% of instance security needs tynamo.org - Apache Tapestry - Apache Shiro
  • 13. What next? • same model would work for Hibernate, JDO.. • push to Shiro? • at least annotations ... anything more is difficult because Shiro is persistence agnostic tynamo.org - Apache Tapestry - Apache Shiro
  • 14. Thank you! For more information, visit : http://tynamo.org/tapestry- security-jpa+guide What do You think? tynamo.org - Apache Tapestry - Apache Shiro