Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Language-based Security for the Web - Security in MyTimetable

Mark Janssen
December 09, 2015

Language-based Security for the Web - Security in MyTimetable

Guest lecture for CS4105: Software Security (TU Delft / UTwente)

Mark Janssen

December 09, 2015
Tweet

Other Decks in Education

Transcript

  1. 2 About me • Student at TU Delft – MSc

    Embedded Systems • Graduate intern at Riscure – Software reverse engineering and deobfuscation • Developer at Eveoh – We create MyTimetable
  2. 3 About MyTimetable • Platform for publishing timetables (frontend) •

    >25 institutions – Including TU Delft and UTwente • >350.000 students • Developed in Java https://mytimetable.net/
  3. 5 MyTimetable Architecture View • Google Web Toolkit (GWT) •

    HTML+JavaScript • JSON Controller • Web endpoints • Mobile API • REST API • External calendar push Service • Timetables • User profiles Model • Timetable backend (API or database) • User profile storage
  4. 6 Customisation • Different configuration for each institution – Naming

    (course, subject, module: same thing) – Authentication – Authorisation • Modularisation – Different timetable backends – Optional features (e.g. external calendar push) • How to prevent code fragmentation?
  5. 7 Inversion of Control (IoC) • “Don’t call us, we

    call you” – Container initialises your objects (beans/POJOs) • Dependency Injection (DI) – Any classes you depend on are provided (“wired”) by container • Loose coupling – Contracts (interfaces) separate from implementation http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-basics
  6. 8

  7. 9

  8. 12 Security: Authentication • Remembering a student’s timetable • Linking

    with student information systems – Can provide list of enrolled courses – Present a full, preset timetable to student • Authentication standards – SAML 2.0, LDAP, Active Directory, CAS, ...
  9. 17

  10. 18 Authorisation • What pages (URLs) can a user access?

    – /admin only for administrators – Maybe require login for entire app • Which business objects? – Teacher timetables – Concept timetable • Or which parts of business objects (fields)? – Teacher names private
  11. 19

  12. 20

  13. 29 Aspect Oriented Programming (3) • Separation of concerns: Decoupling

    security logic from business logic – Easily change security configuration – Better testability of business logic • Some disadvantages – Needs AOP container or compiler (e.g. AspectJ) – Possible to break security without noticing (so test!) – Proxies cause slight overhead
  14. 30 CSRF protection • Core feature of Spring Security •

    Enabled by default • Requires POST/PATCH/DELETE (!GET) to have valid anti-CSRF token • Token is easily included
  15. 35 Bonus: Testability • Because security is decoupled, testing becomes

    easy • Can remove security for functional testing • Built-in helpers for security testing
  16. 37 Alternative frameworks • Java: Apache Shiro, JBoss PicketLink, HDIV

    • .NET: ASP.NET Identity 2.0, Rhino Security • Rails: Devise, Warden • Node.js: Passport, MustBe • PHP: Symfony, Zend Framework
  17. 38 Conclusions • Apply design patterns • Use a security

    framework • Be sure to thoroughly test • Stay up to date
  18. 39